leaflet-search icon indicating copy to clipboard operation
leaflet-search copied to clipboard

Fire click event

Open jeffjb4488 opened this issue 2 years ago • 1 comments

Is there a way to fire a click event when search location is found? I would like to have a popup opened when the location searched for is clicked, but since i am using leaflet Point in Polygon and generating my popups through "zoomToFeatures" function, which is called when the map is clicked on, the normal function of the leaflet-search code to open popups does not work.

Here is my github repo: https://github.com/jeffjb4488/GeoJASON_test

Thank you very much, Jeff

jeffjb4488 avatar May 06 '22 23:05 jeffjb4488

const searchControl = new L.Control.Search({
    ...
    moveToLocation: (latlng, title, map) => {
        latlng.layer.fire('click');
    }
})

ericek111 avatar Jun 28 '22 09:06 ericek111