# Remembering position on UI dashboard with worldmap

**URL:** <https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740>\
**Category:** General\
**Created:** [8 March 2019 13:08 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740 "2019-03-08T13:08:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [8 March 2019 13:08 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/1 "2019-03-08T13:08:41Z")

</div>

Hello  
I have setup an IoT device which passes co-ordinates to a worldmap node on my node-red UI dashboard on bluemix

The problem is, is when I close the UI dashboard website and re-open it, it has to wait for a co-ordinate from my IoT device before focusing in and nominating the location of it.

Is there a way I can have the UI dashboard remember the last location sent from my IoT device on the map? So, if I close the dashboard and re-open it, it re-opens to the last known co-ordinates that were sent?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [8 March 2019 13:31 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/2 "2019-03-08T13:31:02Z")

</div>

The map needs to be send the location in order to display it.  
So if you save the location, you can trigger it to be sent to the map.

How you capture that connection is covered in the readme for the world map node

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [8 March 2019 14:19 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/3 "2019-03-08T14:19:52Z")

</div>

Thanks for the reply

So are you saying I need to store those coordinates in some sort of cloud database then extract and send it to the worldmap node?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [8 March 2019 14:29 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/4 "2019-03-08T14:29:57Z")

</div>

No, thats not what I said.  
You said you wanted to store the last known coordinates. If its that simple you could store it in context variables (look at the docs)

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [8 March 2019 22:39 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/5 "2019-03-08T22:39:49Z")

</div>

OK Thanks. I had a read of all of that and tried to set it up in my flow, however it still will not remember the position after I close and re-open the UI.

Here is an extract of my flow diagram:

 ![query](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4a12aa57a42ed11a44a3f71a02b01a44b7c30839.png)

Store\_GPS:

```auto
flow.set("latit", msg.payload.latitude);
flow.set("longit", msg.payload.longitude);

return msg;

```

GPS\_Map:

```auto
var long = flow.get("latit");
var lat = flow.get("longit");
msg.payload={lat:flow.get("lat"), lon:flow.get("long"), name:"1CEE2B", "radius": 2000, url:"<a href=\"../ui/#/0\">IBM link</a>"};

return msg;

```

Time decoder:

```auto
function returnTime(value){
return new Date((value)*1000 + 39600000);
}

var time = msg.payload.time;
msg.payload.time = '' + returnTime(time).toLocaleString();
return msg;

```

---

<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:** [8 March 2019 23:09 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/6 "2019-03-08T23:09:03Z")

</div>

What @ukmoose was hinting you towards was this section of the readme - [https://flows.nodered.org/node/node-red-contrib-web-worldmap#events-from-the-map](https://flows.nodered.org/node/node-red-contrib-web-worldmap#events-from-the-map) , the first example. You can use that to trigger sending the basic co-ordinates again.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [9 March 2019 03:04 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/7 "2019-03-09T03:04:26Z")

</div>

Thanks for the reply

Sorry, I'm new to this and I don't understand how to implement that. Can someone show me an example? I looked in all the examples tha came with the worldmap node and cannot work out how to do it.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [9 March 2019 07:07 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/8 "2019-03-09T07:07:57Z")

</div>

Add a debug to the map in node and set the debug to display all the message.

Then try browsing to the worldmap page. What do you see back in the debug?  
Use a switch node to only get the message you are interested in.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [9 March 2019 12:26 UTC](https://discourse.nodered.org/t/remembering-position-on-ui-dashboard-with-worldmap/8740/9 "2019-03-09T12:26:08Z")

</div>

Got it, thanks!
