[OpenLayers-Users] Layer rendering

Andreas Hocevar andreas.hocevar at gmail.com
Wed Mar 5 10:03:22 EST 2008


Carlos,


Carlos Pinto wrote:
>         var mylayer =   new OpenLayers.Layer.GML("GML", 
> "../KML/MyPolygons.xml",{styleMap: styleMap} );
>         map.addLayer(mylayer);                
>         }
>
>
> but one thing funny is that if I use the line
>
> myLayer.styleMap = styleMap;
>
> it does not work
>

You have to add that line _before_ map.addLayer(), otherwise you have to 
redraw the layer.


I just tried both setting the styleMap in the constructor and assigning 
later, and both worked on a GML layer.

Regards,
Andreas.



More information about the Users mailing list