diff --git a/examples/kml-layer.html b/examples/kml-layer.html index 95c8e12448..217e7e9a1b 100644 --- a/examples/kml-layer.html +++ b/examples/kml-layer.html @@ -19,7 +19,8 @@ format: OpenLayers.Format.KML, formatOptions: { extractStyles: true, - extractAttributes: true + extractAttributes: true, + maxDepth: 2 } })); map.zoomToExtent(new OpenLayers.Bounds(-112.306698,36.017792,-112.03204,36.18087)); diff --git a/examples/kml/lines.kml b/examples/kml/lines.kml index 6dc09d7de6..5999aaa131 100644 --- a/examples/kml/lines.kml +++ b/examples/kml/lines.kml @@ -262,6 +262,14 @@ -112.2626894973474,36.10149062823369,630 + + Blue Icon + Just another blue icon. + kml/styles.kml#blueIcons + + -112.292238941097,36.09520916122063,630 + + diff --git a/examples/kml/styles.kml b/examples/kml/styles.kml new file mode 100644 index 0000000000..24350ade44 --- /dev/null +++ b/examples/kml/styles.kml @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js index 73ed1eb2dd..26a967b29b 100644 --- a/lib/OpenLayers/Format/KML.js +++ b/lib/OpenLayers/Format/KML.js @@ -543,7 +543,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, { // Create reference to styleUrl if (this.extractStyles && feature.attributes && feature.attributes.styleUrl) { - feature.style = this.getStyle(feature.attributes.styleUrl); + feature.style = this.getStyle(feature.attributes.styleUrl, options); } if (this.extractStyles) {