简体   繁体   中英

Display Features on OpenLayers Vector only with certain zoom level

How to display features on Vector Layer depending on zoom level?

For example: I would like to see features on vector layer only if I zoom twice.

Thanks in advance!

Take a look at this documentation

By using minScale and maxScale .

You can use minResolution and maxResolution as well but it seems that using scales is better.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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