Remove ol.DEBUG

This commit is contained in:
Tim Schaub
2016-12-29 09:09:24 -07:00
parent 7b9690a691
commit 137cdc04c8
128 changed files with 309 additions and 2027 deletions

View File

@@ -144,8 +144,6 @@ ol.format.EsriJSON.convertRings_ = function(rings, layout) {
* @return {ol.geom.Geometry} Point.
*/
ol.format.EsriJSON.readPointGeometry_ = function(object) {
ol.DEBUG && console.assert(typeof object.x === 'number', 'object.x should be number');
ol.DEBUG && console.assert(typeof object.y === 'number', 'object.y should be number');
var point;
if (object.m !== undefined && object.z !== undefined) {
point = new ol.geom.Point([object.x, object.y, object.z, object.m],
@@ -169,10 +167,6 @@ ol.format.EsriJSON.readPointGeometry_ = function(object) {
* @return {ol.geom.Geometry} LineString.
*/
ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
ol.DEBUG && console.assert(Array.isArray(object.paths),
'object.paths should be an array');
ol.DEBUG && console.assert(object.paths.length === 1,
'object.paths array length should be 1');
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
return new ol.geom.LineString(object.paths[0], layout);
};
@@ -184,10 +178,6 @@ ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
* @return {ol.geom.Geometry} MultiLineString.
*/
ol.format.EsriJSON.readMultiLineStringGeometry_ = function(object) {
ol.DEBUG && console.assert(Array.isArray(object.paths),
'object.paths should be an array');
ol.DEBUG && console.assert(object.paths.length > 1,
'object.paths array length should be more than 1');
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
return new ol.geom.MultiLineString(object.paths, layout);
};
@@ -228,8 +218,6 @@ ol.format.EsriJSON.readMultiPointGeometry_ = function(object) {
* @return {ol.geom.Geometry} MultiPolygon.
*/
ol.format.EsriJSON.readMultiPolygonGeometry_ = function(object) {
ol.DEBUG && console.assert(object.rings.length > 1,
'object.rings should have length larger than 1');
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
return new ol.geom.MultiPolygon(
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
@@ -243,7 +231,6 @@ ol.format.EsriJSON.readMultiPolygonGeometry_ = function(object) {
* @return {ol.geom.Geometry} Polygon.
*/
ol.format.EsriJSON.readPolygonGeometry_ = function(object) {
ol.DEBUG && console.assert(object.rings);
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
return new ol.geom.Polygon(object.rings, layout);
};
@@ -469,9 +456,6 @@ ol.format.EsriJSON.prototype.readFeatures;
ol.format.EsriJSON.prototype.readFeatureFromObject = function(
object, opt_options) {
var esriJSONFeature = /** @type {EsriJSONFeature} */ (object);
ol.DEBUG && console.assert(esriJSONFeature.geometry ||
esriJSONFeature.attributes,
'geometry or attributes should be defined');
var geometry = ol.format.EsriJSON.readGeometry_(esriJSONFeature.geometry,
opt_options);
var feature = new ol.Feature();
@@ -481,9 +465,6 @@ ol.format.EsriJSON.prototype.readFeatureFromObject = function(
feature.setGeometry(geometry);
if (opt_options && opt_options.idField &&
esriJSONFeature.attributes[opt_options.idField]) {
ol.DEBUG && console.assert(
typeof esriJSONFeature.attributes[opt_options.idField] === 'number',
'objectIdFieldName value should be a number');
feature.setId(/** @type {number} */(
esriJSONFeature.attributes[opt_options.idField]));
}

View File

@@ -90,8 +90,6 @@ ol.format.GeoJSON.readGeometry_ = function(object, opt_options) {
*/
ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
object, opt_options) {
ol.DEBUG && console.assert(object.type == 'GeometryCollection',
'object.type should be GeometryCollection');
var geometries = object.geometries.map(
/**
* @param {GeoJSONGeometry} geometry Geometry.
@@ -110,8 +108,6 @@ ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
* @return {ol.geom.Point} Point.
*/
ol.format.GeoJSON.readPointGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'Point',
'object.type should be Point');
return new ol.geom.Point(object.coordinates);
};
@@ -122,8 +118,6 @@ ol.format.GeoJSON.readPointGeometry_ = function(object) {
* @return {ol.geom.LineString} LineString.
*/
ol.format.GeoJSON.readLineStringGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'LineString',
'object.type should be LineString');
return new ol.geom.LineString(object.coordinates);
};
@@ -134,8 +128,6 @@ ol.format.GeoJSON.readLineStringGeometry_ = function(object) {
* @return {ol.geom.MultiLineString} MultiLineString.
*/
ol.format.GeoJSON.readMultiLineStringGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'MultiLineString',
'object.type should be MultiLineString');
return new ol.geom.MultiLineString(object.coordinates);
};
@@ -146,8 +138,6 @@ ol.format.GeoJSON.readMultiLineStringGeometry_ = function(object) {
* @return {ol.geom.MultiPoint} MultiPoint.
*/
ol.format.GeoJSON.readMultiPointGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'MultiPoint',
'object.type should be MultiPoint');
return new ol.geom.MultiPoint(object.coordinates);
};
@@ -158,8 +148,6 @@ ol.format.GeoJSON.readMultiPointGeometry_ = function(object) {
* @return {ol.geom.MultiPolygon} MultiPolygon.
*/
ol.format.GeoJSON.readMultiPolygonGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'MultiPolygon',
'object.type should be MultiPolygon');
return new ol.geom.MultiPolygon(object.coordinates);
};
@@ -170,8 +158,6 @@ ol.format.GeoJSON.readMultiPolygonGeometry_ = function(object) {
* @return {ol.geom.Polygon} Polygon.
*/
ol.format.GeoJSON.readPolygonGeometry_ = function(object) {
ol.DEBUG && console.assert(object.type == 'Polygon',
'object.type should be Polygon');
return new ol.geom.Polygon(object.coordinates);
};
@@ -389,9 +375,6 @@ ol.format.GeoJSON.prototype.readFeatures;
*/
ol.format.GeoJSON.prototype.readFeatureFromObject = function(
object, opt_options) {
ol.DEBUG && console.assert(object.type !== 'FeatureCollection', 'Expected a Feature or geometry');
/**
* @type {GeoJSONFeature}
*/

View File

@@ -100,9 +100,6 @@ ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Box', 'localName should be Box');
/** @type {Array.<number>} */
var flatCoordinates = ol.xml.pushParseAndPop([null],
this.BOX_PARSERS_, node, objectStack, this);
@@ -118,20 +115,12 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length larger than 0');
flatLinearRings.push(flatLinearRing);
}
};
@@ -143,20 +132,12 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length larger than 0');
flatLinearRings[0] = flatLinearRing;
}
};

View File

@@ -88,10 +88,6 @@ ol.format.GML3.schemaLocation_ = ol.format.GMLBase.GMLNS +
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiCurve',
'localName should be MultiCurve');
/** @type {Array.<ol.geom.LineString>} */
var lineStrings = ol.xml.pushParseAndPop([],
this.MULTICURVE_PARSERS_, node, objectStack, this);
@@ -112,10 +108,6 @@ ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiSurface',
'localName should be MultiSurface');
/** @type {Array.<ol.geom.Polygon>} */
var polygons = ol.xml.pushParseAndPop([],
this.MULTISURFACE_PARSERS_, node, objectStack, this);
@@ -135,11 +127,6 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'curveMember' ||
node.localName == 'curveMembers',
'localName should be curveMember or curveMembers');
ol.xml.parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
};
@@ -150,11 +137,6 @@ ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'surfaceMember' ||
node.localName == 'surfaceMembers',
'localName should be surfaceMember or surfaceMembers');
ol.xml.parseNode(this.SURFACEMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -167,10 +149,6 @@ ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'patches',
'localName should be patches');
return ol.xml.pushParseAndPop([null],
this.PATCHES_PARSERS_, node, objectStack, this);
};
@@ -183,10 +161,6 @@ ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'segments',
'localName should be segments');
return ol.xml.pushParseAndPop([null],
this.SEGMENTS_PARSERS_, node, objectStack, this);
};
@@ -199,10 +173,6 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'npde.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'PolygonPatch',
'localName should be PolygonPatch');
return ol.xml.pushParseAndPop([null],
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
};
@@ -215,10 +185,6 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LineStringSegment',
'localName should be LineStringSegment');
return ol.xml.pushParseAndPop([null],
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
node, objectStack, this);
@@ -231,20 +197,12 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'interior',
'localName should be interior');
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length of 1 or more');
flatLinearRings.push(flatLinearRing);
}
};
@@ -256,20 +214,12 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'exterior',
'localName should be exterior');
/** @type {Array.<number>|undefined} */
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
this.RING_PARSERS, node, objectStack, this);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length of 1 or more');
flatLinearRings[0] = flatLinearRing;
}
};
@@ -282,10 +232,6 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Surface',
'localName should be Surface');
/** @type {Array.<Array.<number>>} */
var flatLinearRings = ol.xml.pushParseAndPop([null],
this.SURFACE_PARSERS_, node, objectStack, this);
@@ -314,9 +260,6 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Curve', 'localName should be Curve');
/** @type {Array.<number>} */
var flatCoordinates = ol.xml.pushParseAndPop([null],
this.CURVE_PARSERS_, node, objectStack, this);
@@ -337,10 +280,6 @@ ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Envelope',
'localName should be Envelope');
/** @type {Array.<number>} */
var flatCoordinates = ol.xml.pushParseAndPop([null],
this.ENVELOPE_PARSERS_, node, objectStack, this);
@@ -718,7 +657,6 @@ ol.format.GML3.ENVELOPE_SERIALIZERS_ = {
* @param {Array.<*>} objectStack Node stack.
*/
ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
ol.DEBUG && console.assert(extent.length == 4, 'extent should have 4 items');
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
@@ -1179,8 +1117,6 @@ ol.format.GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
*/
ol.format.GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be a node');
return ol.xml.createElementNS('http://www.opengis.net/gml',
ol.format.GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
};
@@ -1200,9 +1136,6 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o
var surface = context['surface'];
var curve = context['curve'];
var multiCurve = context['multiCurve'];
var parentNode = objectStack[objectStack.length - 1].node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be a node');
var nodeName;
if (!Array.isArray(value)) {
nodeName = /** @type {ol.geom.Geometry} */ (value).getType();

View File

@@ -107,8 +107,6 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
* @return {Array.<ol.Feature> | undefined} Features.
*/
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var localName = node.localName;
var features = null;
if (localName == 'FeatureCollection') {
@@ -259,15 +257,10 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point');
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var point = new ol.geom.Point(null);
ol.DEBUG && console.assert(flatCoordinates.length == 3,
'flatCoordinates should have a length of 3');
point.setFlatCoordinates(ol.geom.GeometryLayout.XYZ, flatCoordinates);
return point;
}
@@ -280,10 +273,6 @@ ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
*/
ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiPoint',
'localName should be MultiPoint');
/** @type {Array.<Array.<number>>} */
var coordinates = ol.xml.pushParseAndPop([],
this.MULTIPOINT_PARSERS_, node, objectStack, this);
@@ -301,10 +290,6 @@ ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiLineString',
'localName should be MultiLineString');
/** @type {Array.<ol.geom.LineString>} */
var lineStrings = ol.xml.pushParseAndPop([],
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
@@ -324,10 +309,6 @@ ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiPolygon',
'localName should be MultiPolygon');
/** @type {Array.<ol.geom.Polygon>} */
var polygons = ol.xml.pushParseAndPop([],
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
@@ -347,11 +328,6 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'pointMember' ||
node.localName == 'pointMembers',
'localName should be pointMember or pointMembers');
ol.xml.parseNode(this.POINTMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -363,11 +339,6 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'lineStringMember' ||
node.localName == 'lineStringMembers',
'localName should be LineStringMember or LineStringMembers');
ol.xml.parseNode(this.LINESTRINGMEMBER_PARSERS_,
node, objectStack, this);
};
@@ -379,11 +350,6 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack
* @private
*/
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'polygonMember' ||
node.localName == 'polygonMembers',
'localName should be polygonMember or polygonMembers');
ol.xml.parseNode(this.POLYGONMEMBER_PARSERS_, node,
objectStack, this);
};
@@ -395,10 +361,6 @@ ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LineString',
'localName should be LineString');
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
@@ -418,10 +380,6 @@ ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
* @return {Array.<number>|undefined} LinearRing flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
var ring = ol.xml.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
objectStack, this);
@@ -439,10 +397,6 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
* @return {ol.geom.LinearRing|undefined} LinearRing.
*/
ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
@@ -461,10 +415,6 @@ ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Polygon',
'localName should be Polygon');
/** @type {Array.<Array.<number>>} */
var flatLinearRings = ol.xml.pushParseAndPop([null],
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
@@ -493,8 +443,6 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
objectStack, this);

