As a hardware guy, coding a real-time map used to sound too complicated for me. Fortunately, Ubidots' dashboard has made it so simple that anyone can create a LIVE map like this without requiring any web coding:

Zoom out to see how the International Space Station moves around the world.

Generating the data

The data shown here is generated by this script: "Live Tracking the International Space Station"

It explains how the ISS data is retrieved from an external source and then posted to the Ubidots API. We used the ISS data for example purposes, but any Internet-enabled device could actually generate this data; be it a smartphone, a tablet or any GPS device.

Sending the "latitude" and "longitude" data in the HTTP payload is pretty easy; just add "lat" and "lng" properties as shown in the sample HTTP request below:

POST /api/v1.6/variables/{variable_id}/values HTTP/1.1
Host: things.ubidots.com
Content-Type: application/json
X-Auth-Token: <YOUR_TOKEN_HERE>
{"value":1, context:{"lat": 6.4, "lng":-75.2}}

Here's a full tutorial on how to send location data to the Ubidots API: "How to post a Geopoint using curl"

Adding the widget

Once the data is being stored in a Ubidots' variable, you can add a map widget from your dashboard:

Select your data source:

Select the variable where the GPS data is stored:

Finally, you'll have a nice embeddable widget to use in your own app. The drop pin will update its position as soon as your data is updated recieved in the Ubidots API.

Ubidots helps hardware makers and engineers create applications that make sense of their sensor data. In this blog post we learned how to send GPS values to the Ubidots' API, and put them in a live map that can be embedded in other applications.

Do you have a project idea to track or measure things in real time?

Did this answer your question?