smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.03k stars 273 forks source link

How to access the fireEvents in react? #231

Closed tbaustin closed 4 years ago

tbaustin commented 4 years ago

Screen Shot 2020-07-22 at 4 06 24 PM How to I access this event using react-leaflet ?

smeijer commented 4 years ago

I haven't tested, but something along the lines of this should work:

const setRef = (map) => {
  map.on('geosearch/showlocation', handleResult);
};

<Map ref={setRef} />