1

I want to set maxBoundsViscosity of the Panning Inertia Options. Because there is no binding and no set function of the map element i dont know how to. Is there a workaround or something?

TheSorm
  • 137
  • 12
  • I've never messes around with panning inertia options, but I'd assume you can pass them into the `[leafletMapOptions]` input binding. It's not super clear in the docs, but I think all the options listed under Map -> Options can be passed into that input binding (which get passed into the map factory method). – reblace Jun 15 '18 at 04:02

1 Answers1

0

I've never messed around with panning inertia options, but I'd assume you can pass them into the [leafletMapOptions] input binding. It's not super clear in the Leaflet docs (https://leafletjs.com/reference-1.0.0.html#map-maxboundsviscosity), but I think all the options listed under Map -> Options can be passed into that input binding (which get passed into the map factory method).

<div style="height: 300px;"
     leaflet 
     [leafletOptions]="options">
</div>

and in your component:

options = {
  maxBoundsViscocity: 0.5,
  zoom: 5,
  center: latLng(46.879966, -121.726909)
};
reblace
  • 4,115
  • 16
  • 16
  • Thank you for the fast answer :) I tried that out withmaxBoundsViscocity: 1.0, that should make the bounds i sated solid, but it didn't worked. – TheSorm Jun 16 '18 at 10:19
  • You have to have set maxBounds for maxBoundsViscocity to have an effect. Are you sure you have set maxBounds? – reblace Jun 16 '18 at 15:55
  • yes i did, the map has a set function to do so that i use. – TheSorm Jun 16 '18 at 20:33