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?
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)
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.
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:
function returnTime(value){
return new Date((value)*1000 + 39600000);
}
var time = msg.payload.time;
msg.payload.time = '' + returnTime(time).toLocaleString();
return msg;
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.