opened
joeclarkia
username_0
The context menu example has a "Show Coordinates" menu option.  What I would like to see is a way to put the coordinates *in the menu item* itself (no callbacks / alert boxes needed).  Is there a way to do this?
Coordinates in Context Menu Item
issue
created
mike16889
username_1
you could do something like this:

```
	var map = L.map('map', {
		contextmenu: true,
		contextmenuItems: [{
			text: 'test',
			iconCls: 'showLatLng'
		}]
	});
```

then:
```
	map.on('contextmenu.show', function(e){
		let el = e.contextmenu._container.getElementsByClassName("showLatLng");
		if(el.length){
			el[0].parentElement.innerHTML = '<b>Lat: </b>'+e.latlng.lat+'<br><b> Lng: </b>'+e.latlng.lat;
		}
	})
```

which results in this:
![image](https://user-images.githubusercontent.com/33011308/91628118-26cba000-ea00-11ea-8fc9-df8c025ffb86.png)

You could of course trim the decimal places to your liking.
comment