OpenLayers上的显示功能仅在某个缩放级别下才能使用矢量图

问题描述:

如何根据缩放级别显示矢量图层上的功能?OpenLayers上的显示功能仅在某个缩放级别下才能使用矢量图

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

在此先感谢!

看看这个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