Remove KML.readStyleUrl_ as duplicate of KML.readURI_

StyleUrl elements in Placemarks use readURI_() whereas those in StyleMaps use readStyleUrl_(), so standardize on readURI_()
This commit is contained in:
Peter Robins
2016-07-06 15:37:18 +00:00
parent 810ed63b9f
commit ba97ee4674

View File

@@ -481,23 +481,6 @@ ol.format.KML.readFlatCoordinates_ = function(node) {
};
/**
* @param {Node} node Node.
* @private
* @return {string|undefined} Style URL.
*/
ol.format.KML.readStyleUrl_ = function(node) {
var s = ol.xml.getAllTextContent(node, false).trim();
if (node.baseURI) {
var url = new URL(s, node.baseURI);
return url.href;
} else {
return s;
}
};
/**
* @param {Node} node Node.
* @private
@@ -1626,7 +1609,7 @@ ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
ol.format.KML.NAMESPACE_URIS_, {
'Style': ol.xml.makeObjectPropertySetter(ol.format.KML.readStyle_),
'key': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'styleUrl': ol.xml.makeObjectPropertySetter(ol.format.KML.readStyleUrl_)
'styleUrl': ol.xml.makeObjectPropertySetter(ol.format.KML.readURI_)
});