Sunday, 14 June 2015

openlayers 2 - Resizing point on zoom out



I've added a point on map like this but it is static in size.



How to resize that point on zooming?


Map on zoom out


enter image description here



Answer



The Resize, as @Mapperz mentioned is probably the way to go.


Alternatively, If you have lots of points, rather than looping through all the points resizing them, you could change the layer's pointRadius style on map zoom so the change happens to all features in one call. I can't say for sure what is better performance, but I would imagine changing the style would if there are many points.


The styling method has drawbacks such as does not have as many options as the Resize does (scale,origin,ratio), it's only a radius.


Here is a DEMO


enter image description here enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...