[OpenLayers-Users] GML, Point and Change the Size of the Circle...

Kit Plummer kitplummer at gmail.com
Thu Sep 4 12:09:02 EDT 2008


On Aug 29, 2008, at 12:59 AM, Andreas Hocevar wrote:

> Kit Plummer wrote:
>> Ok, first let me plead practical ignorance here.  I've only been   
>> working with OpenLayers for about a week.  And, I'm integrating it   
>> into ExtJS.  I have a known GML file that contains Points.  I'd  
>> like  to be able to add an attribute to each element that would  
>> specify the  size of the circle that gets drawn by OL.  Am I out of  
>> luck here?  If  not, would somebody be so nice as to point me in  
>> the right direction?
>
> Have a look at http://www.openlayers.org/dev/examples/styles-rotation.html 
> .
>
> You will want to use a style map, and define the pointRadius  
> property of the symbolizer. Say you have a field called "size" in  
> your GML features. Then your stylemap constructor call could look  
> like that:
>
> new OpenLayers.StyleMap({
>   "default": OpenLayers.Util.applyDefaults({
>       pointRadius: "${size}"
>   }, OpenLayers.Feature.Vector.style["default"]
> });
>
> Regards,
> Andreas.

Ok, so I'm able to draw circles with size relative to the size.  How  
do I keep the circle size relative to the zoom?  Is it possible to  
have them scale automatically?

Thanks again,
Kit




More information about the Users mailing list