View File

@@ -73,8 +73,6 @@ ol.format.GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
flatCoordinates.push(
parseFloat(node.getAttribute('lon')),
parseFloat(node.getAttribute('lat')));
@@ -147,9 +145,6 @@ ol.format.GPX.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, end
* @private
*/
ol.format.GPX.parseLink_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'link', 'localName should be link');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var href = node.getAttribute('href');
if (href !== null) {
@@ -165,10 +160,6 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'extensions',
'localName should be extensions');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values['extensionsNode_'] = node;
};
@@ -180,9 +171,6 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'rtept', 'localName should be rtept');
var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.RTEPT_PARSERS_, node, objectStack);
if (values) {
@@ -202,9 +190,6 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'trkpt', 'localName should be trkpt');
var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.TRKPT_PARSERS_, node, objectStack);
if (values) {
@@ -224,10 +209,6 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'trkseg',
'localName should be trkseg');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
ol.xml.parseNode(ol.format.GPX.TRKSEG_PARSERS_, node, objectStack);
var flatCoordinates = /** @type {Array.<number>} */
@@ -244,9 +225,6 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readRte_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'rte', 'localName should be rte');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop({
'flatCoordinates': [],
@@ -277,9 +255,6 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readTrk_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'trk', 'localName should be trk');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop({
'flatCoordinates': [],
@@ -313,9 +288,6 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Waypoint.
*/
ol.format.GPX.readWpt_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'wpt', 'localName should be wpt');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.WPT_PARSERS_, node, objectStack);
@@ -516,8 +488,6 @@ ol.format.GPX.prototype.readFeature;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
}
@@ -552,8 +522,6 @@ ol.format.GPX.prototype.readFeatures;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
}
@@ -612,8 +580,6 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
var context = objectStack[objectStack.length - 1];
var parentNode = context.node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
var namespaceURI = parentNode.namespaceURI;
var properties = context['properties'];
//FIXME Projection handling
@@ -919,8 +885,6 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var nodeName = ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
if (nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, nodeName);
}
}

