Click link inside Leaflet Popup and do Javascript

前端 未结 7 1813
遇见更好的自我
遇见更好的自我 2020-12-05 06:42

I have a leaflet map up and running. It overlays a series of polygons (via GeoJSON) on the map and attaches popups to each polygon. Each of the popups display information a

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 07:02

    mapbox JavaScript library has an event:

    bindPopup('');
    addTo(map);
    
    $('#map').on('click', '.trigger', function() {
        alert('Hello from Toronto!');
    });
    

    https://www.mapbox.com/mapbox.js/example/v1.0.0/clicks-in-popups/

提交回复
热议问题