Setting maxbounds in leaflet according to WFS / WMS layer bounds

المشرف العام

Administrator
طاقم الإدارة
A leaflet map has the option to set the maximum bounds a user can pan it. I'd like to set these bounds dynamically (i.e. setMaxBounds method) according to the bounds of a given WFS layer. The goal is to avoid that the user loses sight of where data from that layer is displayed, then the bounds should be reset back to "normal" when the layer is removed.

Any straightforward way of doing this? Any plugin you are aware of?



أكثر...
 
أعلى