View File

@@ -143,7 +143,6 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
} else if (altitudeMode == ol.format.IGCZ.BAROMETRIC) {
z = parseInt(m[12], 10);
} else {
ol.DEBUG && console.assert(false, 'Unknown altitude mode.');
z = 0;
}
flatCoordinates.push(z);

View File

@@ -17,7 +17,6 @@ goog.require('ol.geom.GeometryCollection');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.LineString');
goog.require('ol.geom.LinearRing');
goog.require('ol.geom.MultiLineString');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.MultiPolygon');
@@ -548,10 +547,6 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
* @private
*/
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be an ELEMENT');
ol.DEBUG && console.assert(node.localName == 'IconStyle',
'localName should be IconStyle');
// FIXME refreshMode
// FIXME refreshInterval
// FIXME viewRefreshTime
@@ -654,10 +649,6 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LabelStyle',
'localName should be LabelStyle');
// FIXME colorMode
var object = ol.xml.pushParseAndPop(
{}, ol.format.KML.LABEL_STYLE_PARSERS_, node, objectStack);
@@ -683,10 +674,6 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LineStyle',
'localName should be LineStyle');
// FIXME colorMode
// FIXME gx:outerColor
// FIXME gx:outerWidth
@@ -713,10 +700,6 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'PolyStyle',
'localName should be PolyStyle');
// FIXME colorMode
var object = ol.xml.pushParseAndPop(
{}, ol.format.KML.POLY_STYLE_PARSERS_, node, objectStack);
@@ -748,10 +731,6 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
* @return {Array.<number>} LinearRing flat coordinates.
*/
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
return ol.xml.pushParseAndPop(null,
ol.format.KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
};
@@ -763,12 +742,6 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
* @private
*/
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser');
ol.DEBUG && console.assert(node.localName == 'coord', 'localName should be coord');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]);
var flatCoordinates = gxTrackObject.flatCoordinates;
@@ -794,13 +767,6 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser');
ol.DEBUG && console.assert(node.localName == 'MultiTrack',
'localName should be MultiTrack');
var lineStrings = ol.xml.pushParseAndPop([],
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
if (!lineStrings) {
@@ -819,12 +785,6 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readGxTrack_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser');
ol.DEBUG && console.assert(node.localName == 'Track', 'localName should be Track');
var gxTrackObject = ol.xml.pushParseAndPop(
/** @type {ol.KMLGxTrackObject_} */ ({
flatCoordinates: [],
@@ -835,9 +795,6 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
}
var flatCoordinates = gxTrackObject.flatCoordinates;
var whens = gxTrackObject.whens;
ol.DEBUG && console.assert(flatCoordinates.length / 4 == whens.length,
'the length of the flatCoordinates array divided by 4 should be the ' +
'length of the whens array');
var i, ii;
for (i = 0, ii = Math.min(flatCoordinates.length, whens.length); i < ii;
++i) {
@@ -856,9 +813,6 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
* @return {Object} Icon object.
*/
ol.format.KML.readIcon_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Icon', 'localName should be Icon');
var iconObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.ICON_PARSERS_, node, objectStack);
if (iconObject) {
@@ -876,8 +830,6 @@ ol.format.KML.readIcon_ = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
};
@@ -890,10 +842,6 @@ ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readLineString_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LineString',
'localName should be LineString');
var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
@@ -917,10 +865,6 @@ ol.format.KML.readLineString_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readLinearRing_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
@@ -945,10 +889,6 @@ ol.format.KML.readLinearRing_ = function(node, objectStack) {
* @return {ol.geom.Geometry} Geometry.
*/
ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MultiGeometry',
'localName should be MultiGeometry');
var geometries = ol.xml.pushParseAndPop([],
ol.format.KML.MULTI_GEOMETRY_PARSERS_, node, objectStack);
if (!geometries) {
@@ -978,8 +918,6 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
flatCoordinates = point.getFlatCoordinates();
for (i = 1, ii = geometries.length; i < ii; ++i) {
geometry = geometries[i];
ol.DEBUG && console.assert(geometry.getLayout() == layout,
'geometry layout should be consistent');
ol.array.extend(flatCoordinates, geometry.getFlatCoordinates());
}
multiGeometry = new ol.geom.MultiPoint(null);
@@ -1012,9 +950,6 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.KML.readPoint_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point');
var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
@@ -1022,8 +957,6 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
ol.format.KML.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var point = new ol.geom.Point(null);
ol.DEBUG && console.assert(flatCoordinates.length == 3,
'flatCoordinates should have a length of 3');
point.setFlatCoordinates(ol.geom.GeometryLayout.XYZ, flatCoordinates);
point.setProperties(properties);
return point;
@@ -1040,10 +973,6 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readPolygon_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Polygon',
'localName should be Polygon');
var properties = ol.xml.pushParseAndPop(/** @type {Object<string,*>} */ ({}),
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack);
@@ -1075,9 +1004,6 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
* @return {Array.<ol.style.Style>} Style.
*/
ol.format.KML.readStyle_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
var styleObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.STYLE_PARSERS_, node, objectStack);
if (!styleObject) {
@@ -1154,9 +1080,6 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
* @private
*/
ol.format.KML.DataParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Data', 'localName should be Data');
var name = node.getAttribute('name');
ol.xml.parseNode(ol.format.KML.DATA_PARSERS_, node, objectStack);
var featureObject =
@@ -1175,10 +1098,6 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ExtendedData',
'localName should be ExtendedData');
ol.xml.parseNode(ol.format.KML.EXTENDED_DATA_PARSERS_, node, objectStack);
};
@@ -1188,10 +1107,6 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.RegionParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Region',
'localName should be Region');
ol.xml.parseNode(ol.format.KML.REGION_PARSERS_, node, objectStack);
};
@@ -1201,9 +1116,6 @@ ol.format.KML.RegionParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PairDataParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Pair', 'localName should be Pair');
var pairObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.PAIR_PARSERS_, node, objectStack);
if (!pairObject) {
@@ -1232,10 +1144,6 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
var styleMapValue = ol.format.KML.readStyleMapValue_(node, objectStack);
if (!styleMapValue) {
return;
@@ -1257,10 +1165,6 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'SchemaData',
'localName should be SchemaData');
ol.xml.parseNode(ol.format.KML.SCHEMA_DATA_PARSERS_, node, objectStack);
};
@@ -1271,10 +1175,6 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'SimpleData',
'localName should be SimpleData');
var name = node.getAttribute('name');
if (name !== null) {
var data = ol.format.XSD.readString(node);
@@ -1291,10 +1191,6 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LatLonAltBoxParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'LatLonAltBox',
'localName should be LatLonAltBox');
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LAT_LON_ALT_BOX_PARSERS_, node, objectStack);
if (!object) {
return;
@@ -1319,10 +1215,6 @@ ol.format.KML.LatLonAltBoxParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LodParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Lod',
'localName should be Lod');
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LOD_PARSERS_, node, objectStack);
if (!object) {
return;
@@ -1341,20 +1233,12 @@ ol.format.KML.LodParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_, node, objectStack);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty');
flatLinearRings.push(flatLinearRing);
}
};
@@ -1366,20 +1250,12 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
/** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_, node, objectStack);
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty');
flatLinearRings[0] = flatLinearRing;
}
};
@@ -1391,9 +1267,6 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LinkParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Link', 'localName should be Link');
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
};
@@ -1404,9 +1277,6 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.whenParser_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'when', 'localName should be when');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]);
var whens = gxTrackObject.whens;
@@ -1791,11 +1661,6 @@ ol.format.KML.prototype.getExtensions = function() {
* @return {Array.<ol.Feature>|undefined} Features.
*/
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var localName = node.localName;
ol.DEBUG && console.assert(localName == 'Document' || localName == 'Folder',
'localName should be Document or Folder');
// FIXME use scope somehow
var parsersNS = ol.xml.makeStructureNS(
ol.format.KML.NAMESPACE_URIS_, {
@@ -1822,10 +1687,6 @@ ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Feature.
*/
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Placemark',
'localName should be Placemark');
var object = ol.xml.pushParseAndPop({'geometry': null},
ol.format.KML.PLACEMARK_PARSERS_, node, objectStack);
if (!object) {
@@ -1869,9 +1730,6 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
var id = node.getAttribute('id');
if (id !== null) {
var style = ol.format.KML.readStyle_(node, objectStack);
@@ -1895,10 +1753,6 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
var id = node.getAttribute('id');
if (id === null) {
return;
@@ -1936,13 +1790,9 @@ ol.format.KML.prototype.readFeature;
* @inheritDoc
*/
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
}
ol.DEBUG && console.assert(node.localName == 'Placemark',
'localName should be Placemark');
var feature = this.readPlacemark_(
node, [this.getReadOptions(node, opt_options)]);
if (feature) {
@@ -1971,8 +1821,6 @@ ol.format.KML.prototype.readFeatures;
* @inheritDoc
*/
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
}
@@ -2614,12 +2462,6 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
* @private
*/
ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
ol.DEBUG && console.assert(
(geometry instanceof ol.geom.Point) ||
(geometry instanceof ol.geom.LineString) ||
(geometry instanceof ol.geom.LinearRing),
'geometry should be one of ol.geom.Point, ol.geom.LineString ' +
'or ol.geom.LinearRing');
var flatCoordinates = geometry.getFlatCoordinates();
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
context['layout'] = geometry.getLayout();
@@ -2639,8 +2481,6 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
*/
ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
var linearRings = polygon.getLinearRings();
ol.DEBUG && console.assert(linearRings.length > 0,
'linearRings should not be empty');
var outerRing = linearRings.shift();
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
// inner rings
@@ -3053,8 +2893,6 @@ ol.format.KML.GX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
ol.format.KML.DOCUMENT_NODE_FACTORY_ = function(value, objectStack,
opt_nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, 'Placemark');
};
@@ -3071,8 +2909,6 @@ ol.format.KML.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
opt_nodeName) {
if (value) {
var parentNode = objectStack[objectStack.length - 1].node;
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI,
ol.format.KML.GEOMETRY_TYPE_TO_NODENAME_[/** @type {ol.geom.Geometry} */ (value).getType()]);
}

View File

@@ -57,9 +57,6 @@ ol.format.OSMXML.prototype.getExtensions = function() {
* @private
*/
ol.format.OSMXML.readNode_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'node', 'localName should be node');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var id = node.getAttribute('id');
@@ -90,9 +87,6 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
* @private
*/
ol.format.OSMXML.readWay_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'way', 'localName should be way');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var id = node.getAttribute('id');
var values = ol.xml.pushParseAndPop({
@@ -130,9 +124,6 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
* @private
*/
ol.format.OSMXML.readNd_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'nd', 'localName should be nd');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values.ndrefs.push(node.getAttribute('ref'));
};
@@ -144,9 +135,6 @@ ol.format.OSMXML.readNd_ = function(node, objectStack) {
* @private
*/
ol.format.OSMXML.readTag_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'tag', 'localName should be tag');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values.tags[node.getAttribute('k')] = node.getAttribute('v');
};
@@ -213,8 +201,6 @@ ol.format.OSMXML.prototype.readFeatures;
* @inheritDoc
*/
ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var options = this.getReadOptions(node, opt_options);
if (node.localName == 'osm') {
var state = ol.xml.pushParseAndPop({

View File

@@ -22,8 +22,6 @@ ol.inherits(ol.format.OWS, ol.format.XML);
* @return {Object} OWS object.
*/
ol.format.OWS.prototype.readFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(n);
@@ -38,8 +36,6 @@ ol.format.OWS.prototype.readFromDocument = function(doc) {
* @return {Object} OWS object.
*/
ol.format.OWS.prototype.readFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var owsObject = ol.xml.pushParseAndPop({},
ol.format.OWS.PARSERS_, node, []);
return owsObject ? owsObject : null;
@@ -53,10 +49,6 @@ ol.format.OWS.prototype.readFromNode = function(node) {
* @return {Object|undefined} The address.
*/
ol.format.OWS.readAddress_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Address',
'localName should be Address');
return ol.xml.pushParseAndPop({},
ol.format.OWS.ADDRESS_PARSERS_, node, objectStack);
};
@@ -69,10 +61,6 @@ ol.format.OWS.readAddress_ = function(node, objectStack) {
* @return {Object|undefined} The values.
*/
ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'AllowedValues',
'localName should be AllowedValues');
return ol.xml.pushParseAndPop({},
ol.format.OWS.ALLOWED_VALUES_PARSERS_, node, objectStack);
};
@@ -85,10 +73,6 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
* @return {Object|undefined} The constraint.
*/
ol.format.OWS.readConstraint_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Constraint',
'localName should be Constraint');
var name = node.getAttribute('name');
if (!name) {
return undefined;
@@ -106,10 +90,6 @@ ol.format.OWS.readConstraint_ = function(node, objectStack) {
* @return {Object|undefined} The contact info.
*/
ol.format.OWS.readContactInfo_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ContactInfo',
'localName should be ContactInfo');
return ol.xml.pushParseAndPop({},
ol.format.OWS.CONTACT_INFO_PARSERS_, node, objectStack);
};
@@ -122,9 +102,6 @@ ol.format.OWS.readContactInfo_ = function(node, objectStack) {
* @return {Object|undefined} The DCP.
*/
ol.format.OWS.readDcp_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'DCP', 'localName should be DCP');
return ol.xml.pushParseAndPop({},
ol.format.OWS.DCP_PARSERS_, node, objectStack);
};
@@ -137,9 +114,6 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
* @return {Object|undefined} The GET object.
*/
ol.format.OWS.readGet_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Get', 'localName should be Get');
var href = ol.format.XLink.readHref(node);
if (!href) {
return undefined;
@@ -156,9 +130,6 @@ ol.format.OWS.readGet_ = function(node, objectStack) {
* @return {Object|undefined} The HTTP object.
*/
ol.format.OWS.readHttp_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP');
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
node, objectStack);
};
@@ -171,10 +142,6 @@ ol.format.OWS.readHttp_ = function(node, objectStack) {
* @return {Object|undefined} The operation.
*/
ol.format.OWS.readOperation_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Operation',
'localName should be Operation');
var name = node.getAttribute('name');
var value = ol.xml.pushParseAndPop({},
ol.format.OWS.OPERATION_PARSERS_, node, objectStack);
@@ -184,7 +151,6 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
var object = /** @type {Object} */
(objectStack[objectStack.length - 1]);
object[name] = value;
};
@@ -196,10 +162,6 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
*/
ol.format.OWS.readOperationsMetadata_ = function(node,
objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'OperationsMetadata',
'localName should be OperationsMetadata');
return ol.xml.pushParseAndPop({},
ol.format.OWS.OPERATIONS_METADATA_PARSERS_, node,
objectStack);
@@ -213,9 +175,6 @@ ol.format.OWS.readOperationsMetadata_ = function(node,
* @return {Object|undefined} The phone.
*/
ol.format.OWS.readPhone_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Phone', 'localName should be Phone');
return ol.xml.pushParseAndPop({},
ol.format.OWS.PHONE_PARSERS_, node, objectStack);
};
@@ -229,10 +188,6 @@ ol.format.OWS.readPhone_ = function(node, objectStack) {
*/
ol.format.OWS.readServiceIdentification_ = function(node,
objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ServiceIdentification',
'localName should be ServiceIdentification');
return ol.xml.pushParseAndPop(
{}, ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_, node,
objectStack);
@@ -246,10 +201,6 @@ ol.format.OWS.readServiceIdentification_ = function(node,
* @return {Object|undefined} The service contact.
*/
ol.format.OWS.readServiceContact_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ServiceContact',
'localName should be ServiceContact');
return ol.xml.pushParseAndPop(
{}, ol.format.OWS.SERVICE_CONTACT_PARSERS_, node,
objectStack);
@@ -263,10 +214,6 @@ ol.format.OWS.readServiceContact_ = function(node, objectStack) {
* @return {Object|undefined} The service provider.
*/
ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ServiceProvider',
'localName should be ServiceProvider');
return ol.xml.pushParseAndPop(
{}, ol.format.OWS.SERVICE_PROVIDER_PARSERS_, node,
objectStack);
@@ -280,9 +227,6 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
* @return {string|undefined} The value.
*/
ol.format.OWS.readValue_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Value', 'localName should be Value');
return ol.format.XSD.readString(node);
};

