Merge pull request #3026 from htulipe/wmts-getcap
Add support of reading WMTS Get Cap document
This commit is contained in:
@@ -83,20 +83,13 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
||||
ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Constraint');
|
||||
var object = objectStack[objectStack.length - 1];
|
||||
goog.asserts.assert(goog.isObject(object));
|
||||
var name = node.getAttribute('name');
|
||||
var value = ol.xml.pushParseAndPop({},
|
||||
ol.format.OWS.CONSTRAINT_PARSERS_, node,
|
||||
objectStack);
|
||||
if (!goog.isDef(value)) {
|
||||
if (!goog.isDef(name)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!goog.isDef(object.constraints)) {
|
||||
object.constraints = {};
|
||||
}
|
||||
object.constraints[name] = value;
|
||||
|
||||
return ol.xml.pushParseAndPop({'name': name},
|
||||
ol.format.OWS.CONSTRAINT_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -137,22 +130,12 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
|
||||
ol.format.OWS.readGet_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Get');
|
||||
var object = objectStack[objectStack.length - 1];
|
||||
var url = ol.format.XLink.readHref(node);
|
||||
goog.asserts.assert(goog.isObject(object));
|
||||
var value = ol.xml.pushParseAndPop({'url': url},
|
||||
ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
|
||||
if (!goog.isDef(value)) {
|
||||
var href = ol.format.XLink.readHref(node);
|
||||
if (!goog.isDef(href)) {
|
||||
return undefined;
|
||||
}
|
||||
var get = object['get'];
|
||||
if (!goog.isDef(get)) {
|
||||
object['get'] = [value];
|
||||
}else {
|
||||
goog.asserts.assert(goog.isArray(get));
|
||||
get.push(value);
|
||||
}
|
||||
|
||||
return ol.xml.pushParseAndPop({'href': href},
|
||||
ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -273,18 +256,12 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Object|undefined}
|
||||
* @return {string|undefined}
|
||||
*/
|
||||
ol.format.OWS.readValue_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Value');
|
||||
var object = objectStack[objectStack.length - 1];
|
||||
goog.asserts.assert(goog.isObject(object));
|
||||
var key = ol.format.XSD.readString(node);
|
||||
if (!goog.isDef(key)) {
|
||||
return undefined;
|
||||
}
|
||||
object[key] = true;
|
||||
return ol.format.XSD.readString(node);
|
||||
};
|
||||
|
||||
|
||||
@@ -307,14 +284,11 @@ ol.format.OWS.NAMESPACE_URIS_ = [
|
||||
ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'ServiceIdentification': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readServiceIdentification_,
|
||||
'serviceIdentification'),
|
||||
ol.format.OWS.readServiceIdentification_),
|
||||
'ServiceProvider': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readServiceProvider_,
|
||||
'serviceProvider'),
|
||||
ol.format.OWS.readServiceProvider_),
|
||||
'OperationsMetadata': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readOperationsMetadata_,
|
||||
'operationsMetadata')
|
||||
ol.format.OWS.readOperationsMetadata_)
|
||||
});
|
||||
|
||||
|
||||
@@ -326,17 +300,14 @@ ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'DeliveryPoint': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'deliveryPoint'),
|
||||
'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'city'),
|
||||
ol.format.XSD.readString),
|
||||
'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'AdministrativeArea': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'administrativeArea'),
|
||||
'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'postalCode'),
|
||||
'Country': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'country'),
|
||||
ol.format.XSD.readString),
|
||||
'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'Country': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'ElectronicMailAddress': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'electronicMailAddress')
|
||||
ol.format.XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -347,7 +318,7 @@ ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Value': ol.format.OWS.readValue_
|
||||
'Value': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readValue_)
|
||||
});
|
||||
|
||||
|
||||
@@ -359,8 +330,7 @@ ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'AllowedValues': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readAllowedValues_, 'allowedValues'
|
||||
)
|
||||
ol.format.OWS.readAllowedValues_)
|
||||
});
|
||||
|
||||
|
||||
@@ -371,10 +341,8 @@ ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Phone': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readPhone_, 'phone'),
|
||||
'Address': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readAddress_, 'address')
|
||||
'Phone': ol.xml.makeObjectPropertySetter(ol.format.OWS.readPhone_),
|
||||
'Address': ol.xml.makeObjectPropertySetter(ol.format.OWS.readAddress_)
|
||||
});
|
||||
|
||||
|
||||
@@ -385,8 +353,7 @@ ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'HTTP': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readHttp_, 'http')
|
||||
'HTTP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readHttp_)
|
||||
});
|
||||
|
||||
|
||||
@@ -397,7 +364,7 @@ ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Get': ol.format.OWS.readGet_,
|
||||
'Get': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readGet_),
|
||||
'Post': undefined // TODO
|
||||
});
|
||||
|
||||
@@ -409,8 +376,7 @@ ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'DCP': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readDcp_, 'dcp')
|
||||
'DCP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readDcp_)
|
||||
});
|
||||
|
||||
|
||||
@@ -432,10 +398,8 @@ ol.format.OWS.OPERATIONS_METADATA_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'voice'),
|
||||
'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'facsimile')
|
||||
'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -446,7 +410,8 @@ ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
|
||||
*/
|
||||
ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Constraint': ol.format.OWS.readConstraint_
|
||||
'Constraint': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.OWS.readConstraint_)
|
||||
});
|
||||
|
||||
|
||||
@@ -459,11 +424,10 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'IndividualName': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'individualName'),
|
||||
'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'positionName'),
|
||||
ol.format.XSD.readString),
|
||||
'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'ContactInfo': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readContactInfo_, 'contactInfo')
|
||||
ol.format.OWS.readContactInfo_)
|
||||
});
|
||||
|
||||
|
||||
@@ -475,12 +439,10 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'title'),
|
||||
'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'ServiceTypeVersion': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'serviceTypeVersion'),
|
||||
'ServiceType': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString, 'serviceType')
|
||||
ol.format.XSD.readString),
|
||||
'ServiceType': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -492,10 +454,8 @@ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
ol.format.OWS.SERVICE_PROVIDER_PARSERS_ =
|
||||
ol.xml.makeParsersNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
|
||||
'providerName'),
|
||||
'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref,
|
||||
'providerSite'),
|
||||
'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref),
|
||||
'ServiceContact': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.OWS.readServiceContact_, 'serviceContact')
|
||||
ol.format.OWS.readServiceContact_)
|
||||
});
|
||||
|
||||
400
src/ol/format/wmtscapabilitiesformat.js
Normal file
400
src/ol/format/wmtscapabilitiesformat.js
Normal file
@@ -0,0 +1,400 @@
|
||||
goog.provide('ol.format.WMTSCapabilities');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom.NodeType');
|
||||
goog.require('goog.object');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.format.OWS');
|
||||
goog.require('ol.format.XLink');
|
||||
goog.require('ol.format.XML');
|
||||
goog.require('ol.format.XSD');
|
||||
goog.require('ol.xml');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Format for reading WMTS capabilities data.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.format.XML}
|
||||
* @api
|
||||
*/
|
||||
ol.format.WMTSCapabilities = function() {
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @type {ol.format.OWS}
|
||||
* @private
|
||||
*/
|
||||
this.owsParser_ = new ol.format.OWS();
|
||||
};
|
||||
goog.inherits(ol.format.WMTSCapabilities, ol.format.XML);
|
||||
|
||||
|
||||
/**
|
||||
* Read a WMTS capabilities document.
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|string} source The XML source.
|
||||
* @return {Object} An object representing the WMTS capabilities.
|
||||
* @api
|
||||
*/
|
||||
ol.format.WMTSCapabilities.prototype.read;
|
||||
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {Object} WMTS Capability object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
|
||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT);
|
||||
for (var n = doc.firstChild; !goog.isNull(n); n = n.nextSibling) {
|
||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
||||
return this.readFromNode(n);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Object} WMTS Capability object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Capabilities');
|
||||
this.version = goog.string.trim(node.getAttribute('version'));
|
||||
goog.asserts.assertString(this.version);
|
||||
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
|
||||
if (!goog.isDef(WMTSCapabilityObject)) {
|
||||
return null;
|
||||
}
|
||||
goog.object.set(WMTSCapabilityObject, 'version', this.version);
|
||||
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
|
||||
ol.format.WMTSCapabilities.PARSERS_, node, []);
|
||||
return goog.isDef(WMTSCapabilityObject) ? WMTSCapabilityObject : null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Contents');
|
||||
|
||||
return ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layers object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.localName == 'Layer');
|
||||
return ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readTileMatrixSet_ = function(node, objectStack) {
|
||||
return ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.TMS_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readStyle_ = function(node, objectStack) {
|
||||
var style = ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.STYLE_PARSERS_, node, objectStack);
|
||||
if (!goog.isDef(style)) {
|
||||
return undefined;
|
||||
}
|
||||
var isDefault = node.getAttribute('isDefault') === 'true';
|
||||
style['isDefault'] = isDefault;
|
||||
return style;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readTileMatrixSetLink_ = function(node,
|
||||
objectStack) {
|
||||
return ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Resource URL object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readResourceUrl_ = function(node, objectStack) {
|
||||
var format = node.getAttribute('format');
|
||||
var template = node.getAttribute('template');
|
||||
var resourceType = node.getAttribute('resourceType');
|
||||
var resource = {};
|
||||
if (goog.isDef(format)) {
|
||||
resource['format'] = format;
|
||||
}
|
||||
if (goog.isDef(template)) {
|
||||
resource['template'] = template;
|
||||
}
|
||||
if (goog.isDef(resourceType)) {
|
||||
resource['resourceType'] = resourceType;
|
||||
}
|
||||
return resource;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} WGS84 BBox object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readWgs84BoundingBox_ = function(node, objectStack) {
|
||||
var coordinates = ol.xml.pushParseAndPop([],
|
||||
ol.format.WMTSCapabilities.WGS84_BBOX_READERS_, node, objectStack);
|
||||
if (coordinates.length != 2) {
|
||||
return undefined;
|
||||
}
|
||||
return ol.extent.boundingExtent(coordinates);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Legend object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readLegendUrl_ = function(node, objectStack) {
|
||||
var legend = {};
|
||||
legend['format'] = node.getAttribute('format');
|
||||
legend['href'] = ol.format.XLink.readHref(node);
|
||||
return legend;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Coordinates object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readCoordinates_ = function(node, objectStack) {
|
||||
var coordinates = ol.format.XSD.readString(node).split(' ');
|
||||
if (!goog.isDef(coordinates) || coordinates.length != 2) {
|
||||
return undefined;
|
||||
}
|
||||
var x = +coordinates[0];
|
||||
var y = +coordinates[1];
|
||||
if (isNaN(x) || isNaN(y)) {
|
||||
return undefined;
|
||||
}
|
||||
return [x, y];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrix object.
|
||||
*/
|
||||
ol.format.WMTSCapabilities.readTileMatrix_ = function(node, objectStack) {
|
||||
return ol.xml.pushParseAndPop({},
|
||||
ol.format.WMTSCapabilities.TM_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_ = [
|
||||
null,
|
||||
'http://www.opengis.net/wmts/1.0'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_ = [
|
||||
null,
|
||||
'http://www.opengis.net/ows/1.1'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'Contents': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.WMTSCapabilities.readContents_)
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.CONTENTS_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'Layer': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readLayer_),
|
||||
'TileMatrixSet': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readTileMatrixSet_)
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.LAYER_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'Style': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readStyle_),
|
||||
'Format': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.XSD.readString),
|
||||
'TileMatrixSetLink': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readTileMatrixSetLink_),
|
||||
'ResourceURL': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readResourceUrl_)
|
||||
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
|
||||
'Title': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
'Abstract': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
'WGS84BoundingBox': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.WMTSCapabilities.readWgs84BoundingBox_),
|
||||
'Identifier': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.STYLE_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'LegendURL': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readLegendUrl_)
|
||||
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
|
||||
'Title': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
'Identifier': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'TileMatrixSet': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.WGS84_BBOX_READERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
|
||||
'LowerCorner': ol.xml.makeArrayPusher(
|
||||
ol.format.WMTSCapabilities.readCoordinates_),
|
||||
'UpperCorner': ol.xml.makeArrayPusher(
|
||||
ol.format.WMTSCapabilities.readCoordinates_)
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TMS_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'WellKnownScaleSet': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
'TileMatrix': ol.xml.makeObjectPropertyPusher(
|
||||
ol.format.WMTSCapabilities.readTileMatrix_)
|
||||
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
|
||||
'SupportedCRS': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
'Identifier': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TM_PARSERS_ = ol.xml.makeParsersNS(
|
||||
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
|
||||
'TopLeftCorner': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.WMTSCapabilities.readCoordinates_),
|
||||
'ScaleDenominator': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readDecimal),
|
||||
'TileWidth': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readNonNegativeInteger),
|
||||
'TileHeight': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readNonNegativeInteger),
|
||||
'MatrixWidth': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readNonNegativeInteger),
|
||||
'MatrixHeight': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readNonNegativeInteger)
|
||||
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
|
||||
'Identifier': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString)
|
||||
}));
|
||||
Reference in New Issue
Block a user