diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js index 49c1d8b51c..200d451502 100644 --- a/lib/OpenLayers/Format/KML.js +++ b/lib/OpenLayers/Format/KML.js @@ -329,6 +329,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, { if (width) { style["strokeWidth"] = width; } + break; case "polystyle": var color = this.parseProperty(styleTypeNode, "*", "color"); @@ -358,6 +359,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, { } break; + case "iconstyle": // set scale var scale = parseFloat(this.parseProperty(styleTypeNode, diff --git a/tests/Format/KML.html b/tests/Format/KML.html index c798de74b4..48542e23f8 100644 --- a/tests/Format/KML.html +++ b/tests/Format/KML.html @@ -5,7 +5,7 @@ var test_content = 'OpenLayers exportVector geometries from OpenLayersOpenLayers.Feature.Vector_344A KLM Polygon5.001370157823406,49.26855713824488 8.214706453896161,49.630662409673505 8.397385910100951,48.45172350357396 5.001370157823406,49.26855713824488OpenLayers.Feature.Vector_402A KML LineString5.838523393080493,49.74814616928052 5.787079558782349,48.410795432216574 8.91427702008381,49.28932499608202OpenLayers.Feature.Vector_451A KML Point6.985073041685488,49.8682250149058SF Marina Harbor MasterKML MultiGeometry-122.4425587930444,37.80666418607323 -122.4428379594768,37.80663578323093-122.4425509770566,37.80662588061205 -122.4428340530617,37.8065999493009'; var test_style = ' -112,36 -113,37 '; - var test_style_fill = ' -112,36 -113,37 '; + var test_style_fill = ' -112,36 -113,37 -112,36 -113,37 '; var test_style_outline = ' -112,36 -113,37 '; var test_nl = ' http://maker.geocommons.com/maps/1717/overlays/0 '; @@ -155,10 +155,9 @@ function test_Format_KML_extractStyleFill(t) { t.plan(2); var f = new OpenLayers.Format.KML({extractStyles: true}); - var features = f.read(test_style); - t.eq(features[0].style.fillColor, "#ff0000", "default fill is set"); var features = f.read(test_style_fill); - t.eq(features[0].style.fillColor, "none", "KML Feature has none fill"); + t.eq(features[0].style.fillColor, "#ff0000", "default fill is set"); + t.eq(features[1].style.fillColor, "none", "KML Feature has none fill"); } function test_Format_KML_extractStyleOutline(t) { t.plan(2);