View File

@@ -367,8 +367,6 @@ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) {
* @inheritDoc
*/
ol.format.Polyline.prototype.writeFeaturesText = function(features, opt_options) {
ol.DEBUG && console.assert(features.length == 1,
'features array should have 1 item');
return this.writeFeatureText(features[0], opt_options);
};

View File

@@ -184,8 +184,6 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
* FeatureCollection metadata.
*/
ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFeatureCollectionMetadataFromNode(n);
@@ -214,10 +212,6 @@ ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
* FeatureCollection metadata.
*/
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'FeatureCollection',
'localName should be FeatureCollection');
var result = {};
var value = ol.format.XSD.readNonNegativeIntegerString(
node.getAttribute('numberOfFeatures'));
@@ -325,8 +319,6 @@ ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_ = {
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
*/
ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readTransactionResponseFromNode(n);
@@ -341,10 +333,6 @@ ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
*/
ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'TransactionResponse',
'localName should be TransactionResponse');
return ol.xml.pushParseAndPop(
/** @type {ol.WFSTransactionResponse} */({}),
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
@@ -935,8 +923,6 @@ ol.format.WFS.prototype.readProjection;
* @inheritDoc
*/
ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be a DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readProjectionFromNode(n);
@@ -950,11 +936,6 @@ ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
* @inheritDoc
*/
ol.format.WFS.prototype.readProjectionFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'FeatureCollection',
'localName should be FeatureCollection');
if (node.firstElementChild &&
node.firstElementChild.firstElementChild) {
node = node.firstElementChild.firstElementChild;

View File

@@ -205,7 +205,6 @@ ol.format.WKT.encodeGeometryLayout_ = function(geom) {
ol.format.WKT.encode_ = function(geom) {
var type = geom.getType();
var geometryEncoder = ol.format.WKT.GeometryEncoder_[type];
ol.DEBUG && console.assert(geometryEncoder, 'geometryEncoder should be defined');
var enc = geometryEncoder(geom);
type = type.toUpperCase();
if (geom instanceof ol.geom.SimpleGeometry) {
@@ -629,8 +628,6 @@ ol.format.WKT.Parser.prototype.match = function(type) {
ol.format.WKT.Parser.prototype.parse = function() {
this.consume_();
var geometry = this.parseGeometry_();
ol.DEBUG && console.assert(this.token_.type == ol.format.WKT.TokenType_.EOF,
'token type should be end of file');
return geometry;
};

View File

@@ -43,8 +43,6 @@ ol.format.WMSCapabilities.prototype.read;
* @return {Object} WMS Capability object.
*/
ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(n);
@@ -59,11 +57,6 @@ ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
* @return {Object} WMS Capability object.
*/
ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'WMS_Capabilities' ||
node.localName == 'WMT_MS_Capabilities',
'localName should be WMS_Capabilities or WMT_MS_Capabilities');
this.version = node.getAttribute('version').trim();
var wmsCapabilityObject = ol.xml.pushParseAndPop({
'version': this.version
@@ -79,12 +72,8 @@ ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
* @return {Object|undefined} Attribution object.
*/
ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Attribution',
'localName should be Attribution');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
};
@@ -95,11 +84,6 @@ ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
* @return {Object} Bounding box object.
*/
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'BoundingBox',
'localName should be BoundingBox');
var extent = [
ol.format.XSD.readDecimalString(node.getAttribute('minx')),
ol.format.XSD.readDecimalString(node.getAttribute('miny')),
@@ -127,27 +111,23 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Bounding box object.
*/
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'EX_GeographicBoundingBox',
'localName should be EX_GeographicBoundingBox');
var geographicBoundingBox = ol.xml.pushParseAndPop(
{},
ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
node, objectStack);
{},
ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
node, objectStack);
if (!geographicBoundingBox) {
return undefined;
}
var westBoundLongitude = /** @type {number|undefined} */
(geographicBoundingBox['westBoundLongitude']);
(geographicBoundingBox['westBoundLongitude']);
var southBoundLatitude = /** @type {number|undefined} */
(geographicBoundingBox['southBoundLatitude']);
(geographicBoundingBox['southBoundLatitude']);
var eastBoundLongitude = /** @type {number|undefined} */
(geographicBoundingBox['eastBoundLongitude']);
(geographicBoundingBox['eastBoundLongitude']);
var northBoundLatitude = /** @type {number|undefined} */
(geographicBoundingBox['northBoundLatitude']);
(geographicBoundingBox['northBoundLatitude']);
if (westBoundLongitude === undefined || southBoundLatitude === undefined ||
eastBoundLongitude === undefined || northBoundLatitude === undefined) {
eastBoundLongitude === undefined || northBoundLatitude === undefined) {
return undefined;
}
return [
@@ -164,12 +144,8 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectSt
* @return {Object|undefined} Capability object.
*/
ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Capability',
'localName should be Capability');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
};
@@ -180,12 +156,8 @@ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
* @return {Object|undefined} Service object.
*/
ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Service',
'localName should be Service');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
};
@@ -196,13 +168,9 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
* @return {Object|undefined} Contact information object.
*/
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType shpuld be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ContactInformation',
'localName should be ContactInformation');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
node, objectStack);
{}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
node, objectStack);
};
@@ -213,13 +181,9 @@ ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack)
* @return {Object|undefined} Contact person object.
*/
ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ContactPersonPrimary',
'localName should be ContactPersonPrimary');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_,
node, objectStack);
{}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_,
node, objectStack);
};
@@ -230,13 +194,9 @@ ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack
* @return {Object|undefined} Contact address object.
*/
ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'ContactAddress',
'localName should be ContactAddress');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
node, objectStack);
{}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
node, objectStack);
};
@@ -247,12 +207,8 @@ ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
* @return {Array.<string>|undefined} Format array.
*/
ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Exception',
'localName should be Exception');
return ol.xml.pushParseAndPop(
[], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
[], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
};
@@ -263,11 +219,8 @@ ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
* @return {Object|undefined} Layer object.
*/
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
};
@@ -278,27 +231,24 @@ ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
* @return {Object|undefined} Layer object.
*/
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
var parentLayerObject = /** @type {Object.<string,*>} */
(objectStack[objectStack.length - 1]);
(objectStack[objectStack.length - 1]);
var layerObject = ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
if (!layerObject) {
return undefined;
}
var queryable =
ol.format.XSD.readBooleanString(node.getAttribute('queryable'));
ol.format.XSD.readBooleanString(node.getAttribute('queryable'));
if (queryable === undefined) {
queryable = parentLayerObject['queryable'];
}
layerObject['queryable'] = queryable !== undefined ? queryable : false;
var cascaded = ol.format.XSD.readNonNegativeIntegerString(
node.getAttribute('cascaded'));
node.getAttribute('cascaded'));
if (cascaded === undefined) {
cascaded = parentLayerObject['cascaded'];
}
@@ -311,27 +261,27 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
layerObject['opaque'] = opaque !== undefined ? opaque : false;
var noSubsets =
ol.format.XSD.readBooleanString(node.getAttribute('noSubsets'));
ol.format.XSD.readBooleanString(node.getAttribute('noSubsets'));
if (noSubsets === undefined) {
noSubsets = parentLayerObject['noSubsets'];
}
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
var fixedWidth =
ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth'));
ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth'));
if (!fixedWidth) {
fixedWidth = parentLayerObject['fixedWidth'];
}
layerObject['fixedWidth'] = fixedWidth;
var fixedHeight =
ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight'));
ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight'));
if (!fixedHeight) {
fixedHeight = parentLayerObject['fixedHeight'];
}
layerObject['fixedHeight'] = fixedHeight;
// See 7.2.4.8
// See 7.2.4.8
var addKeys = ['Style', 'CRS', 'AuthorityURL'];
addKeys.forEach(function(key) {
if (key in parentLayerObject) {
@@ -360,19 +310,15 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
* @return {Object} Dimension object.
*/
ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Dimension',
'localName should be Dimension');
var dimensionObject = {
'name': node.getAttribute('name'),
'units': node.getAttribute('units'),
'unitSymbol': node.getAttribute('unitSymbol'),
'default': node.getAttribute('default'),
'multipleValues': ol.format.XSD.readBooleanString(
node.getAttribute('multipleValues')),
node.getAttribute('multipleValues')),
'nearestValue': ol.format.XSD.readBooleanString(
node.getAttribute('nearestValue')),
node.getAttribute('nearestValue')),
'current': ol.format.XSD.readBooleanString(node.getAttribute('current')),
'values': ol.format.XSD.readString(node)
};
@@ -387,11 +333,9 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
* @return {Object|undefined} Online resource object.
*/
ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
node, objectStack);
{}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
node, objectStack);
};
@@ -402,12 +346,8 @@ ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack
* @return {Object|undefined} Request object.
*/
ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Request',
'localName should be Request');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
};
@@ -418,12 +358,8 @@ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
* @return {Object|undefined} DCP type object.
*/
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'DCPType',
'localName should be DCPType');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
};
@@ -434,11 +370,8 @@ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
* @return {Object|undefined} HTTP object.
*/
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack);
};
@@ -449,10 +382,8 @@ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
* @return {Object|undefined} Operation type object.
*/
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
};
@@ -463,10 +394,8 @@ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
* @return {Object|undefined} Online resource object.
*/
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var formatOnlineresource =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (formatOnlineresource) {
var size = [
ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('width')),
@@ -486,12 +415,8 @@ ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, object
* @return {Object|undefined} Authority URL object.
*/
ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'AuthorityURL',
'localName should be AuthorityURL');
var authorityObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (authorityObject) {
authorityObject['name'] = node.getAttribute('name');
return authorityObject;
@@ -507,12 +432,8 @@ ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
* @return {Object|undefined} Metadata URL object.
*/
ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'MetadataURL',
'localName should be MetadataURL');
var metadataObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (metadataObject) {
metadataObject['type'] = node.getAttribute('type');
return metadataObject;
@@ -528,11 +449,8 @@ ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
* @return {Object|undefined} Style object.
*/
ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack);
{}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack);
};
@@ -543,12 +461,8 @@ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
* @return {Array.<string>|undefined} Keyword list.
*/
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'KeywordList',
'localName should be KeywordList');
return ol.xml.pushParseAndPop(
[], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);
[], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);
};

