[OpenLayers-Users] attribute based styles

Mr. Puneet Kishor punk.kish at gmail.com
Sat Sep 24 18:07:06 EDT 2011


On Sep 24, 2011, at 4:34 PM, Roald de Wit wrote:

> Hi,
> 
> Isn't it explained clearly enough further down?


Possibly, to someone who is familiar with it, but I was confused, hence my comment. There are two reasons for the confusion: 

One, the formatting of the document implies that the section titled "Using Style Objects" is a sibling of the previous section titled "Attribute Replacement Syntax," not a child. Hence, they seem to be independent sections. 

Two, it is entirely possible to pass a style object directly to a layer as follows

    new OpenLayers.Layer.Vector(a.name, {style: style});


Perhaps setting the section on "attribute replacement" as a major heading (bold, or different font, or numbering to be completely  unambiguous) would make it completely clear to newbies such as myself.

Thanks.

> 
> "Once you have created a style object, it needs to be passed to a layer in order for it to be used. The StyleMap object should be passed as the layer’s ‘styleMap’ option"
> http://docs.openlayers.org/library/feature_styling.html#using-style-objects
> 
> Regards, Roald
> 
> On 24/09/11 22:31, Mr. Puneet Kishor wrote:
>> Thanks, that works. Perhaps the following should be corrected at [http://docs.openlayers.org/library/feature_styling.html]
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list