# Implementing Context Menu for Polyline Endpoints Name in Node-RED Worldmap

**URL:** <https://discourse.nodered.org/t/implementing-context-menu-for-polyline-endpoints-name-in-node-red-worldmap/91248>\
**Category:** General\
**Tags:** function-node\
**Created:** [25 September 2024 10:25 UTC](https://discourse.nodered.org/t/implementing-context-menu-for-polyline-endpoints-name-in-node-red-worldmap/91248 "2024-09-25T10:25:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoganathanSambath](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/loganathansambath/32/92841_2.png) [@LoganathanSambath](https://discourse.nodered.org/u/LoganathanSambath)\
**Post date:** [25 September 2024 10:25 UTC](https://discourse.nodered.org/t/implementing-context-menu-for-polyline-endpoints-name-in-node-red-worldmap/91248/1 "2024-09-25T10:25:17Z")

</div>

-I'm working on a Node-RED Worldmap project and want to create a context menu that appears when clicking on the polylines.

-The context menu should display the names of the two endpoints (source and target) of the clicked polyline.

-Has anyone implemented a similar feature or have suggestions for adding custom context menus at polyline endpoints in Worldmap?

-I'm looking for guidance on the best approach, including JavaScript or other methods to handle this interaction.

-Below I attached the screenshot and log messages

**"The image below shows the corresponding locations, and i need those two locations are displayed when I click the polyline. How can i achieve this?."**

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/42acf14cba26faab83471f03b1a9407108669bb0.png)

msg.payload with polyline and markers: [  
{  
"name": "server\_locations",  
"line": [  
[  
40.73061,  
-73.935242  
],  
[  
37.774929,  
-122.419418  
]  
],  
"color": "#007BFF",  
"layer": "polylines",  
"weight": "2",  
"clickable": false  
},  
{  
"name": "New York City, USA",  
"lat": 40.73061,  
"lon": -73.935242,  
"icon": "fa-circle fa-x",  
"clickable": false,  
"layer": "markers"

},  
{  
"name": "San Francisco, USA",  
"lat": 37.774929,  
"lon": -122.419418,  
"icon": "fa-circle fa-x",  
"clickable": false,  
"layer": "markers"

}  
]

---

<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:** [24 December 2024 10:26 UTC](https://discourse.nodered.org/t/implementing-context-menu-for-polyline-endpoints-name-in-node-red-worldmap/91248/2 "2024-12-24T10:26:08Z")

</div>

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