Roald de Wit wrote:
This is untested, so please report back if it doesn't work for you,
preferably with a complete example (posted to something like pastebin).
Seems I'm having the same problem as Ivo. My KML looks like
<Document>
<name>Relation 1075685</name>
<description></description>
<Folder>
<name>Segment 0<br></name>
<visibility>true</visibility>
<open>true</open>
<description>Way IDs: 39028795, 39028794, ...</description>
<Placemark>
<Style>
<LineStyle>
<color>FF0000FF</color>
<width>3.0</width>
</LineStyle>
</Style>
<LineString>
<coordinates>-1.6329761,48.1968307, ...</coordinates>
</LineString>
</Placemark>
</Folder>
</Document>
and my code
styles = new OpenLayers.StyleMap ({
"default": new OpenLayers.Style({
label : "${name}",
fillColor: "#ffcc66",
strokeColor: "red",
strokeWidth: 3
}),
canal = new OpenLayers.Layer.Vector (canals[i][1], {
callback: respondCode,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "data/relation_"+canals[i][0]+".kml",
format: new OpenLayers.Format.KML({extractAttributes: true,
extractStyles: false})
}),
projection: map.displayProjection,
eventListeners: {
"featureselected": onFeatureSelect,
"featureunselected": onFeatureUnselect,
scope: this
},
styleMap: styles
});
and my test page
http://www.orpatec.ch/osm/tools/test.php
Wyo
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users