View File

@@ -70,10 +70,7 @@ ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer';
* @private
*/
ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack) {
node.setAttribute('namespaceURI', this.featureNS_);
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var localName = node.localName;
/** @type {Array.<ol.Feature>} */
var features = [];
@@ -88,10 +85,6 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
}
var context = objectStack[0];
ol.DEBUG && console.assert(layer.localName.indexOf(
ol.format.WMSGetFeatureInfo.layerIdentifier_) >= 0,
'localName of layer node should match layerIdentifier');
var toRemove = ol.format.WMSGetFeatureInfo.layerIdentifier_;
var layerName = layer.localName.replace(toRemove, '');

View File

@@ -45,8 +45,6 @@ ol.format.WMTSCapabilities.prototype.read;
* @return {Object} WMTS Capability object.
*/
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
return this.readFromNode(n);
@@ -61,10 +59,6 @@ ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
* @return {Object} WMTS Capability object.
*/
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Capabilities',
'localName should be Capabilities');
var version = node.getAttribute('version').trim();
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
if (!WMTSCapabilityObject) {
@@ -72,7 +66,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
}
WMTSCapabilityObject['version'] = version;
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
ol.format.WMTSCapabilities.PARSERS_, node, []);
ol.format.WMTSCapabilities.PARSERS_, node, []);
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
};
@@ -84,13 +78,8 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
* @return {Object|undefined} Attribution object.
*/
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Contents',
'localName should be Contents');
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
};
@@ -101,11 +90,8 @@ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
* @return {Object|undefined} Layers object.
*/
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
};

