# Gps dashboard for live location

**URL:** <https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193>\
**Category:** General\
**Created:** [13 October 2020 18:13 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193 "2020-10-13T18:13:58Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 October 2020 10:26 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/42 "2020-10-14T10:26:24Z")

</div>

> [@dceejay](#):
>
> PS - maybe don't need a function... just use your new scaling capability to / 100 ?

Dont know if its that simple dave - its a strange format.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 10:28 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/43 "2020-10-14T10:28:55Z")

</div>

@steve i agree with your statement that math has to be applied onto the functional node.could u pls send us ur complete flow with maths function on it so that it will be easy for me to see the coordinates on map.Or modify the flow that i am sending so it gives the desired output.[flows.json](https://discourse.nodered.org/uploads/short-url/hm09ujW5jFPGZeboiObZGnqBCzu.json) (5.1 KB)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 October 2020 10:46 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/44 "2020-10-14T10:46:40Z")

</div>

The info was all there in your PDF - simple maths!

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d735a46d032be6eea64f5db607affa875be4c588.png)

```auto
//example data {lat: 5007.4965 , lon:838.1157 }

function floatToGPScoord(num) {
    var d = parseInt (num / 100)
    var m = parseInt(num) - (d*100)
    var s = num - parseInt(num)
    var coord = d+((m+s)/60)
    return coord
}
msg.origPayload = {
    lat: msg.payload.lat,
    lon: msg.payload.lon
}
msg.payload.lat = floatToGPScoord(msg.payload.lat);
msg.payload.lon = floatToGPScoord(msg.payload.lon);
return msg;

```

test flow...

```auto
[{"id":"530d0a36.40cd24","type":"function","z":"6ca7c67d.98d848","name":"floatToGPScoord","func":"//example data {lat: 5007.4965 , lon:838.1157 }\n\nfunction floatToGPScoord(num) {\n var d = parseInt (num / 100)\n var m = parseInt(num) - (d*100)\n var s = num - parseInt(num)\n var coord = d+((m+s)/60)\n return coord\n}\nmsg.origPayload = {\n lat: msg.payload.lat,\n lon: msg.payload.lon\n}\nmsg.payload.lat = floatToGPScoord(msg.payload.lat);\nmsg.payload.lon = floatToGPScoord(msg.payload.lon);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1270,"y":140,"wires":[["84cf7119.e970e"]]},{"id":"99b86a91.cc8f18","type":"inject","z":"6ca7c67d.98d848","name":"test data AgH5e5xFaIdRRA==","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":\"AgH5e5xFaIdRRA==\"}","payloadType":"json","x":720,"y":80,"wires":[["88fc873f.c086c8"]]},{"id":"2bb51028.cbdab","type":"buffer-parser","z":"6ca7c67d.98d848","name":"","data":"payload.data","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"lat","offset":2,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"lon","offset":6,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":1070,"y":140,"wires":[["530d0a36.40cd24","ed6ed918.3daa58"]]},{"id":"2057e639.f3a49a","type":"debug","z":"6ca7c67d.98d848","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1250,"y":200,"wires":[]},{"id":"363f26cc.7e8fda","type":"inject","z":"6ca7c67d.98d848","name":"click me","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":140,"wires":[["2b6a66d1.86484a"]]},{"id":"2b6a66d1.86484a","type":"function","z":"6ca7c67d.98d848","name":"test data 02 01 F9 7B 9C 45 68 87 51 44","func":"msg.payload = { data: Buffer.from(\"0201F97B9C4568875144\", \"hex\") }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":200,"wires":[["2bb51028.cbdab","29572a95.8942b6"]]},{"id":"88fc873f.c086c8","type":"base64","z":"6ca7c67d.98d848","name":"","action":"","property":"payload.data","x":940,"y":80,"wires":[["2bb51028.cbdab"]]},{"id":"29572a95.8942b6","type":"debug","z":"6ca7c67d.98d848","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":240,"wires":[]},{"id":"84cf7119.e970e","type":"change","z":"6ca7c67d.98d848","name":"set name","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"apple","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":200,"wires":[["2057e639.f3a49a"]]},{"id":"ed6ed918.3daa58","type":"debug","z":"6ca7c67d.98d848","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1250,"y":80,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 11:30 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/45 "2020-10-14T11:30:18Z")

</div>

Thanks Steve I am receiving this output but final step to plot them on world map.For which i added the world map node but it is not plotting the coordinates received in real time.Also would like to add some information this sensor is sending data every 3 minutes,also it is sending two packets of data as u can see in the sidebar or debug window.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c89ed501935e5d37e94365c7432b3eba67225ab.png)  
 ![a](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1ddb76fa226b984a042acdaaf4d7e545aa1c1ea.png)  
 ![b](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa9bc3d826c26098a73badd28d9302215cbc81bd.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 October 2020 11:38 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/46 "2020-10-14T11:38:12Z")

</div>

> [@bachloo.rahul](#):
>
> .For which i added the world map node but it is not plotting the coordinates received in real time

I dont know much about this node - cant help.

> [@bachloo.rahul](#):
>
> Also would like to add some information this sensor is sending data every 3 minutes

Again, I dont know much about this node - cant help.

> [@bachloo.rahul](#):
>
> lso it is sending two packets of data as u can see in the sidebar or debug window.

put a debug on the output of the MQTT node - are 2 MQTT payloads being sent (that will be the reason for 2 outputs) i.e. it is probably NOT a problem with this flow (i.e. the 2 message problem lies external to this flow)

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 11:39 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/47 "2020-10-14T11:39:47Z")

</div>

Anyways Thanks Steve 😊

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 11:56 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/48 "2020-10-14T11:56:44Z")

</div>

The values you show should now plot on the map  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/394aa6f418096b73df151e7427c0ae2d93acc975.png)  
(though the second is a bit strange...)  
The map needs to be connected (Yes - I can see the green dot so that's ok) - you may need to zoom/scroll the map to find it... or maybe set the map to auto-pan to the marker.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 13:10 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/49 "2020-10-14T13:10:56Z")

</div>

@dceejay Yes it is near my location now.but how can i add a marker to repsent it?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb04ed4c5bbb448988a2e5a6b9b938dfbd41d162.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 13:22 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/50 "2020-10-14T13:22:08Z")

</div>

If I set the auto pan enabled  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/5966bc34c91052e78240eb603a405b2e3fedf234.png)  
and zoom to 10  
and then send in the data you had above (manually as I don't have your flow)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93ad25a63a6547282c90a8f0e21a374fbe431f70.png)

Then I get a map like

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c67e5a42fbfb7da712779886b81fcc73b12568fc.jpeg)

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 13:25 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/51 "2020-10-14T13:25:49Z")

</div>

can u share ur flow please?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 13:27 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/52 "2020-10-14T13:27:56Z")

</div>

It's your flow ! I just added one inject as I don't have live data

```auto
[{"id":"36242835.3b7ff8","type":"inject","z":"e9b4dddd.70115","name":"{\"lat\":28.3196,\"lon\":76.96}","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"lat\":28.3196,\"lon\":76.96}","payloadType":"json","x":530,"y":920,"wires":[["84cf7119.e970e"]]}]

```

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 13:42 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/53 "2020-10-14T13:42:49Z")

</div>

Thank you **dceejay**.i had use case that i want to build regarding worldmap  
1)If I want to track the path of a moving truck or forklifter as well as show its all history of data(latitude and longitude) along with other information(such as speed,fuel etc) from one particurlar date to another on a using table.wanted to know that what are other features that world map provides that one can use in his or her application on Node Red.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 13:57 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/54 "2020-10-14T13:57:26Z")

</div>

could u share your complete flow not just inject node ?as i wanted to see how it works

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 14:00 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/55 "2020-10-14T14:00:20Z")

</div>

Why do you need the full flow? You _have_ the full flow, it is your flow. All Dave has done is wired in an inject node. He has provided you the inject node and you can see in the screenshot exactly how it is wired in.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 14:01 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/56 "2020-10-14T14:01:59Z")

</div>

yes that would work.sorry 😇

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 14:11 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/57 "2020-10-14T14:11:44Z")

</div>

The worldmap is just a map to display the location of objects. How you get and feed it data is up to you. - the README for the node tells you all the things it can do (as a map).

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 14:33 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/58 "2020-10-14T14:33:08Z")

</div>

@dceejay instead of marker if we want to see the truck icon on world map and we also want lines on map showing path of truck moved for this scenario?  
Is there any dashboard node which can show all data history?  
Also checked readme of worldmap but nothing is written specific to this.Favicons would work but how to add the truck instead of marker.

 ![android-chrome-512x512](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4f7d94510abed588df70f980d80f3258448e6685.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f975828257d66fda6e14868a8b37d72694e3fbda.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 14:41 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/59 "2020-10-14T14:41:02Z")

</div>

The icons can be set as per the readme.  
The recent history/path can be shown by using the worldmap tracks node.  
But that will only show history for data that is received "live" - if you need it to save history over restarts and be queryable you will need to store it in a database and then retrieve it and send it to the map. That is not part of the worldmap node.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 14:47 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/60 "2020-10-14T14:47:31Z")

</div>

@dceejay suppose we want to store history in a database (sqlite,mongodb)etc and retreive from databse by use of apis to show history on a table then which node-red node can show databse history on a table?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 14:50 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/61 "2020-10-14T14:50:02Z")

</div>

The [flows.nodered.org](http://flows.nodered.org) site has a load of nodes that talk to different databases.  
(but you know that already as you have viewed all the starter videos that you have previously been pointed at haven't you 😉

[Previous page](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193.md?page=2)

[Next page](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193.md?page=4)
