Fix for Inline KML styles extracted even though extractStyles is false,

from Edgemaster. r=me, tests=me, (Closes #1576)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7607 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-07-30 14:53:24 +00:00
parent b5c10debb1
commit 7d3d615172
2 changed files with 20 additions and 11 deletions

View File

@@ -541,17 +541,19 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
feature.style = this.getStyle(feature.attributes.styleUrl);
}
// Make sure that <Style> nodes within a placemark are
// processed as well
var inlineStyleNode = this.getElementsByTagNameNS(featureNode,
"*",
"Style")[0];
if (inlineStyleNode) {
var inlineStyle= this.parseStyle(inlineStyleNode);
if (inlineStyle) {
feature.style = OpenLayers.Util.extend(
feature.style, inlineStyle
);
if (this.extractStyles) {
// Make sure that <Style> nodes within a placemark are
// processed as well
var inlineStyleNode = this.getElementsByTagNameNS(featureNode,
"*",
"Style")[0];
if (inlineStyleNode) {
var inlineStyle= this.parseStyle(inlineStyleNode);
if (inlineStyle) {
feature.style = OpenLayers.Util.extend(
feature.style, inlineStyle
);
}
}
}