View File

@@ -208,8 +208,6 @@ ol.format.XMLFeature.prototype.readProjectionFromNode = function(node) {
*/
ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
var node = this.writeFeatureNode(feature, opt_options);
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return this.xmlSerializer_.serializeToString(node);
};
@@ -229,8 +227,6 @@ ol.format.XMLFeature.prototype.writeFeatureNode = function(feature, opt_options)
*/
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
var node = this.writeFeaturesNode(features, opt_options);
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return this.xmlSerializer_.serializeToString(node);
};
@@ -249,8 +245,6 @@ ol.format.XMLFeature.prototype.writeFeaturesNode = function(features, opt_option
*/
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
var node = this.writeGeometryNode(geometry, opt_options);
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return this.xmlSerializer_.serializeToString(node);
};

View File

@@ -154,9 +154,6 @@ ol.format.XSD.writeDecimalTextNode = function(node, decimal) {
* @param {number} nonNegativeInteger Non negative integer.
*/
ol.format.XSD.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) {
ol.DEBUG && console.assert(nonNegativeInteger >= 0, 'value should be more than 0');
ol.DEBUG && console.assert(nonNegativeInteger == (nonNegativeInteger | 0),
'value should be an integer value');
var string = nonNegativeInteger.toString();
node.appendChild(ol.xml.DOCUMENT.createTextNode(string));
};