简体   繁体   English

如何设置OpenLayers地图的范围?

[英]How to set the extent of an OpenLayers Map?

I want to pan and zoom an OpenLayers.Map to a given OpenLayer.Bounds . 我想将OpenLayers.Map平移和缩放到给定的OpenLayer.Bounds

What is a quick way to do this action? 什么是快速的方法来做这个动作?

I want to see everything that is in the bounds on the map. 我希望看到地图上边界的所有内容。

Cheers! 干杯!

请尝试OpenLayers.Map.zoomToExtent(OpenLayers.Bounds) ,它将缩放到传入的边界并重新定位地图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM