smeijer / leaflet-geosearch

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

Is it possible to use leaflet-geosearch with react-map-gl instead of react-leaflet? #353

Open DPatel13 opened 1 year ago

DPatel13 commented 1 year ago

I have tried it with react-leaflet and it's working fine. i need to use react-map-gl with mapbox. i have tried using it with react-map-gl, it's not giving error or warning but not even showing up on map. i have included css and everything. here below the sample of code i use to include it on react-map-gl. ` const SearchControl = props => { const {current: map} = useMap();

useEffect(() => {
    const searchControl = new GeoSearchControl({
        provider: prov,
        style:'',
        ...props,

    });

    map.addControl(searchControl);
    return () => map.removeControl(searchControl);
  }, [props]);

  return null;

};`