Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Any guidance and help is appreciated.

share|improve this question
How do you want to resize it? smaller or larger when you zoom out? – CaptDragon Aug 22 '12 at 15:02
@CaptDragon Smaller – bios Aug 22 '12 at 15:05
up vote 6 down vote accepted

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

share|improve this answer

Resize Features Programatically using Openlayers v2.12

enter image description here

        map.setCenter(new OpenLayers.LonLat(point.x, point.y), 5);
        vectorLayer.addFeatures([pointFeature, lineFeature, polygonFeature]);


    var origin = new OpenLayers.Geometry.Point(-111.04, 45.68);
    function resizeFeatures(scale) {
        pointFeature.geometry.resize(scale, origin);
        lineFeature.geometry.resize(scale, origin);
        polygonFeature.geometry.resize(scale, origin);
    } View>Source

share|improve this answer
please notice that the point in blue color is static in size – bios Aug 22 '12 at 14:51
you can force the point to not resize too that is the default - read the openlayers documentation on geometry - [resize is an option] – Mapperz Aug 22 '12 at 14:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.