# Worldmap don't use or generate msg.socketid

**URL:** <https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006>\
**Category:** Dashboard\
**Created:** [19 November 2021 16:14 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006 "2021-11-19T16:14:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcse66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lcse66/32/51330_2.png) [@lcse66](https://discourse.nodered.org/u/lcse66)\
**Post date:** [19 November 2021 16:14 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/1 "2021-11-19T16:14:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [19 November 2021 16:25 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/2 "2021-11-19T16:25:27Z")

</div>

Welcome @lcse66 to node-red

Do you want to use multiple maps on the dashboard?

---

<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:** [19 November 2021 17:07 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/3 "2021-11-19T17:07:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lcse66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lcse66/32/51330_2.png) [@lcse66](https://discourse.nodered.org/u/lcse66)\
**Post date:** [22 November 2021 11:04 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/4 "2021-11-22T11:04:54Z")

</div>

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.

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28606adde51c74ebc58405353054cf4b75112799.png)

[myTracker.txt](https://discourse.nodered.org/uploads/short-url/2ZcWRw6LCZ6mkrbZl9N3tJx0bo7.txt) (10.3 KB)

---

<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:** [22 November 2021 12:12 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/5 "2021-11-22T12:12:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [22 November 2021 12:43 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/6 "2021-11-22T12:43:01Z")

</div>

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?

---

<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:** [22 November 2021 12:59 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/7 "2021-11-22T12:59:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [22 November 2021 13:17 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/8 "2021-11-22T13:17:37Z")

</div>

@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.

> [@Node-red world map zoom and marking](https://discourse.nodered.org/t/node-red-world-map-zoom-and-marking/53745/19):
>
> Try this. [ { "id": "0430c6938cb6f325", "type": "tab", "label": "Map", "disabled": false, "info": "" }, { "id": "e8b38bd564251aa2", "type": "worldmap", "z": "0430c6938cb6f325", "name": "Malaysia", "lat": "4.210484", "lon": "101.975769", "zoom": "8", "layer": "EsriS", "cluster": "", "maxage": "", "usermenu": "show", "layers": "show", "panit":…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 December 2021 13:17 UTC](https://discourse.nodered.org/t/worldmap-dont-use-or-generate-msg-socketid/54006/9 "2021-12-22T13:17:44Z")

</div>

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