Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the Map of Gpstracker3 username only #77

Open
pharidali opened this issue May 15, 2017 · 15 comments
Open

Show the Map of Gpstracker3 username only #77

pharidali opened this issue May 15, 2017 · 15 comments

Comments

@pharidali
Copy link

Dear sir,

How to show the map of GpsTracker3 only and avoid dropdown Selecter?

Please help me

Thank you.

@pharidali
Copy link
Author

please help me

@brentfraser
Copy link
Collaborator

GpsTracker uses Leaflet for map display. You can experiment with showing a Leaflet map in your web page, then you will have to write some PHP (similar to GpsTracker's getrouteformap.php) to get locations based on a userid.

@pharidali
Copy link
Author

In the DropDown Box if we click on the GpsTracker3 , The Map shows GpsTracker3 Location only. So i think it open on a link. Can we find the link?

@pharidali
Copy link
Author

??

@brentfraser
Copy link
Collaborator

Not really a link, it's a URL with a session ID (a route and a session are the same thing):

https://www.websmithing.com/gpstracker/getrouteformap.php?sessionid=50053a16-e56a-49fc-99d7-cf19455892e3

One user may have many routes listed in the dropdown and the sessionid changes everytime the user stops and starts tracking.

@pharidali
Copy link
Author

Please help me, I am getting confused

@brentfraser
Copy link
Collaborator

I thought I was helping. What is your level of experience with:

  • JavaScript?
  • PHP?
  • web servers?
  • databases?
  • web mapping?

@pharidali
Copy link
Author

php

@brentfraser
Copy link
Collaborator

PHP is a good start, but you need to know JavaScript. Find a good online tutorial for Javascript.

@pharidali
Copy link
Author

ok

@pharidali
Copy link
Author

hello sir,

In getroutes.php
I have edit this but not working

prepare('CALL prcGetRoutes(:userName);'); break; case DB_POSTGRESQL: case DB_SQLITE3: $stmt = $pdo->prepare('select * from v_GetRoutes;'); break; } $stmt->execute(array(':userName' => momo)); $json = '{ "routes": ['; foreach ($stmt as $row) { $json .= $row['json']; $json .= ','; } $json = rtrim($json, ","); $json .= '] }'; header('Content-Type: application/json'); echo $json; ?>

but not working

@pharidali
Copy link
Author

`<?php
include 'dbconnect.php';

switch ($dbType) {
    case DB_MYSQL:
        $stmt = $pdo->prepare('CALL prcGetRoutes(:userName);');
        break;
    case DB_POSTGRESQL:
    case DB_SQLITE3:
        $stmt = $pdo->prepare('select * from v_GetRoutes;');
        break;
}
$stmt->execute(array(':userName' => momo));
$json = '{ "routes": [';
foreach ($stmt as $row) {
    $json .= $row['json'];
    $json .= ',';
}

$json = rtrim($json, ",");
$json .= '] }';
header('Content-Type: application/json');
echo $json;

?>`

@pharidali
Copy link
Author

I think we can get one selected User on DropDown ??

@brentfraser
Copy link
Collaborator

I'm not sure I understand. The drop down has sessions/routs for a user. If you want to change that you will have to edit the JavaScript, the PHP, and possibly the database functions.

@brentfraser
Copy link
Collaborator

And this staement is a problem:
$stmt->execute(array(':userName' => momo));
if momo is supposed to be a variable name it is not defined. If it is a value (string) is is not quoted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants