geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Show Bootstrap modal when layer is click #535

Closed monepa closed 4 years ago

monepa commented 4 years ago

Hello, sumit ... I used the leaflet-geoman to display geojson data and it worked very well. Now my question is how to display a bootstraps modal (and not a popup) when the layer is clicked? What I've done so far is:

HTML <body> <div class="map" id="map"> <!-- and all javascript libraries needed --> <!-- modal div is here -->

`

App.Js L.geoJson(geojsonPolygon ,{ onEachFeature: function(feature, layer) { featureGroup.addLayer(layer); layer.on('click', function(e) { alert(layer.feature.properties.fid); //<-- alert success $('#modal').modal('show'); //modal not show <----------------- Problem });
} }).addTo(map);

Thanks..

monepa commented 4 years ago

Sorry, i finally got it, i just forgot to put the id in the bootstrap modal.. Thanks