[OpenLayers-Users] Vector labels at different zoom levels

Jeff Dege jeff.dege at korterra.com
Mon Apr 12 16:19:25 EDT 2010


I'm adding some attributes to the GML data I'm using to draw a vector layer, and have set the label member of the style object to display those attributes.

It works fine, except that it looks lousy when I zoom out.  The labels are still drawn the same, even though the features may be nearly invisible.

How do I turn off the rendering of labels, when the scale exceeds some threshold?  (Note - I still want to draw the features, I simply don't want the labels.)

I've tried adding a listener to map.movestart, that changes the value of layer.styleMap.styles['default'.defaultStyle.label, but that only affects future renderings of the map, it has no effect on the current zoom.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100412/8d758135/attachment.html


More information about the Users mailing list