Hello,
I am trying to add gesturehandling so that the user won't unzoom when scrolling down.
I installed leaflet-gesture-handling through npm
import { GestureHandling } from "leaflet-gesture-handling";
L.Map.addInitHook("addHandler", "gestureHandling", GestureHandling);
but this doesn't do anything
any idea how to do this?
thanks a lot!
it works with this.$refs.map.mapObject.zoomOut();
So now I would like to fit bounds content... this doesn't work though
this.$refs.map.mapObject.fitBounds(this.$refs.map.mapObject.getBounds());
@mawieutc
it works with this.$refs.map.mapObject.zoomOut();
So now I would like to fit bounds content... this doesn't work though
this.$refs.map.mapObject.fitBounds(this.$refs.map.mapObject.getBounds());
I am attempting to use gestureHandler plugin also but have not been able to get it to work. Did you end up finding a solution?
Actually yes! Here is my code:
<l-map ref="map" gestureHandling :options="mapOptions">
import { GestureHandling } from "leaflet-gesture-handling";
data () {
return {
mapOptions: {
zoomSnap: 0.5,
gestureHandling:true
}
}
@mawieutc
Perfect! That worked like a charm. Thanks.
Most helpful comment
Actually yes! Here is my code: