Worldmap don't use or generate msg.socketid

Hi all,
I'm using the excellent Worldmap node.

However, I am having difficulty when multiple sessions are connected. Specifically, I can't get other elements on the page to interact correctly because Worldmap doesn't generate and doesn't use the reference to the dashboard session (msg.socketid).

Has anyone already encountered the problem and solved it?
Thanks in advance.
Lorenzo

Welcome @lcse66 to node-red

Do you want to use multiple maps on the dashboard?

If you inspect the full msg object you will see the worldmap in node reports msg._sessionid instead as it uses a different socket library.

Correct, thanks, but this doesn't help me to make the dashboard elements (e.g. ui_list) interact with the map correctly. To do this I would have to associate the socketid value of the specific dashboard instance with the _sessionid value of the map displayed by the ui_worldmap node in that same instance.

I don't speak well in English, I think it's easier to understand with the attached flow. In this example when I click on an item in the list a marker lights up on the map, but I would like this to happen only in that session. To do this, I need the correspondence I mentioned above. I can get it by dragging the map to get the msg._sessionid value, and then immediately create a UI event and associate the msg.socketid value to it (as long as nobody interacts with the map in other sessions at the same time ... ).

I don't have the skills to drill down into the project code, but I guess the ui_worldmap node can know the socketid value (as it is a dashboard element), and probably can know the worldmap session information as well.

The solution that I see and propose in my original post is that the ui_worldmap node generates a message with this information when opening the session.

This is the solution I see, but maybe there are better ones. Any alternative advice is welcome.

myTracker.txt (10.3 KB)

I see what you are trying to do. I can't think of a simple way to achieve this as the way the ui_worldmap is implemented is just within an iframe within the dashboard - so there is no comms between the map (inside the iframe - talking to it's own websocket backend) and the dashboard backend. The socketid is not exposed to any ui_widgets as it is server side only so they can't pass that on when the map does it's connection. If anyone can think of a way I'd be glad of suggestions.

What is you end goal here?

Do you want to map the points in the list to the map only once you select it? And clear that point once you select a new one and map that one?

I think the idea is for multiple users (but actually sessions as we don't handle users) to each be able to click on whichever item in the list they want and for only their map to update.

@lcse66 Like @dceejay said Node-Red don't support multiple users.

But to set the Zoom to location there are quit a few examples, link below to mention one.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.