Tuesday, January 06, 2009
You are here:  Forum
 
 
  Forum  Discussions  Google Map GPS ...  show latest position
Previous Previous
 
Next Next
New Post 11/12/2008 9:05 AM
  yaofong
1 posts
No Ranking


show latest position 

May I know how to show only the latest position on the map?

 Let say I am tracking multiple devices.

 
New Post 11/12/2008 10:51 AM
  nickfox
38 posts
No Ranking


Re: show latest position 

To do that you need to change a stored procedure. In the procedure prcGetRouteForMap, you need to add TOP 1 and ORDER BY gpsTime DESC. The new stored procedure will look like this:

  SELECT TOP 1 latitude '@latitude', longitude '@longitude',
  speed '@speed', direction '@direction', distance '@distance',
  locationMethod '@locationMethod', CONVERT(VARCHAR(25), gpsTime, 100) '@gpsTime',
    phoneNumber '@phoneNumber',  sessionID '@sessionID', accuracy '@accuracy',
    isLocationValid '@isLocationValid', extraInfo '@extraInfo'
  FROM gpslocations
    WHERE sessionID = @sessionID
    AND phoneNumber = @phoneNumber
    ORDER BY gpsTime DESC
  FOR XML PATH('locations'), ROOT('gps')

Nick

 
Previous Previous
 
Next Next
  Forum  Discussions  Google Map GPS ...  show latest position
Our Sponsors
Privacy Statement | Terms Of Use