Closed julienlz closed 5 years ago
If you do all your map drawing manually, say, without
First you need to start the contextmenu code, you can do this by adding the contextmenu options in the l-map definition. For example:
<l-map :options="{contextmenu: true,}">
Then you need to manually manage the map drawing process... you can do this by working with leaflet directly. You can get access to your map via this.$refs.lmap.mapObject in your vue2leaflet components script. You might also need to inject L in your component to gain access to helper functions.
This is of course by no means a solution to your question, as you want to create the menu in a declarative (component) way, which would be absolutely awesome. :)
Yes, it works with the @contextmenu
. I use it manually with the mapObject API exposed through refs.
I put the l-popup
in a l-layer-group
and then i put a ref on the layer group.
I can open the popup by calling this.$refs.myLayerGroupRef.mapObject.openPopup(<LatLng>)
.
thanks
Hello, may be if you have time, is to implement your work on Vue2leaflet
https://github.com/KoRiGaN/Vue2Leaflet/issues/360
could be a good improvement
Best