ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
682 stars 230 forks source link

set extent to ZoomtoExtent control #473

Closed npltr62 closed 2 years ago

npltr62 commented 2 years ago

How setting extent in ZoomtoExtent control dynamically? let extent = this.$refs.vectorSource.$source.getExtent(); this.$refs.map.$map.getControls()

ghettovoice commented 2 years ago

Hello @npltr62 , as I know ZoomToExtent control doesn't allow change extent in runtime, because it can be configured only through control constructor. Seems that you need to make it yourself or extend their control with additional setter.

https://github.com/openlayers/openlayers/blob/v6.12.0/src/ol/control/ZoomToExtent.js#L28