I have marked several locations in worldmap by injecting and simple function containing properties like lon,lat,icon etc. I defined those objects as global variables since I wanna change their color with external decisions later on. Also I was able to add that map to dashboard.
Where I face hard for me to solve is to keep those locations fix through out the project. Now when i refresh the worldmap or the dashboard all the locations get lost. I have to re-inject them again.
Instead of injecting what is the best method to mark the locations in worldmap which will last through out the project ? Kindly help me.
the worldmap in node provides events when client connect, disconnect, click on markers etc... The connect event can be used to trigger your flow to resend markers to set them up as you wish.
This is the solution that you have provided right? so that the marker will not be gone after refresh.
But how to use this flow? do i need to add anything after the function "Add SS1"?
My problem is that now i have 1 main nodered server. All the other node-red server can send the location data to my main nodered server through MQTT cloud. But I dont know what is the location, might be US, canada or somewhere else. Meaning im not able to determine their location. My main nodered server is mainly doing the monitoring of the worldmap. If anything happen, people from other country can send their location to me through MQTT cloud and a marker should appear at my worldmap. But the problem here is that whenever i refresh my worldmap...all the pop up, markers will be gone. How can i solve this problem?
How about storing the information in a database then replace that function node with a call to the database to read everything and then have a function node build all the info to display and then send it to the world map
so to retain the markers after a refresh or open the map, should i implement a switch node after my funtion and the to world map in? cos it doesnt work, after refresh i cant retain my points.
where and how to save your points is up to you. You can use the worldmap-in node to detect a new client connecting (or refreshing) and use that to trigger resending whatever points you like.
The tracks node is not a store. It holds tracks per each marker sent - so needs the name of a marker in order to be added to the track (and thus trigger it to send out the track). The connect message is just a trigger - you still need to tell it which points to (re)plot.