[OpenLayers-Dev] What if I extend the OpenLayers.Style class??

bartvde at osgis.nl bartvde at osgis.nl
Wed Jan 21 03:15:34 EST 2009


Hi,

see also:

http://trac.openlayers.org/ticket/1802

Best regards,
Bart

> Hi all,
> In my OL app, I needed to create some OpenLayers.Style class to group
> complex layer styling.
> I create some classes like OpenLayers.Style.Rain,
> OpenLayers.Style.Temperature to represent some
> weather icons depending on some feature's attribute values.
>
> But, I had an other problem, in the OpenLayers.StyleMap class passed to my
> weather layer.
> I found this code in the initialize function:
>
> *if(style instanceof OpenLayers.Style)*
>
> This code block my Rain or Temperature classes to go further.
>
> So I changed the code in something like:
>
> *if(style instanceof OpenLayers.Style ||
>                (style.CLASS_NAME &&
> style.CLASS_NAME.indexOf("OpenLayers.Style")!=-1))*
>
> Does it make sense to you?
>
> Thanks
>
>   Milan Antonovic
>
>
> Milan Antonovic
> Institute of Earth Sciences
> University of Applied Sciences of the South Switzerland - SUPSI
> Trevano, C.P. 72, CH-6952 Canobbio, SWITZERLAND
> Tel: +41(0)58 666 62 13
> E-mail: milan.antonovic at supsi.ch
> Web: http://www.ist.supsi.ch
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>





More information about the Dev mailing list