[OpenLayers-Users] initialisation of style object

Dave Potts dave.potts at pinan.co.uk
Thu Dec 8 17:13:57 EST 2011


hi folks,

I have worked out where things are going wrong in my code.

It seems that if you declare a single stymle object for use with
downloading a wfs feature.  It appears that the things like the feature
radius must be set on the style object itself.

Because in Renderer/Elements.js in OL2.11 there is a call to
'applyDefaultSymbolizer" that takes the current style as an argument.
  This  functions expects to find symbolizer information on the style
object itself,  if this information is not supplied, it will get over
written by the values from the default symbolizer.

Its not the behavior that I was expecting!

Dave.

Bart van den Eijnden (OSGIS) wrote:
> Can you share your code snippet?
>
> Is the radius available as a feature attribute? In that case you could use
> something like {$radius}.
>
> Best regards,
> Bart
>
>>
>> hi list,
>>
>> I am trying to create a new style object.
>>
>> My start up code says
>>
>> var foo = new OpenLayers.Style({pointRadius:10})
>>
>> By the time it gets to the renderer object the style object should
>> include
>> the following value
>>
>> foo.pointRadius=45
>>
>> but in my case it actual reads
>>
>> foo.pointRadius=0
>>
>> I am not using the Stylemap object
>>
>> I had assumed the calling style object with the pointRadius set  like
>> this
>> would have correctly set up the style object.
>>
>> Which api call should I be calling to ensure this transformation
>> happens?
>> Regards
>>
>>
>> Dave
>>
>>
>>
>>
>> --
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>


-- 




More information about the Users mailing list