Hello all. I am having an issue getting a Layer to show labels on the map along with having it extract styles from a KML file. It shows labels when I set extractStyles to false, but does not when I set it to true. Is there a way to show the labels when extractStyles is set to true? Can I enable the labels after the KML file is loaded? Would this entail something like modifying the style after the fact? <br>
<br>Example snippit: <br><br>var kmlStyleMap = new OpenLayers.StyleMap({'default':{<br> label : "${name}",<br> fontColor: "#000000",<br> fontSize: "11px",<br>
labelAlign: "center",<br> pointRadius: 2,<br> labelXOffset : 0,<br> labelYOffset : 0,<br> labelSelect: true<br>
}});<br><br>var kmlFormat = new OpenLayers.Format.KML({<br> internalProjection: sphericalMercatorProj,<br> externalProjection: mapProj,<br> extractStyles: true,<br>
extractAttributes: true,<br> maxDepth: 2<br> });<br><br>var ellipseKMLLayer = new OpenLayers.Layer.Vector("KML",<br> {<br> projection: latLonProj,<br>
strategies: [new OpenLayers.Strategy.Fixed()],<br> protocol: new OpenLayers.Protocol.HTTP({<br> url: kmlHref,<br> format: kmlFormat<br> }),<br>
styleMap: kmlStyleMap,<br> eventListeners: { 'loadend': kmlLoaded },<br> renderers: renderer<br> });<br><br><br>Sample KML file:<br><br><?xml version="1.0"?><br>
<kml xmlns:gx="<a href="http://www.google.com/kml/ext/2.2">http://www.google.com/kml/ext/2.2</a>" xmlns:atom="<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>" xmlns="<a href="http://www.opengis.net/kml/2.2">http://www.opengis.net/kml/2.2</a>"><br>
<Document><br> <name>Geolocation Case: 17564</name><br> <open>1</open><br> <visibility>1</visibility><br> <Style id="style1"><br> <LineStyle><br>
<width>2</width><br> <color>bf970952</color><br> </LineStyle><br> <PolyStyle><br> <color>4abf0c74</color><br> <colorMode>random</colorMode><br>
</PolyStyle><br> <LabelStyle><br> <color>ffffffff</color><br> <colorMode>normal</colorMode><br> <scale>1.2</scale><br> </LabelStyle><br>
<IconStyle><br> <Icon><br> <href><a href="http://127.0.0.1:8000/static/images/pointicon.png">http://127.0.0.1:8000/static/images/pointicon.png</a></href><br> </Icon><br>
</IconStyle><br> </Style><br> <Placemark><br> <name>My Point</name> <br> <Point><br> <coordinates>-81.522832781,-3.33918759741,0.0</coordinates><br>
</Point><br> <LookAt><br> <longitude>-81.522832781</longitude><br> <latitude>-3.33918759741</latitude><br> </LookAt><br> <styleUrl>#style1</styleUrl><br>
</Placemark><br> ... more Placemarks ...<br><br><br>-Chris<br>