Add KML Styling support. Thanks rdewit for this great contribution. r=crschmidt,me (closes #1259)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6179 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2008-02-09 20:42:32 +00:00
parent 06571e2cf3
commit c70fb21103
3 changed files with 556 additions and 21 deletions

View File

@@ -4,14 +4,19 @@
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function parseData(req) {
g = new OpenLayers.Format.KML();
g = new OpenLayers.Format.KML({extractStyles: true});
html = ""
features = g.read(req.responseText);
for(var feat in features) {
html += "Feature: Geometry: "+ features[feat].geometry+",";
html += "<ul>";
for (var j in features[feat].attributes) {
html += "<li>"+j+":"+features[feat].attributes[j]+"</li>";
html += "<li>Attribute "+j+":"+features[feat].attributes[j]+"</li>";
}
html += "</ul>"
html += "<ul>";
for (var j in features[feat].style) {
html += "<li>Style "+j+":"+features[feat].style[j]+"</li>";
}
html += "</ul>"
}