Fix code indentation
This commit is contained in:
@@ -37,8 +37,7 @@ import {getAllTextContent, getAttributeNS, makeArrayPusher, makeReplacer, parseN
|
|||||||
* @extends {ol.format.XMLFeature}
|
* @extends {ol.format.XMLFeature}
|
||||||
*/
|
*/
|
||||||
const GMLBase = function(opt_options) {
|
const GMLBase = function(opt_options) {
|
||||||
const options = /** @type {olx.format.GMLOptions} */
|
const options = /** @type {olx.format.GMLOptions} */ (opt_options ? opt_options : {});
|
||||||
(opt_options ? opt_options : {});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -69,10 +68,8 @@ const GMLBase = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.FEATURE_COLLECTION_PARSERS = {};
|
this.FEATURE_COLLECTION_PARSERS = {};
|
||||||
this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS] = {
|
this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS] = {
|
||||||
'featureMember': makeReplacer(
|
'featureMember': makeReplacer(GMLBase.prototype.readFeaturesInternal),
|
||||||
GMLBase.prototype.readFeaturesInternal),
|
'featureMembers': makeReplacer(GMLBase.prototype.readFeaturesInternal)
|
||||||
'featureMembers': makeReplacer(
|
|
||||||
GMLBase.prototype.readFeaturesInternal)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
XMLFeature.call(this);
|
XMLFeature.call(this);
|
||||||
@@ -221,8 +218,7 @@ GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||||
let n;
|
let n;
|
||||||
const fid = node.getAttribute('fid') ||
|
const fid = node.getAttribute('fid') || getAttributeNS(node, GMLBase.GMLNS, 'id');
|
||||||
getAttributeNS(node, GMLBase.GMLNS, 'id');
|
|
||||||
const values = {};
|
const values = {};
|
||||||
let geometryName;
|
let geometryName;
|
||||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||||
@@ -263,8 +259,7 @@ GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
|||||||
* @return {ol.geom.Point|undefined} Point.
|
* @return {ol.geom.Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readPoint = function(node, objectStack) {
|
GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||||
const flatCoordinates =
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
const point = new Point(null);
|
const point = new Point(null);
|
||||||
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||||
@@ -316,8 +311,7 @@ GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||||
/** @type {Array.<ol.geom.Polygon>} */
|
/** @type {Array.<ol.geom.Polygon>} */
|
||||||
const polygons = pushParseAndPop([],
|
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
const multiPolygon = new MultiPolygon(null);
|
const multiPolygon = new MultiPolygon(null);
|
||||||
multiPolygon.setPolygons(polygons);
|
multiPolygon.setPolygons(polygons);
|
||||||
@@ -334,8 +328,7 @@ GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||||
parseNode(this.POINTMEMBER_PARSERS_,
|
parseNode(this.POINTMEMBER_PARSERS_, node, objectStack, this);
|
||||||
node, objectStack, this);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -345,8 +338,7 @@ GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
||||||
parseNode(this.LINESTRINGMEMBER_PARSERS_,
|
parseNode(this.LINESTRINGMEMBER_PARSERS_, node, objectStack, this);
|
||||||
node, objectStack, this);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -356,8 +348,7 @@ GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
||||||
parseNode(this.POLYGONMEMBER_PARSERS_, node,
|
parseNode(this.POLYGONMEMBER_PARSERS_, node, objectStack, this);
|
||||||
objectStack, this);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -367,8 +358,7 @@ GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {ol.geom.LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readLineString = function(node, objectStack) {
|
GMLBase.prototype.readLineString = function(node, objectStack) {
|
||||||
const flatCoordinates =
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
const lineString = new LineString(null);
|
const lineString = new LineString(null);
|
||||||
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
lineString.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||||
@@ -403,8 +393,7 @@ GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
|||||||
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
||||||
const flatCoordinates =
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
const ring = new LinearRing(null);
|
const ring = new LinearRing(null);
|
||||||
ring.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
ring.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||||
@@ -433,8 +422,7 @@ GMLBase.prototype.readPolygon = function(node, objectStack) {
|
|||||||
extend(flatCoordinates, flatLinearRings[i]);
|
extend(flatCoordinates, flatLinearRings[i]);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
polygon.setFlatCoordinates(
|
polygon.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates, ends);
|
||||||
GeometryLayout.XYZ, flatCoordinates, ends);
|
|
||||||
return polygon;
|
return polygon;
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -449,9 +437,7 @@ GMLBase.prototype.readPolygon = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array.<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||||
return pushParseAndPop(null,
|
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
||||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
|
||||||
objectStack, this);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -462,10 +448,8 @@ GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'pointMember': makeArrayPusher(
|
'pointMember': makeArrayPusher(GMLBase.prototype.pointMemberParser_),
|
||||||
GMLBase.prototype.pointMemberParser_),
|
'pointMembers': makeArrayPusher(GMLBase.prototype.pointMemberParser_)
|
||||||
'pointMembers': makeArrayPusher(
|
|
||||||
GMLBase.prototype.pointMemberParser_)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -477,10 +461,8 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'lineStringMember': makeArrayPusher(
|
'lineStringMember': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_),
|
||||||
GMLBase.prototype.lineStringMemberParser_),
|
'lineStringMembers': makeArrayPusher(GMLBase.prototype.lineStringMemberParser_)
|
||||||
'lineStringMembers': makeArrayPusher(
|
|
||||||
GMLBase.prototype.lineStringMemberParser_)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -492,10 +474,8 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'polygonMember': makeArrayPusher(
|
'polygonMember': makeArrayPusher(GMLBase.prototype.polygonMemberParser_),
|
||||||
GMLBase.prototype.polygonMemberParser_),
|
'polygonMembers': makeArrayPusher(GMLBase.prototype.polygonMemberParser_)
|
||||||
'polygonMembers': makeArrayPusher(
|
|
||||||
GMLBase.prototype.polygonMemberParser_)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -507,8 +487,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'Point': makeArrayPusher(
|
'Point': makeArrayPusher(GMLBase.prototype.readFlatCoordinatesFromNode_)
|
||||||
GMLBase.prototype.readFlatCoordinatesFromNode_)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -520,8 +499,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'LineString': makeArrayPusher(
|
'LineString': makeArrayPusher(GMLBase.prototype.readLineString)
|
||||||
GMLBase.prototype.readLineString)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -533,8 +511,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'Polygon': makeArrayPusher(
|
'Polygon': makeArrayPusher(GMLBase.prototype.readPolygon)
|
||||||
GMLBase.prototype.readPolygon)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -546,8 +523,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
|||||||
*/
|
*/
|
||||||
GMLBase.prototype.RING_PARSERS = {
|
GMLBase.prototype.RING_PARSERS = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
'LinearRing': makeReplacer(
|
'LinearRing': makeReplacer(GMLBase.prototype.readFlatLinearRing_)
|
||||||
GMLBase.prototype.readFlatLinearRing_)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -594,7 +570,6 @@ GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readProjectionFromNode = function(node) {
|
GMLBase.prototype.readProjectionFromNode = function(node) {
|
||||||
return getProjection(this.srsName ? this.srsName :
|
return getProjection(this.srsName ? this.srsName : node.firstElementChild.getAttribute('srsName'));
|
||||||
node.firstElementChild.getAttribute('srsName'));
|
|
||||||
};
|
};
|
||||||
export default GMLBase;
|
export default GMLBase;
|
||||||
|
|||||||
@@ -308,8 +308,7 @@ WMSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readAttribution(node, objectStack) {
|
function readAttribution(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, ATTRIBUTION_PARSERS, node, objectStack);
|
||||||
{}, ATTRIBUTION_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -377,8 +376,7 @@ function readEXGeographicBoundingBox(node, objectStack) {
|
|||||||
* @return {Object|undefined} Capability object.
|
* @return {Object|undefined} Capability object.
|
||||||
*/
|
*/
|
||||||
function readCapability(node, objectStack) {
|
function readCapability(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, CAPABILITY_PARSERS, node, objectStack);
|
||||||
{}, CAPABILITY_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -388,8 +386,7 @@ function readCapability(node, objectStack) {
|
|||||||
* @return {Object|undefined} Service object.
|
* @return {Object|undefined} Service object.
|
||||||
*/
|
*/
|
||||||
function readService(node, objectStack) {
|
function readService(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, SERVICE_PARSERS, node, objectStack);
|
||||||
{}, SERVICE_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -399,9 +396,7 @@ function readService(node, objectStack) {
|
|||||||
* @return {Object|undefined} Contact information object.
|
* @return {Object|undefined} Contact information object.
|
||||||
*/
|
*/
|
||||||
function readContactInformation(node, objectStack) {
|
function readContactInformation(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, CONTACT_INFORMATION_PARSERS, node, objectStack);
|
||||||
{}, CONTACT_INFORMATION_PARSERS,
|
|
||||||
node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -411,9 +406,7 @@ function readContactInformation(node, objectStack) {
|
|||||||
* @return {Object|undefined} Contact person object.
|
* @return {Object|undefined} Contact person object.
|
||||||
*/
|
*/
|
||||||
function readContactPersonPrimary(node, objectStack) {
|
function readContactPersonPrimary(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, CONTACT_PERSON_PARSERS, node, objectStack);
|
||||||
{}, CONTACT_PERSON_PARSERS,
|
|
||||||
node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -423,9 +416,7 @@ function readContactPersonPrimary(node, objectStack) {
|
|||||||
* @return {Object|undefined} Contact address object.
|
* @return {Object|undefined} Contact address object.
|
||||||
*/
|
*/
|
||||||
function readContactAddress(node, objectStack) {
|
function readContactAddress(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, CONTACT_ADDRESS_PARSERS, node, objectStack);
|
||||||
{}, CONTACT_ADDRESS_PARSERS,
|
|
||||||
node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -435,8 +426,7 @@ function readContactAddress(node, objectStack) {
|
|||||||
* @return {Array.<string>|undefined} Format array.
|
* @return {Array.<string>|undefined} Format array.
|
||||||
*/
|
*/
|
||||||
function readException(node, objectStack) {
|
function readException(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
||||||
[], EXCEPTION_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -446,8 +436,7 @@ function readException(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readCapabilityLayer(node, objectStack) {
|
function readCapabilityLayer(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
||||||
{}, LAYER_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -460,14 +449,12 @@ function readLayer(node, objectStack) {
|
|||||||
const parentLayerObject = /** @type {Object.<string,*>} */
|
const parentLayerObject = /** @type {Object.<string,*>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
|
|
||||||
const layerObject = pushParseAndPop(
|
const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
||||||
{}, LAYER_PARSERS, node, objectStack);
|
|
||||||
|
|
||||||
if (!layerObject) {
|
if (!layerObject) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let queryable =
|
let queryable = XSD.readBooleanString(node.getAttribute('queryable'));
|
||||||
XSD.readBooleanString(node.getAttribute('queryable'));
|
|
||||||
if (queryable === undefined) {
|
if (queryable === undefined) {
|
||||||
queryable = parentLayerObject['queryable'];
|
queryable = parentLayerObject['queryable'];
|
||||||
}
|
}
|
||||||
@@ -486,22 +473,19 @@ function readLayer(node, objectStack) {
|
|||||||
}
|
}
|
||||||
layerObject['opaque'] = opaque !== undefined ? opaque : false;
|
layerObject['opaque'] = opaque !== undefined ? opaque : false;
|
||||||
|
|
||||||
let noSubsets =
|
let noSubsets = XSD.readBooleanString(node.getAttribute('noSubsets'));
|
||||||
XSD.readBooleanString(node.getAttribute('noSubsets'));
|
|
||||||
if (noSubsets === undefined) {
|
if (noSubsets === undefined) {
|
||||||
noSubsets = parentLayerObject['noSubsets'];
|
noSubsets = parentLayerObject['noSubsets'];
|
||||||
}
|
}
|
||||||
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
|
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
|
||||||
|
|
||||||
let fixedWidth =
|
let fixedWidth = XSD.readDecimalString(node.getAttribute('fixedWidth'));
|
||||||
XSD.readDecimalString(node.getAttribute('fixedWidth'));
|
|
||||||
if (!fixedWidth) {
|
if (!fixedWidth) {
|
||||||
fixedWidth = parentLayerObject['fixedWidth'];
|
fixedWidth = parentLayerObject['fixedWidth'];
|
||||||
}
|
}
|
||||||
layerObject['fixedWidth'] = fixedWidth;
|
layerObject['fixedWidth'] = fixedWidth;
|
||||||
|
|
||||||
let fixedHeight =
|
let fixedHeight = XSD.readDecimalString(node.getAttribute('fixedHeight'));
|
||||||
XSD.readDecimalString(node.getAttribute('fixedHeight'));
|
|
||||||
if (!fixedHeight) {
|
if (!fixedHeight) {
|
||||||
fixedHeight = parentLayerObject['fixedHeight'];
|
fixedHeight = parentLayerObject['fixedHeight'];
|
||||||
}
|
}
|
||||||
@@ -540,10 +524,8 @@ function readDimension(node, objectStack) {
|
|||||||
'units': node.getAttribute('units'),
|
'units': node.getAttribute('units'),
|
||||||
'unitSymbol': node.getAttribute('unitSymbol'),
|
'unitSymbol': node.getAttribute('unitSymbol'),
|
||||||
'default': node.getAttribute('default'),
|
'default': node.getAttribute('default'),
|
||||||
'multipleValues': XSD.readBooleanString(
|
'multipleValues': XSD.readBooleanString(node.getAttribute('multipleValues')),
|
||||||
node.getAttribute('multipleValues')),
|
'nearestValue': XSD.readBooleanString(node.getAttribute('nearestValue')),
|
||||||
'nearestValue': XSD.readBooleanString(
|
|
||||||
node.getAttribute('nearestValue')),
|
|
||||||
'current': XSD.readBooleanString(node.getAttribute('current')),
|
'current': XSD.readBooleanString(node.getAttribute('current')),
|
||||||
'values': XSD.readString(node)
|
'values': XSD.readString(node)
|
||||||
};
|
};
|
||||||
@@ -557,9 +539,7 @@ function readDimension(node, objectStack) {
|
|||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readFormatOnlineresource(node, objectStack) {
|
function readFormatOnlineresource(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, FORMAT_ONLINERESOURCE_PARSERS, node, objectStack);
|
||||||
{}, FORMAT_ONLINERESOURCE_PARSERS,
|
|
||||||
node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -569,8 +549,7 @@ function readFormatOnlineresource(node, objectStack) {
|
|||||||
* @return {Object|undefined} Request object.
|
* @return {Object|undefined} Request object.
|
||||||
*/
|
*/
|
||||||
function readRequest(node, objectStack) {
|
function readRequest(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, REQUEST_PARSERS, node, objectStack);
|
||||||
{}, REQUEST_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -580,8 +559,7 @@ function readRequest(node, objectStack) {
|
|||||||
* @return {Object|undefined} DCP type object.
|
* @return {Object|undefined} DCP type object.
|
||||||
*/
|
*/
|
||||||
function readDCPType(node, objectStack) {
|
function readDCPType(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, DCPTYPE_PARSERS, node, objectStack);
|
||||||
{}, DCPTYPE_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -591,8 +569,7 @@ function readDCPType(node, objectStack) {
|
|||||||
* @return {Object|undefined} HTTP object.
|
* @return {Object|undefined} HTTP object.
|
||||||
*/
|
*/
|
||||||
function readHTTP(node, objectStack) {
|
function readHTTP(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, HTTP_PARSERS, node, objectStack);
|
||||||
{}, HTTP_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -602,8 +579,7 @@ function readHTTP(node, objectStack) {
|
|||||||
* @return {Object|undefined} Operation type object.
|
* @return {Object|undefined} Operation type object.
|
||||||
*/
|
*/
|
||||||
function readOperationType(node, objectStack) {
|
function readOperationType(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, OPERATIONTYPE_PARSERS, node, objectStack);
|
||||||
{}, OPERATIONTYPE_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -613,8 +589,7 @@ function readOperationType(node, objectStack) {
|
|||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readSizedFormatOnlineresource(node, objectStack) {
|
function readSizedFormatOnlineresource(node, objectStack) {
|
||||||
const formatOnlineresource =
|
const formatOnlineresource = readFormatOnlineresource(node, objectStack);
|
||||||
readFormatOnlineresource(node, objectStack);
|
|
||||||
if (formatOnlineresource) {
|
if (formatOnlineresource) {
|
||||||
const size = [
|
const size = [
|
||||||
XSD.readNonNegativeIntegerString(node.getAttribute('width')),
|
XSD.readNonNegativeIntegerString(node.getAttribute('width')),
|
||||||
@@ -633,8 +608,7 @@ function readSizedFormatOnlineresource(node, objectStack) {
|
|||||||
* @return {Object|undefined} Authority URL object.
|
* @return {Object|undefined} Authority URL object.
|
||||||
*/
|
*/
|
||||||
function readAuthorityURL(node, objectStack) {
|
function readAuthorityURL(node, objectStack) {
|
||||||
const authorityObject =
|
const authorityObject = readFormatOnlineresource(node, objectStack);
|
||||||
readFormatOnlineresource(node, objectStack);
|
|
||||||
if (authorityObject) {
|
if (authorityObject) {
|
||||||
authorityObject['name'] = node.getAttribute('name');
|
authorityObject['name'] = node.getAttribute('name');
|
||||||
return authorityObject;
|
return authorityObject;
|
||||||
@@ -649,8 +623,7 @@ function readAuthorityURL(node, objectStack) {
|
|||||||
* @return {Object|undefined} Metadata URL object.
|
* @return {Object|undefined} Metadata URL object.
|
||||||
*/
|
*/
|
||||||
function readMetadataURL(node, objectStack) {
|
function readMetadataURL(node, objectStack) {
|
||||||
const metadataObject =
|
const metadataObject = readFormatOnlineresource(node, objectStack);
|
||||||
readFormatOnlineresource(node, objectStack);
|
|
||||||
if (metadataObject) {
|
if (metadataObject) {
|
||||||
metadataObject['type'] = node.getAttribute('type');
|
metadataObject['type'] = node.getAttribute('type');
|
||||||
return metadataObject;
|
return metadataObject;
|
||||||
@@ -665,8 +638,7 @@ function readMetadataURL(node, objectStack) {
|
|||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop({}, STYLE_PARSERS, node, objectStack);
|
||||||
{}, STYLE_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -676,8 +648,7 @@ function readStyle(node, objectStack) {
|
|||||||
* @return {Array.<string>|undefined} Keyword list.
|
* @return {Array.<string>|undefined} Keyword list.
|
||||||
*/
|
*/
|
||||||
function readKeywordList(node, objectStack) {
|
function readKeywordList(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
||||||
[], KEYWORDLIST_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -227,8 +227,7 @@ WMTSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
WMTSCapabilityObject['version'] = version;
|
WMTSCapabilityObject['version'] = version;
|
||||||
WMTSCapabilityObject = pushParseAndPop(WMTSCapabilityObject,
|
WMTSCapabilityObject = pushParseAndPop(WMTSCapabilityObject, PARSERS, node, []);
|
||||||
PARSERS, node, []);
|
|
||||||
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -239,8 +238,7 @@ WMTSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readContents(node, objectStack) {
|
function readContents(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, CONTENTS_PARSERS, node, objectStack);
|
||||||
CONTENTS_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -250,8 +248,7 @@ function readContents(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layers object.
|
* @return {Object|undefined} Layers object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
||||||
LAYER_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -261,8 +258,7 @@ function readLayer(node, objectStack) {
|
|||||||
* @return {Object|undefined} Tile Matrix Set object.
|
* @return {Object|undefined} Tile Matrix Set object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSet(node, objectStack) {
|
function readTileMatrixSet(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, TMS_PARSERS, node, objectStack);
|
||||||
TMS_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -272,8 +268,7 @@ function readTileMatrixSet(node, objectStack) {
|
|||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
const style = pushParseAndPop({},
|
const style = pushParseAndPop({}, STYLE_PARSERS, node, objectStack);
|
||||||
STYLE_PARSERS, node, objectStack);
|
|
||||||
if (!style) {
|
if (!style) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -289,10 +284,8 @@ function readStyle(node, objectStack) {
|
|||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSetLink(node,
|
function readTileMatrixSetLink(node, objectStack) {
|
||||||
objectStack) {
|
return pushParseAndPop({}, TMS_LINKS_PARSERS, node, objectStack);
|
||||||
return pushParseAndPop({},
|
|
||||||
TMS_LINKS_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -302,8 +295,7 @@ function readTileMatrixSetLink(node,
|
|||||||
* @return {Object|undefined} Dimension object.
|
* @return {Object|undefined} Dimension object.
|
||||||
*/
|
*/
|
||||||
function readDimensions(node, objectStack) {
|
function readDimensions(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, DIMENSION_PARSERS, node, objectStack);
|
||||||
DIMENSION_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -336,8 +328,7 @@ function readResourceUrl(node, objectStack) {
|
|||||||
* @return {Object|undefined} WGS84 BBox object.
|
* @return {Object|undefined} WGS84 BBox object.
|
||||||
*/
|
*/
|
||||||
function readWgs84BoundingBox(node, objectStack) {
|
function readWgs84BoundingBox(node, objectStack) {
|
||||||
const coordinates = pushParseAndPop([],
|
const coordinates = pushParseAndPop([], WGS84_BBOX_READERS, node, objectStack);
|
||||||
WGS84_BBOX_READERS, node, objectStack);
|
|
||||||
if (coordinates.length != 2) {
|
if (coordinates.length != 2) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -383,8 +374,7 @@ function readCoordinates(node, objectStack) {
|
|||||||
* @return {Object|undefined} TileMatrix object.
|
* @return {Object|undefined} TileMatrix object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrix(node, objectStack) {
|
function readTileMatrix(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, TM_PARSERS, node, objectStack);
|
||||||
TM_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -393,11 +383,8 @@ function readTileMatrix(node, objectStack) {
|
|||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrixSetLimits Object.
|
* @return {Object|undefined} TileMatrixSetLimits Object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimitsList(node,
|
function readTileMatrixLimitsList(node, objectStack) {
|
||||||
objectStack) {
|
return pushParseAndPop([], TMS_LIMITS_LIST_PARSERS, node, objectStack);
|
||||||
return pushParseAndPop([],
|
|
||||||
TMS_LIMITS_LIST_PARSERS, node,
|
|
||||||
objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -407,8 +394,7 @@ function readTileMatrixLimitsList(node,
|
|||||||
* @return {Object|undefined} TileMatrixLimits Array.
|
* @return {Object|undefined} TileMatrixLimits Array.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimits(node, objectStack) {
|
function readTileMatrixLimits(node, objectStack) {
|
||||||
return pushParseAndPop({},
|
return pushParseAndPop({}, TMS_LIMITS_PARSERS, node, objectStack);
|
||||||
TMS_LIMITS_PARSERS, node, objectStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user