You can do something like:<br><br>styleMap = new OpenLayers.StyleMap({'default':{<br> label : "${label}",<br> fontColor: "${fontColor}",<br> fontSize: "11px",<br>
labelAlign: "${labelAlign}",<br> pointRadius: 2,<br> labelXOffset : "${labelX}",<br> labelYOffset : "${labelY}"<br>
}});<br><br>GMLlayer = new OpenLayers.Layer.GML("Layer name, kml_url, <br> {<br> format: OpenLayers.Format.KML, <br> formatOptions: {<br>
extractAttributes: true,<br> maxDepth: 2<br> },<br> styleMap: styleMap<br>
});<br><br>And a KML like that:<br><br><kml xmlns="<a href="http://www.opengis.net/kml/2.2">http://www.opengis.net/kml/2.2</a>"><br> <Document><br> <name>Date</name><br>
<description>Date</description><br> <Placemark><br> <label>24 Jan, 13h</label><br> <labelAlign>center</labelAlign><br> <labelX>0</labelX><br>
<labelY>10</labelY><br> <Point><br> <coordinates>70.0,-30</coordinates><br> </Point><br><br><br><div class="gmail_quote">2010/8/25 Tim Alder <span dir="ltr"><<a href="mailto:tim.alder@s2002.tu-chemnitz.de">tim.alder@s2002.tu-chemnitz.de</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello, is there a way to show labeltext on a layer that based on KML?<br>
Where can I found a good example for this?<br>
<br>
The next step would be perhaps than a solution to prevent coolisions between this labeltext but this seems really complicate.<br>
<br>
<br>
Greetings Kolossos<br>
<br>
P.S: To my person: I'm working on the cooperation between Wikipedia and OpenStreetMap.<br>
First result:<br>
<a href="http://toolserver.org/%7Ekolossos/openlayers/kml-on-ol.php?zoom=10&lat=48.15841&lon=11.42421&lang=en&layers=B00TT" target="_blank">http://toolserver.org/~kolossos/openlayers/kml-on-ol.php?zoom=10&lat=48.15841&lon=11.42421&lang=en&layers=B00TT</a><br>
Some cartographs means now that it would be better to show optional also textlabels on map.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</blockquote></div><br>