Problem with context menu bindind with mixin
m00nlighter opened this issue · comments
m00nlighter commented
with this simple code from readme when u click context menu twice it show 2 copy of menu item added
here is gif
var jsonLayer = L.geoJson(jsonData, {
onEachFeature: function (feature, layer) {
layer.bindContextMenu({
contextmenu: true,
contextmenuItems: [{
text: 'Marker item'
}]
});
}
}).addTo(map);
m00nlighter commented
adding context menu, true to map config resolve this problem.
var map = L.map('map', {
layers: [OpenStreetMap_Mapnik],
contextmenu: true
});
Daniel Doezema commented
Thank you! @m00nlighter
This solved the issue for me as well.