none
Realtime GPS location RRS feed

  • Question

  • Hey guys,

    Wondering if someone can give me a small run down on the best way to go about implementing bing maps into my custom web page and having my athlete's location tracked and updated in real time.

    I have 1. A custom web page

               2. An athlete in a rowing boat on the water 

    I want to have my GPS device send the lat and long to the cloud or bing maps and have the map on my webpage display the rowers position on the course. 

    I have created a bing maps API key and am able to embed this into my webpage but am having trouble understanding exactly what code to use to accept the GPS data from the boat and display it in real time on my bing maps.

    Any advice would be appreciated!

    Cheers!

    Thursday, August 4, 2016 2:03 AM

Answers

  • To do this there are two key tasks. Get the GPS data from the device to a server, and then get it from the server to a client app where Bing Maps is. One way to do this is to create a simple web service. The mobile app services in Azure are really easy to use. You would need to get your GPS device to share its locations somehow. If you can install apps on it then this would be fairly easy to do. Here is a blog posts around how to do this. The only thing I would change is to use the Bing Maps V8 web control instead of the Windows 8 map control that is used in the blogs

    https://jkebeck.wordpress.com/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services/


    [Blog] [twitter] [LinkedIn]

    Thursday, August 4, 2016 6:01 PM
  • Azure web service works too. Any web service will work, just need to get the data from the device to a server.

    If your employer already has the data getting to the server, they are likely storing this in a database. You may need to do some research around how they store the data as there could be a number of things they are doing. Some companies store every update, in which case you likely will initially only want to get the last update, but have the option to pull down historic data which is a useful feature. Other companies keep it simple and only store the current location.

    I would suggest finding out if there is already a web service in place that can query this database. If not, see if there is an option to extend the existing web service they are using to update the data. If not that, then you will need to create a simple web service that can query this database. Here are a few useful blog posts on creating a spatial REST service that connects to a database:

    https://rbrundritt.wordpress.com/2013/08/01/how-to-create-a-spatial-web-service-that-connects-a-database-to-bing-maps-using-ef5/

    https://rbrundritt.wordpress.com/2013/08/06/advance-spatial-queries-using-entity-framework-5/

    If you only want to get the current location of a device, you can keep things simple and just do a search based on property. (i.e. device ID and most recent update time). If you use this approach you could create just a simple web service rather than spatial REST services I mentioned above.

    Once you have a web service in place you can return the data in a couple of formats. If you keep things simple you can it return just a simple object that has two numbers, latitude/longitude. If you want to make the app more powerful and have the option to add more advance spatial features, then you could use the spatial functionality in SQL as described in the blog posts and have the response return the data spatial data in Well Known Text format. Well Known Text is a standard way of representing spatial data as a string. The blog posts are a bit old and show how to connect to Bing Maps V7. Bing Maps V8 has a built in module for parsing Well Known Text which would allow you to skip a couple steps in the blog. You can find details around the well known text support in V8 here:

    https://msdn.microsoft.com/en-us/library/mt712880.aspx

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#wktAddPoint+JS

    Alternatively you could also use GeoJSON which is a nicer format for handling spatial data and related property information, however this would require more work on the server side as SQL doesn't have an built in way to export data in this format.


    [Blog] [twitter] [LinkedIn]

    Friday, August 5, 2016 4:48 PM

All replies

  • To do this there are two key tasks. Get the GPS data from the device to a server, and then get it from the server to a client app where Bing Maps is. One way to do this is to create a simple web service. The mobile app services in Azure are really easy to use. You would need to get your GPS device to share its locations somehow. If you can install apps on it then this would be fairly easy to do. Here is a blog posts around how to do this. The only thing I would change is to use the Bing Maps V8 web control instead of the Windows 8 map control that is used in the blogs

    https://jkebeck.wordpress.com/2014/04/03/geo-fencing-with-bing-spatial-data-services-and-azure-mobile-services/


    [Blog] [twitter] [LinkedIn]

    Thursday, August 4, 2016 6:01 PM
  • Hi Ricky,

    That is fantastic information thank you, let me see if i have this correct.

    GPS module needs to send data (lat + long co ordinates) to a server (example would azure web service work?) 

    Then i need my code (custom web page) to accept or query for these lat and long values and update my marker.

    My employer does not wish to install an app on the GPS module and has already got it sending data to the azure web service or similar server (that is his end) i was wondering what sort of code i need to implement to accept the values that will be coming from the server.

    I understand that the blog might explain how to achieve this with apps however i am after something like a JavaScript function to accept and process the co ordinates and update my bing map accordingly. 

    Not sure if that is an area you can assist with but any advice is appreciated as always. 

    Cheers,
    Justin 


    Inspired to perform

    Friday, August 5, 2016 4:04 AM
  • Azure web service works too. Any web service will work, just need to get the data from the device to a server.

    If your employer already has the data getting to the server, they are likely storing this in a database. You may need to do some research around how they store the data as there could be a number of things they are doing. Some companies store every update, in which case you likely will initially only want to get the last update, but have the option to pull down historic data which is a useful feature. Other companies keep it simple and only store the current location.

    I would suggest finding out if there is already a web service in place that can query this database. If not, see if there is an option to extend the existing web service they are using to update the data. If not that, then you will need to create a simple web service that can query this database. Here are a few useful blog posts on creating a spatial REST service that connects to a database:

    https://rbrundritt.wordpress.com/2013/08/01/how-to-create-a-spatial-web-service-that-connects-a-database-to-bing-maps-using-ef5/

    https://rbrundritt.wordpress.com/2013/08/06/advance-spatial-queries-using-entity-framework-5/

    If you only want to get the current location of a device, you can keep things simple and just do a search based on property. (i.e. device ID and most recent update time). If you use this approach you could create just a simple web service rather than spatial REST services I mentioned above.

    Once you have a web service in place you can return the data in a couple of formats. If you keep things simple you can it return just a simple object that has two numbers, latitude/longitude. If you want to make the app more powerful and have the option to add more advance spatial features, then you could use the spatial functionality in SQL as described in the blog posts and have the response return the data spatial data in Well Known Text format. Well Known Text is a standard way of representing spatial data as a string. The blog posts are a bit old and show how to connect to Bing Maps V7. Bing Maps V8 has a built in module for parsing Well Known Text which would allow you to skip a couple steps in the blog. You can find details around the well known text support in V8 here:

    https://msdn.microsoft.com/en-us/library/mt712880.aspx

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#wktAddPoint+JS

    Alternatively you could also use GeoJSON which is a nicer format for handling spatial data and related property information, however this would require more work on the server side as SQL doesn't have an built in way to export data in this format.


    [Blog] [twitter] [LinkedIn]

    Friday, August 5, 2016 4:48 PM