Hi Yves, i don't know if i understand you question, but it's possible to use the map.getZoom() function in an OpenLayers.Style.

I'm using it for a proportional symbol analysis, with a featureStyle featuring a context radius for the features, and the radius is function of the zoom level.

  function featureStyle() {
styleCircle = new OpenLayers.Style(
                    {
                        fillOpacity: 0.7,
                        pointRadius: "${radius}",
                        strokeColor: "#fae318",
     strokeWidth: 1,
     fillColor:   "${couleur}"
                    },{
                        context: {
                            radius: function(feature) {
                                surf = surf* Math.pow(2,map.getZoom()-4)
                                return surf;
                            },
    couleur: function(feature) {
var maxV = 10;
var comp = Math.round(feature.attributes.count*255/maxV);
return "#"+RGBtoHex(comp,255-comp,0);
    }
                        } // End of obj context
                    }
                ); // End of obj OpenLayers.Style
                styleMap = new OpenLayers.StyleMap({'default':styleCircle});
return styleMap;
}

  (Code inspired by examples on http://www.geotribu.net/)

  Hope this helps :)

  Laurent



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to