It's the same as with your firestations layer:
map.addLayer(new OpenLayers.Layer.GML("OV's 2.000 Meter", "2000meter.xml", {
format: OpenLayers.Format.KML({extractStyles:false}),
style: {strokeColor: "red", strokeWidth: 5, strokeOpacity: 1,
fillColor:red, fillOpacity:0.5},
projection: map.displayProjection
}));
Except you don't ectract the styles from the kmlfile.
Arnd
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Markus
Gesendet: Donnerstag, 3. Mai 2012 19:07
An: [email protected]
Betreff: [OpenLayers-Users] How can I display each polygon in a
differentcolor?
Hello OpenLayers Team.
i have this Code dev. (Attachment).
How can I display each polygon in a different color?
map.addLayer(new OpenLayers.Layer.GML("OV's 2.000 Meter", "2000meter.xml", {
format: OpenLayers.Format.KML, projection:
map.displayProjection }));
map.addLayer(new OpenLayers.Layer.GML("OV's 4.000 Meter", "4000meter.xml", {
format: OpenLayers.Format.KML, projection:
map.displayProjection }));
First in Green
Second in Red
...
Search a good documentation and example. Found something but not help.
Thanks all.
Bye Markus
My Map online: http://www.meldekopf.de/osm/pn/map.html
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users