diff --git a/src/ol/format/OWS.js b/src/ol/format/OWS.js index 60c206d526..deb2c08e5a 100644 --- a/src/ol/format/OWS.js +++ b/src/ol/format/OWS.js @@ -2,7 +2,7 @@ * @module ol/format/OWS */ import {inherits} from '../index.js'; -import XLink from '../format/XLink.js'; +import {readHref} from '../format/XLink.js'; import XML from '../format/XML.js'; import XSD from '../format/XSD.js'; import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pushParseAndPop} from '../xml.js'; @@ -193,7 +193,7 @@ const SERVICE_PROVIDER_PARSERS = makeStructureNS( NAMESPACE_URIS, { 'ProviderName': makeObjectPropertySetter(XSD.readString), - 'ProviderSite': makeObjectPropertySetter(XLink.readHref), + 'ProviderSite': makeObjectPropertySetter(readHref), 'ServiceContact': makeObjectPropertySetter( readServiceContact) }); @@ -288,7 +288,7 @@ function readDcp(node, objectStack) { * @return {Object|undefined} The GET object. */ function readGet(node, objectStack) { - const href = XLink.readHref(node); + const href = readHref(node); if (!href) { return undefined; } diff --git a/src/ol/format/WMSCapabilities.js b/src/ol/format/WMSCapabilities.js index a3fb478c4f..a150a453b7 100644 --- a/src/ol/format/WMSCapabilities.js +++ b/src/ol/format/WMSCapabilities.js @@ -2,7 +2,7 @@ * @module ol/format/WMSCapabilities */ import {inherits} from '../index.js'; -import XLink from '../format/XLink.js'; +import {readHref} from '../format/XLink.js'; import XML from '../format/XML.js'; import XSD from '../format/XSD.js'; import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter, @@ -73,7 +73,7 @@ const SERVICE_PARSERS = makeStructureNS( 'Title': makeObjectPropertySetter(XSD.readString), 'Abstract': makeObjectPropertySetter(XSD.readString), 'KeywordList': makeObjectPropertySetter(readKeywordList), - 'OnlineResource': makeObjectPropertySetter(XLink.readHref), + 'OnlineResource': makeObjectPropertySetter(readHref), 'ContactInformation': makeObjectPropertySetter(readContactInformation), 'Fees': makeObjectPropertySetter(XSD.readString), 'AccessConstraints': makeObjectPropertySetter(XSD.readString), @@ -168,7 +168,7 @@ const LAYER_PARSERS = makeStructureNS( const ATTRIBUTION_PARSERS = makeStructureNS( NAMESPACE_URIS, { 'Title': makeObjectPropertySetter(XSD.readString), - 'OnlineResource': makeObjectPropertySetter(XLink.readHref), + 'OnlineResource': makeObjectPropertySetter(readHref), 'LogoURL': makeObjectPropertySetter(readSizedFormatOnlineresource) }); @@ -252,7 +252,7 @@ const STYLE_PARSERS = makeStructureNS( const FORMAT_ONLINERESOURCE_PARSERS = makeStructureNS(NAMESPACE_URIS, { 'Format': makeObjectPropertySetter(XSD.readString), - 'OnlineResource': makeObjectPropertySetter(XLink.readHref) + 'OnlineResource': makeObjectPropertySetter(readHref) }); diff --git a/src/ol/format/WMTSCapabilities.js b/src/ol/format/WMTSCapabilities.js index d7136f5167..0458e089f7 100644 --- a/src/ol/format/WMTSCapabilities.js +++ b/src/ol/format/WMTSCapabilities.js @@ -4,7 +4,7 @@ import {inherits} from '../index.js'; import {boundingExtent} from '../extent.js'; import OWS from '../format/OWS.js'; -import XLink from '../format/XLink.js'; +import {readHref} from '../format/XLink.js'; import XML from '../format/XML.js'; import XSD from '../format/XSD.js'; import {pushParseAndPop, makeStructureNS, @@ -344,7 +344,7 @@ function readWgs84BoundingBox(node, objectStack) { function readLegendUrl(node, objectStack) { const legend = {}; legend['format'] = node.getAttribute('format'); - legend['href'] = XLink.readHref(node); + legend['href'] = readHref(node); return legend; } diff --git a/src/ol/format/XLink.js b/src/ol/format/XLink.js index db684f45f9..8688388c81 100644 --- a/src/ol/format/XLink.js +++ b/src/ol/format/XLink.js @@ -1,7 +1,6 @@ /** * @module ol/format/XLink */ -const XLink = {}; /** @@ -15,7 +14,6 @@ const NAMESPACE_URI = 'http://www.w3.org/1999/xlink'; * @param {Node} node Node. * @return {boolean|undefined} Boolean. */ -XLink.readHref = function(node) { +export function readHref(node) { return node.getAttributeNS(NAMESPACE_URI, 'href'); -}; -export default XLink; +}