OpenLayers上的显示功能仅限某些缩放级别

时间:2012-04-11 13:04:02

标签: javascript openlayers

如何根据缩放级别显示矢量图层上的特征?

例如:我想仅在我缩放两次时才能看到矢量图层上的特征。

提前致谢!

1 个答案:

答案 0 :(得分:4)

看看这个documentation

使用minScalemaxScale

您也可以使用minResolution和maxResolution,但似乎使用比例更好。

minScale - float -- the minimum scale value at which the layer should display

maxScale - float -- the maximum scale value at which the layer should display

maxResolution - float -- the maximum resolution value at which the layer should display

minResolution - float -- the minimum resolution value at which the layer should display
相关问题