You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Everybody! First of all thanks a lot for the amazing library. I've searched to find how I can use this library for React Leaflet. I couldn't make it work on React leaflet. I'll be very thankful if someone has any solution for React. leaflet:
my react leaflet version is:
"react-leaflet": "^3.0.5",
Imagine someone is using the map like below as the react-leaflet docs:
Enabling this plugin dynamically with the help of useMap hook worked for me:
import{useMap}from"react-leaflet";import{GestureHandling}from"leaflet-gesture-handling";import"leaflet-gesture-handling/dist/leaflet-gesture-handling.css";exportconstMapController=()=>{constmap=useMap();useEffect(()=>{map.addHandler("gestureHandling",GestureHandling);// @ts-expect-error typescript does not see additional handler heremap.gestureHandling.enable();},[map]);returnnull;}
Then add MapController somewhere inside <MapContainer />;
Hi Everybody! First of all thanks a lot for the amazing library. I've searched to find how I can use this library for React Leaflet. I couldn't make it work on React leaflet. I'll be very thankful if someone has any solution for React. leaflet:
my react leaflet version is:
"react-leaflet": "^3.0.5",
Imagine someone is using the map like below as the react-leaflet docs:
<MapContainer center={position} zoom={13} scrollWheelZoom={false}> <TileLayer attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" /> <Marker position={position}> <Popup> A pretty CSS3 popup. <br /> Easily customizable. </Popup> </Marker> </MapContainer>
The text was updated successfully, but these errors were encountered: