Rename goog.DEBUG to ol.DEBUG

This commit is contained in:
Andreas Hocevar
2016-08-28 17:02:49 +02:00
parent 92ab5a079c
commit d1e4b33760
115 changed files with 701 additions and 691 deletions

View File

@@ -1,5 +1,9 @@
## Upgrade notes ## Upgrade notes
#### ´goog.DEBUG´ define was renamed to ´ol.DEBUG´
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
### v3.18.0 ### v3.18.0
#### Changes in the way assertions are handled #### Changes in the way assertions are handled

View File

@@ -24,7 +24,7 @@
"externs/topojson.js" "externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false" "ol.DEBUG=false"
], ],
"jscomp_error": [ "jscomp_error": [
"*" "*"

View File

@@ -24,7 +24,7 @@
"externs/topojson.js" "externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false" "ol.DEBUG=false"
], ],
"jscomp_error": [ "jscomp_error": [
"*" "*"

View File

@@ -15,7 +15,7 @@
"externs/topojson.js" "externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false" "ol.DEBUG=false"
], ],
"jscomp_error": [ "jscomp_error": [
"*" "*"

View File

@@ -169,7 +169,7 @@ The minimum config file looks like this:
"node_modules/openlayers/externs/topojson.js" "node_modules/openlayers/externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false", "ol.DEBUG=false",
"ol.ENABLE_DOM=false", "ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false" "ol.ENABLE_WEBGL=false"
], ],
@@ -221,7 +221,7 @@ Here is a version of `config.json` with more compilation checks enabled:
"node_modules/openlayers/externs/topojson.js" "node_modules/openlayers/externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false", "ol.DEBUG=false",
"ol.ENABLE_DOM=false", "ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false" "ol.ENABLE_WEBGL=false"
], ],

View File

@@ -60,7 +60,7 @@ Creating a custom build requires writing a build configuration file. The format
"externs/topojson.js" "externs/topojson.js"
], ],
"define": [ "define": [
"goog.DEBUG=false" "ol.DEBUG=false"
], ],
"extra_annotation_name": [ "extra_annotation_name": [
"api", "observable" "api", "observable"
@@ -211,7 +211,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
"ol.ENABLE_WEBGL=false", "ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false", "ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false", "ol.ENABLE_IMAGE=false",
"goog.DEBUG=false" "ol.DEBUG=false"
], ],
"compilation_level": "ADVANCED", "compilation_level": "ADVANCED",
"manage_closure_dependencies": true "manage_closure_dependencies": true

View File

@@ -144,9 +144,9 @@ ol.array.linearFindNearest = function(arr, target, direction) {
* @param {number} end End index. * @param {number} end End index.
*/ */
ol.array.reverseSubArray = function(arr, begin, end) { ol.array.reverseSubArray = function(arr, begin, end) {
goog.DEBUG && console.assert(begin >= 0, ol.DEBUG && console.assert(begin >= 0,
'Array begin index should be equal to or greater than 0'); 'Array begin index should be equal to or greater than 0');
goog.DEBUG && console.assert(end < arr.length, ol.DEBUG && console.assert(end < arr.length,
'Array end index should be less than the array length'); 'Array end index should be less than the array length');
while (begin < end) { while (begin < end) {
var tmp = arr[begin]; var tmp = arr[begin];

View File

@@ -144,7 +144,7 @@ ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
var listeners = this.listeners_[type]; var listeners = this.listeners_[type];
if (listeners) { if (listeners) {
var index = listeners.indexOf(listener); var index = listeners.indexOf(listener);
goog.DEBUG && console.assert(index != -1, 'listener not found'); ol.DEBUG && console.assert(index != -1, 'listener not found');
if (type in this.pendingRemovals_) { if (type in this.pendingRemovals_) {
// make listener a no-op, and remove later in #dispatchEvent() // make listener a no-op, and remove later in #dispatchEvent()
listeners[index] = ol.nullFunction; listeners[index] = ol.nullFunction;

View File

@@ -55,8 +55,8 @@ ol.extent.boundingExtent = function(coordinates) {
* @return {ol.Extent} Extent. * @return {ol.Extent} Extent.
*/ */
ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) { ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
goog.DEBUG && console.assert(xs.length > 0, 'xs length should be larger than 0'); ol.DEBUG && console.assert(xs.length > 0, 'xs length should be larger than 0');
goog.DEBUG && console.assert(ys.length > 0, 'ys length should be larger than 0'); ol.DEBUG && console.assert(ys.length > 0, 'ys length should be larger than 0');
var minX = Math.min.apply(null, xs); var minX = Math.min.apply(null, xs);
var minY = Math.min.apply(null, ys); var minY = Math.min.apply(null, ys);
var maxX = Math.max.apply(null, xs); var maxX = Math.max.apply(null, xs);

View File

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

View File

@@ -86,7 +86,7 @@ ol.format.GeoJSON.readGeometry_ = function(object, opt_options) {
*/ */
ol.format.GeoJSON.readGeometryCollectionGeometry_ = function( ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
object, opt_options) { object, opt_options) {
goog.DEBUG && console.assert(object.type == 'GeometryCollection', ol.DEBUG && console.assert(object.type == 'GeometryCollection',
'object.type should be GeometryCollection'); 'object.type should be GeometryCollection');
var geometries = object.geometries.map( var geometries = object.geometries.map(
/** /**
@@ -106,7 +106,7 @@ ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
* @return {ol.geom.Point} Point. * @return {ol.geom.Point} Point.
*/ */
ol.format.GeoJSON.readPointGeometry_ = function(object) { ol.format.GeoJSON.readPointGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'Point', ol.DEBUG && console.assert(object.type == 'Point',
'object.type should be Point'); 'object.type should be Point');
return new ol.geom.Point(object.coordinates); return new ol.geom.Point(object.coordinates);
}; };
@@ -118,7 +118,7 @@ ol.format.GeoJSON.readPointGeometry_ = function(object) {
* @return {ol.geom.LineString} LineString. * @return {ol.geom.LineString} LineString.
*/ */
ol.format.GeoJSON.readLineStringGeometry_ = function(object) { ol.format.GeoJSON.readLineStringGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'LineString', ol.DEBUG && console.assert(object.type == 'LineString',
'object.type should be LineString'); 'object.type should be LineString');
return new ol.geom.LineString(object.coordinates); return new ol.geom.LineString(object.coordinates);
}; };
@@ -130,7 +130,7 @@ ol.format.GeoJSON.readLineStringGeometry_ = function(object) {
* @return {ol.geom.MultiLineString} MultiLineString. * @return {ol.geom.MultiLineString} MultiLineString.
*/ */
ol.format.GeoJSON.readMultiLineStringGeometry_ = function(object) { ol.format.GeoJSON.readMultiLineStringGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'MultiLineString', ol.DEBUG && console.assert(object.type == 'MultiLineString',
'object.type should be MultiLineString'); 'object.type should be MultiLineString');
return new ol.geom.MultiLineString(object.coordinates); return new ol.geom.MultiLineString(object.coordinates);
}; };
@@ -142,7 +142,7 @@ ol.format.GeoJSON.readMultiLineStringGeometry_ = function(object) {
* @return {ol.geom.MultiPoint} MultiPoint. * @return {ol.geom.MultiPoint} MultiPoint.
*/ */
ol.format.GeoJSON.readMultiPointGeometry_ = function(object) { ol.format.GeoJSON.readMultiPointGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'MultiPoint', ol.DEBUG && console.assert(object.type == 'MultiPoint',
'object.type should be MultiPoint'); 'object.type should be MultiPoint');
return new ol.geom.MultiPoint(object.coordinates); return new ol.geom.MultiPoint(object.coordinates);
}; };
@@ -154,7 +154,7 @@ ol.format.GeoJSON.readMultiPointGeometry_ = function(object) {
* @return {ol.geom.MultiPolygon} MultiPolygon. * @return {ol.geom.MultiPolygon} MultiPolygon.
*/ */
ol.format.GeoJSON.readMultiPolygonGeometry_ = function(object) { ol.format.GeoJSON.readMultiPolygonGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'MultiPolygon', ol.DEBUG && console.assert(object.type == 'MultiPolygon',
'object.type should be MultiPolygon'); 'object.type should be MultiPolygon');
return new ol.geom.MultiPolygon(object.coordinates); return new ol.geom.MultiPolygon(object.coordinates);
}; };
@@ -166,7 +166,7 @@ ol.format.GeoJSON.readMultiPolygonGeometry_ = function(object) {
* @return {ol.geom.Polygon} Polygon. * @return {ol.geom.Polygon} Polygon.
*/ */
ol.format.GeoJSON.readPolygonGeometry_ = function(object) { ol.format.GeoJSON.readPolygonGeometry_ = function(object) {
goog.DEBUG && console.assert(object.type == 'Polygon', ol.DEBUG && console.assert(object.type == 'Polygon',
'object.type should be Polygon'); 'object.type should be Polygon');
return new ol.geom.Polygon(object.coordinates); return new ol.geom.Polygon(object.coordinates);
}; };
@@ -384,7 +384,7 @@ ol.format.GeoJSON.prototype.readFeatures;
ol.format.GeoJSON.prototype.readFeatureFromObject = function( ol.format.GeoJSON.prototype.readFeatureFromObject = function(
object, opt_options) { object, opt_options) {
var geoJSONFeature = /** @type {GeoJSONFeature} */ (object); var geoJSONFeature = /** @type {GeoJSONFeature} */ (object);
goog.DEBUG && console.assert(geoJSONFeature.type == 'Feature', ol.DEBUG && console.assert(geoJSONFeature.type == 'Feature',
'geoJSONFeature.type should be Feature'); 'geoJSONFeature.type should be Feature');
var geometry = ol.format.GeoJSON.readGeometry_(geoJSONFeature.geometry, var geometry = ol.format.GeoJSON.readGeometry_(geoJSONFeature.geometry,
opt_options); opt_options);

View File

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

View File

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

View File

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

View File

@@ -72,7 +72,7 @@ ol.format.GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
* @return {Array.<number>} Flat coordinates. * @return {Array.<number>} Flat coordinates.
*/ */
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) { ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
flatCoordinates.push( flatCoordinates.push(
parseFloat(node.getAttribute('lon')), parseFloat(node.getAttribute('lon')),
@@ -99,9 +99,9 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
* @private * @private
*/ */
ol.format.GPX.parseLink_ = function(node, objectStack) { ol.format.GPX.parseLink_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'link', 'localName should be link'); ol.DEBUG && console.assert(node.localName == 'link', 'localName should be link');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var href = node.getAttribute('href'); var href = node.getAttribute('href');
if (href !== null) { if (href !== null) {
@@ -117,9 +117,9 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.GPX.parseExtensions_ = function(node, objectStack) { ol.format.GPX.parseExtensions_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'extensions', ol.DEBUG && console.assert(node.localName == 'extensions',
'localName should be extensions'); 'localName should be extensions');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values['extensionsNode_'] = node; values['extensionsNode_'] = node;
@@ -132,9 +132,9 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.GPX.parseRtePt_ = function(node, objectStack) { ol.format.GPX.parseRtePt_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'rtept', 'localName should be rtept'); ol.DEBUG && console.assert(node.localName == 'rtept', 'localName should be rtept');
var values = ol.xml.pushParseAndPop( var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.RTEPT_PARSERS_, node, objectStack); {}, ol.format.GPX.RTEPT_PARSERS_, node, objectStack);
if (values) { if (values) {
@@ -152,9 +152,9 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.GPX.parseTrkPt_ = function(node, objectStack) { ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'trkpt', 'localName should be trkpt'); ol.DEBUG && console.assert(node.localName == 'trkpt', 'localName should be trkpt');
var values = ol.xml.pushParseAndPop( var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.TRKPT_PARSERS_, node, objectStack); {}, ol.format.GPX.TRKPT_PARSERS_, node, objectStack);
if (values) { if (values) {
@@ -172,9 +172,9 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) { ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'trkseg', ol.DEBUG && console.assert(node.localName == 'trkseg',
'localName should be trkseg'); 'localName should be trkseg');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
ol.xml.parseNode(ol.format.GPX.TRKSEG_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.GPX.TRKSEG_PARSERS_, node, objectStack);
@@ -192,9 +192,9 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track. * @return {ol.Feature|undefined} Track.
*/ */
ol.format.GPX.readRte_ = function(node, objectStack) { ol.format.GPX.readRte_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'rte', 'localName should be rte'); ol.DEBUG && console.assert(node.localName == 'rte', 'localName should be rte');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]); var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop({ var values = ol.xml.pushParseAndPop({
'flatCoordinates': [] 'flatCoordinates': []
@@ -221,9 +221,9 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track. * @return {ol.Feature|undefined} Track.
*/ */
ol.format.GPX.readTrk_ = function(node, objectStack) { ol.format.GPX.readTrk_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'trk', 'localName should be trk'); ol.DEBUG && console.assert(node.localName == 'trk', 'localName should be trk');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]); var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop({ var values = ol.xml.pushParseAndPop({
'flatCoordinates': [], 'flatCoordinates': [],
@@ -254,9 +254,9 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Waypoint. * @return {ol.Feature|undefined} Waypoint.
*/ */
ol.format.GPX.readWpt_ = function(node, objectStack) { ol.format.GPX.readWpt_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'wpt', 'localName should be wpt'); ol.DEBUG && console.assert(node.localName == 'wpt', 'localName should be wpt');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]); var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
var values = ol.xml.pushParseAndPop( var values = ol.xml.pushParseAndPop(
{}, ol.format.GPX.WPT_PARSERS_, node, objectStack); {}, ol.format.GPX.WPT_PARSERS_, node, objectStack);
@@ -456,7 +456,7 @@ ol.format.GPX.prototype.readFeature;
* @inheritDoc * @inheritDoc
*/ */
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) { ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) { if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return null; return null;
@@ -492,7 +492,7 @@ ol.format.GPX.prototype.readFeatures;
* @inheritDoc * @inheritDoc
*/ */
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) { ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) { if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return []; return [];
@@ -552,7 +552,7 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) { ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
var parentNode = context.node; var parentNode = context.node;
goog.DEBUG && console.assert(ol.xml.isNode(parentNode), ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node'); 'parentNode should be an XML node');
var namespaceURI = parentNode.namespaceURI; var namespaceURI = parentNode.namespaceURI;
var properties = context['properties']; var properties = context['properties'];
@@ -859,7 +859,7 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
var nodeName = ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()]; var nodeName = ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
if (nodeName) { if (nodeName) {
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
goog.DEBUG && console.assert(ol.xml.isNode(parentNode), ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node'); 'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, nodeName); return ol.xml.createElementNS(parentNode.namespaceURI, nodeName);
} }

View File

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

View File

@@ -559,9 +559,9 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.IconStyleParser_ = function(node, objectStack) { ol.format.KML.IconStyleParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be an ELEMENT'); 'node.nodeType should be an ELEMENT');
goog.DEBUG && console.assert(node.localName == 'IconStyle', ol.DEBUG && console.assert(node.localName == 'IconStyle',
'localName should be IconStyle'); 'localName should be IconStyle');
// FIXME refreshMode // FIXME refreshMode
// FIXME refreshInterval // FIXME refreshInterval
@@ -670,9 +670,9 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.LabelStyleParser_ = function(node, objectStack) { ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'LabelStyle', ol.DEBUG && console.assert(node.localName == 'LabelStyle',
'localName should be LabelStyle'); 'localName should be LabelStyle');
// FIXME colorMode // FIXME colorMode
var object = ol.xml.pushParseAndPop( var object = ol.xml.pushParseAndPop(
@@ -699,9 +699,9 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.LineStyleParser_ = function(node, objectStack) { ol.format.KML.LineStyleParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'LineStyle', ol.DEBUG && console.assert(node.localName == 'LineStyle',
'localName should be LineStyle'); 'localName should be LineStyle');
// FIXME colorMode // FIXME colorMode
// FIXME gx:outerColor // FIXME gx:outerColor
@@ -729,9 +729,9 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.PolyStyleParser_ = function(node, objectStack) { ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'PolyStyle', ol.DEBUG && console.assert(node.localName == 'PolyStyle',
'localName should be PolyStyle'); 'localName should be PolyStyle');
// FIXME colorMode // FIXME colorMode
var object = ol.xml.pushParseAndPop( var object = ol.xml.pushParseAndPop(
@@ -764,9 +764,9 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
* @return {Array.<number>} LinearRing flat coordinates. * @return {Array.<number>} LinearRing flat coordinates.
*/ */
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) { ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'LinearRing', ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing'); 'localName should be LinearRing');
return ol.xml.pushParseAndPop(null, return ol.xml.pushParseAndPop(null,
ol.format.KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack); ol.format.KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
@@ -779,12 +779,12 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.gxCoordParser_ = function(node, objectStack) { ol.format.KML.gxCoordParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(ol.array.includes( ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI), ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser'); 'namespaceURI of the node should be known to the KML parser');
goog.DEBUG && console.assert(node.localName == 'coord', 'localName should be coord'); ol.DEBUG && console.assert(node.localName == 'coord', 'localName should be coord');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */ var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
var flatCoordinates = gxTrackObject.flatCoordinates; var flatCoordinates = gxTrackObject.flatCoordinates;
@@ -810,12 +810,12 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString. * @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/ */
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) { ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(ol.array.includes( ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI), ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser'); 'namespaceURI of the node should be known to the KML parser');
goog.DEBUG && console.assert(node.localName == 'MultiTrack', ol.DEBUG && console.assert(node.localName == 'MultiTrack',
'localName should be MultiTrack'); 'localName should be MultiTrack');
var lineStrings = ol.xml.pushParseAndPop([], var lineStrings = ol.xml.pushParseAndPop([],
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack); ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
@@ -835,12 +835,12 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString. * @return {ol.geom.LineString|undefined} LineString.
*/ */
ol.format.KML.readGxTrack_ = function(node, objectStack) { ol.format.KML.readGxTrack_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(ol.array.includes( ol.DEBUG && console.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI), ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
'namespaceURI of the node should be known to the KML parser'); 'namespaceURI of the node should be known to the KML parser');
goog.DEBUG && console.assert(node.localName == 'Track', 'localName should be Track'); ol.DEBUG && console.assert(node.localName == 'Track', 'localName should be Track');
var gxTrackObject = ol.xml.pushParseAndPop( var gxTrackObject = ol.xml.pushParseAndPop(
/** @type {ol.KMLGxTrackObject_} */ ({ /** @type {ol.KMLGxTrackObject_} */ ({
flatCoordinates: [], flatCoordinates: [],
@@ -851,7 +851,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
} }
var flatCoordinates = gxTrackObject.flatCoordinates; var flatCoordinates = gxTrackObject.flatCoordinates;
var whens = gxTrackObject.whens; var whens = gxTrackObject.whens;
goog.DEBUG && console.assert(flatCoordinates.length / 4 == whens.length, ol.DEBUG && console.assert(flatCoordinates.length / 4 == whens.length,
'the length of the flatCoordinates array divided by 4 should be the ' + 'the length of the flatCoordinates array divided by 4 should be the ' +
'length of the whens array'); 'length of the whens array');
var i, ii; var i, ii;
@@ -872,9 +872,9 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
* @return {Object} Icon object. * @return {Object} Icon object.
*/ */
ol.format.KML.readIcon_ = function(node, objectStack) { ol.format.KML.readIcon_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Icon', 'localName should be Icon'); ol.DEBUG && console.assert(node.localName == 'Icon', 'localName should be Icon');
var iconObject = ol.xml.pushParseAndPop( var iconObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.ICON_PARSERS_, node, objectStack); {}, ol.format.KML.ICON_PARSERS_, node, objectStack);
if (iconObject) { if (iconObject) {
@@ -892,7 +892,7 @@ ol.format.KML.readIcon_ = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates. * @return {Array.<number>} Flat coordinates.
*/ */
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) { ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null, return ol.xml.pushParseAndPop(null,
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack); ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
@@ -906,9 +906,9 @@ ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString. * @return {ol.geom.LineString|undefined} LineString.
*/ */
ol.format.KML.readLineString_ = function(node, objectStack) { ol.format.KML.readLineString_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'LineString', ol.DEBUG && console.assert(node.localName == 'LineString',
'localName should be LineString'); 'localName should be LineString');
var properties = ol.xml.pushParseAndPop({}, var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node, ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
@@ -933,9 +933,9 @@ ol.format.KML.readLineString_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon. * @return {ol.geom.Polygon|undefined} Polygon.
*/ */
ol.format.KML.readLinearRing_ = function(node, objectStack) { ol.format.KML.readLinearRing_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'LinearRing', ol.DEBUG && console.assert(node.localName == 'LinearRing',
'localName should be LinearRing'); 'localName should be LinearRing');
var properties = ol.xml.pushParseAndPop({}, var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node, ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
@@ -961,9 +961,9 @@ ol.format.KML.readLinearRing_ = function(node, objectStack) {
* @return {ol.geom.Geometry} Geometry. * @return {ol.geom.Geometry} Geometry.
*/ */
ol.format.KML.readMultiGeometry_ = function(node, objectStack) { ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'MultiGeometry', ol.DEBUG && console.assert(node.localName == 'MultiGeometry',
'localName should be MultiGeometry'); 'localName should be MultiGeometry');
var geometries = ol.xml.pushParseAndPop([], var geometries = ol.xml.pushParseAndPop([],
ol.format.KML.MULTI_GEOMETRY_PARSERS_, node, objectStack); ol.format.KML.MULTI_GEOMETRY_PARSERS_, node, objectStack);
@@ -994,7 +994,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
flatCoordinates = point.getFlatCoordinates(); flatCoordinates = point.getFlatCoordinates();
for (i = 1, ii = geometries.length; i < ii; ++i) { for (i = 1, ii = geometries.length; i < ii; ++i) {
geometry = geometries[i]; geometry = geometries[i];
goog.DEBUG && console.assert(geometry.getLayout() == layout, ol.DEBUG && console.assert(geometry.getLayout() == layout,
'geometry layout should be consistent'); 'geometry layout should be consistent');
ol.array.extend(flatCoordinates, geometry.getFlatCoordinates()); ol.array.extend(flatCoordinates, geometry.getFlatCoordinates());
} }
@@ -1028,9 +1028,9 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point. * @return {ol.geom.Point|undefined} Point.
*/ */
ol.format.KML.readPoint_ = function(node, objectStack) { ol.format.KML.readPoint_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point'); ol.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point');
var properties = ol.xml.pushParseAndPop({}, var properties = ol.xml.pushParseAndPop({},
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node, ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
objectStack); objectStack);
@@ -1038,7 +1038,7 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
ol.format.KML.readFlatCoordinatesFromNode_(node, objectStack); ol.format.KML.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) { if (flatCoordinates) {
var point = new ol.geom.Point(null); var point = new ol.geom.Point(null);
goog.DEBUG && console.assert(flatCoordinates.length == 3, ol.DEBUG && console.assert(flatCoordinates.length == 3,
'flatCoordinates should have a length of 3'); 'flatCoordinates should have a length of 3');
point.setFlatCoordinates(ol.geom.GeometryLayout.XYZ, flatCoordinates); point.setFlatCoordinates(ol.geom.GeometryLayout.XYZ, flatCoordinates);
point.setProperties(properties); point.setProperties(properties);
@@ -1056,9 +1056,9 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon. * @return {ol.geom.Polygon|undefined} Polygon.
*/ */
ol.format.KML.readPolygon_ = function(node, objectStack) { ol.format.KML.readPolygon_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Polygon', ol.DEBUG && console.assert(node.localName == 'Polygon',
'localName should be Polygon'); 'localName should be Polygon');
var properties = ol.xml.pushParseAndPop(/** @type {Object<string,*>} */ ({}), var properties = ol.xml.pushParseAndPop(/** @type {Object<string,*>} */ ({}),
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node, ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_, node,
@@ -1091,9 +1091,9 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
* @return {Array.<ol.style.Style>} Style. * @return {Array.<ol.style.Style>} Style.
*/ */
ol.format.KML.readStyle_ = function(node, objectStack) { ol.format.KML.readStyle_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style'); ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
var styleObject = ol.xml.pushParseAndPop( var styleObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.STYLE_PARSERS_, node, objectStack); {}, ol.format.KML.STYLE_PARSERS_, node, objectStack);
if (!styleObject) { if (!styleObject) {
@@ -1170,9 +1170,9 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
* @private * @private
*/ */
ol.format.KML.DataParser_ = function(node, objectStack) { ol.format.KML.DataParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Data', 'localName should be Data'); ol.DEBUG && console.assert(node.localName == 'Data', 'localName should be Data');
var name = node.getAttribute('name'); var name = node.getAttribute('name');
if (name !== null) { if (name !== null) {
var data = ol.xml.pushParseAndPop( var data = ol.xml.pushParseAndPop(
@@ -1192,9 +1192,9 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) { ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'ExtendedData', ol.DEBUG && console.assert(node.localName == 'ExtendedData',
'localName should be ExtendedData'); 'localName should be ExtendedData');
ol.xml.parseNode(ol.format.KML.EXTENDED_DATA_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.KML.EXTENDED_DATA_PARSERS_, node, objectStack);
}; };
@@ -1206,9 +1206,9 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.PairDataParser_ = function(node, objectStack) { ol.format.KML.PairDataParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Pair', 'localName should be Pair'); ol.DEBUG && console.assert(node.localName == 'Pair', 'localName should be Pair');
var pairObject = ol.xml.pushParseAndPop( var pairObject = ol.xml.pushParseAndPop(
{}, ol.format.KML.PAIR_PARSERS_, node, objectStack); {}, ol.format.KML.PAIR_PARSERS_, node, objectStack);
if (!pairObject) { if (!pairObject) {
@@ -1237,9 +1237,9 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) { ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'StyleMap', ol.DEBUG && console.assert(node.localName == 'StyleMap',
'localName should be StyleMap'); 'localName should be StyleMap');
var styleMapValue = ol.format.KML.readStyleMapValue_(node, objectStack); var styleMapValue = ol.format.KML.readStyleMapValue_(node, objectStack);
if (!styleMapValue) { if (!styleMapValue) {
@@ -1262,9 +1262,9 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.SchemaDataParser_ = function(node, objectStack) { ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'SchemaData', ol.DEBUG && console.assert(node.localName == 'SchemaData',
'localName should be SchemaData'); 'localName should be SchemaData');
ol.xml.parseNode(ol.format.KML.SCHEMA_DATA_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.KML.SCHEMA_DATA_PARSERS_, node, objectStack);
}; };
@@ -1276,9 +1276,9 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.SimpleDataParser_ = function(node, objectStack) { ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'SimpleData', ol.DEBUG && console.assert(node.localName == 'SimpleData',
'localName should be SimpleData'); 'localName should be SimpleData');
var name = node.getAttribute('name'); var name = node.getAttribute('name');
if (name !== null) { if (name !== null) {
@@ -1296,9 +1296,9 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) { ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'innerBoundaryIs', ol.DEBUG && console.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs'); 'localName should be innerBoundaryIs');
/** @type {Array.<number>|undefined} */ /** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined, var flatLinearRing = ol.xml.pushParseAndPop(undefined,
@@ -1306,9 +1306,9 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) { if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */ var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
goog.DEBUG && console.assert(Array.isArray(flatLinearRings), ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array'); 'flatLinearRings should be an array');
goog.DEBUG && console.assert(flatLinearRings.length > 0, ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty'); 'flatLinearRings array should not be empty');
flatLinearRings.push(flatLinearRing); flatLinearRings.push(flatLinearRing);
} }
@@ -1321,9 +1321,9 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) { ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'outerBoundaryIs', ol.DEBUG && console.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs'); 'localName should be outerBoundaryIs');
/** @type {Array.<number>|undefined} */ /** @type {Array.<number>|undefined} */
var flatLinearRing = ol.xml.pushParseAndPop(undefined, var flatLinearRing = ol.xml.pushParseAndPop(undefined,
@@ -1331,9 +1331,9 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) { if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */ var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
goog.DEBUG && console.assert(Array.isArray(flatLinearRings), ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array'); 'flatLinearRings should be an array');
goog.DEBUG && console.assert(flatLinearRings.length > 0, ol.DEBUG && console.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty'); 'flatLinearRings array should not be empty');
flatLinearRings[0] = flatLinearRing; flatLinearRings[0] = flatLinearRing;
} }
@@ -1346,9 +1346,9 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.LinkParser_ = function(node, objectStack) { ol.format.KML.LinkParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Link', 'localName should be Link'); ol.DEBUG && console.assert(node.localName == 'Link', 'localName should be Link');
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
}; };
@@ -1359,9 +1359,9 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.whenParser_ = function(node, objectStack) { ol.format.KML.whenParser_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'when', 'localName should be when'); ol.DEBUG && console.assert(node.localName == 'when', 'localName should be when');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */ var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
var whens = gxTrackObject.whens; var whens = gxTrackObject.whens;
@@ -1700,10 +1700,10 @@ ol.format.KML.prototype.getExtensions = function() {
* @return {Array.<ol.Feature>|undefined} Features. * @return {Array.<ol.Feature>|undefined} Features.
*/ */
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) { ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
var localName = node.localName; var localName = node.localName;
goog.DEBUG && console.assert(localName == 'Document' || localName == 'Folder', ol.DEBUG && console.assert(localName == 'Document' || localName == 'Folder',
'localName should be Document or Folder'); 'localName should be Document or Folder');
// FIXME use scope somehow // FIXME use scope somehow
var parsersNS = ol.xml.makeStructureNS( var parsersNS = ol.xml.makeStructureNS(
@@ -1731,9 +1731,9 @@ ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Feature. * @return {ol.Feature|undefined} Feature.
*/ */
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) { ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Placemark', ol.DEBUG && console.assert(node.localName == 'Placemark',
'localName should be Placemark'); 'localName should be Placemark');
var object = ol.xml.pushParseAndPop({'geometry': null}, var object = ol.xml.pushParseAndPop({'geometry': null},
ol.format.KML.PLACEMARK_PARSERS_, node, objectStack); ol.format.KML.PLACEMARK_PARSERS_, node, objectStack);
@@ -1778,9 +1778,9 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) { ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style'); ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
var id = node.getAttribute('id'); var id = node.getAttribute('id');
if (id !== null) { if (id !== null) {
var style = ol.format.KML.readStyle_(node, objectStack); var style = ol.format.KML.readStyle_(node, objectStack);
@@ -1804,9 +1804,9 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
* @private * @private
*/ */
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) { ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'StyleMap', ol.DEBUG && console.assert(node.localName == 'StyleMap',
'localName should be StyleMap'); 'localName should be StyleMap');
var id = node.getAttribute('id'); var id = node.getAttribute('id');
if (id === null) { if (id === null) {
@@ -1845,12 +1845,12 @@ ol.format.KML.prototype.readFeature;
* @inheritDoc * @inheritDoc
*/ */
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) { ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) { if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return null; return null;
} }
goog.DEBUG && console.assert(node.localName == 'Placemark', ol.DEBUG && console.assert(node.localName == 'Placemark',
'localName should be Placemark'); 'localName should be Placemark');
var feature = this.readPlacemark_( var feature = this.readPlacemark_(
node, [this.getReadOptions(node, opt_options)]); node, [this.getReadOptions(node, opt_options)]);
@@ -1880,7 +1880,7 @@ ol.format.KML.prototype.readFeatures;
* @inheritDoc * @inheritDoc
*/ */
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) { ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) { if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return []; return [];
@@ -2376,7 +2376,7 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
* @private * @private
*/ */
ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) { ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
(geometry instanceof ol.geom.Point) || (geometry instanceof ol.geom.Point) ||
(geometry instanceof ol.geom.LineString) || (geometry instanceof ol.geom.LineString) ||
(geometry instanceof ol.geom.LinearRing), (geometry instanceof ol.geom.LinearRing),
@@ -2401,7 +2401,7 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
*/ */
ol.format.KML.writePolygon_ = function(node, polygon, objectStack) { ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
var linearRings = polygon.getLinearRings(); var linearRings = polygon.getLinearRings();
goog.DEBUG && console.assert(linearRings.length > 0, ol.DEBUG && console.assert(linearRings.length > 0,
'linearRings should not be empty'); 'linearRings should not be empty');
var outerRing = linearRings.shift(); var outerRing = linearRings.shift();
var /** @type {ol.XmlNodeStackItem} */ context = {node: node}; var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
@@ -2800,7 +2800,7 @@ ol.format.KML.GX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
ol.format.KML.DOCUMENT_NODE_FACTORY_ = function(value, objectStack, ol.format.KML.DOCUMENT_NODE_FACTORY_ = function(value, objectStack,
opt_nodeName) { opt_nodeName) {
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
goog.DEBUG && console.assert(ol.xml.isNode(parentNode), ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node'); 'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, 'Placemark'); return ol.xml.createElementNS(parentNode.namespaceURI, 'Placemark');
}; };
@@ -2818,7 +2818,7 @@ ol.format.KML.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
opt_nodeName) { opt_nodeName) {
if (value) { if (value) {
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
goog.DEBUG && console.assert(ol.xml.isNode(parentNode), ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node'); 'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, return ol.xml.createElementNS(parentNode.namespaceURI,
ol.format.KML.GEOMETRY_TYPE_TO_NODENAME_[/** @type {ol.geom.Geometry} */ (value).getType()]); ol.format.KML.GEOMETRY_TYPE_TO_NODENAME_[/** @type {ol.geom.Geometry} */ (value).getType()]);

View File

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

View File

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

View File

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

View File

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

View File

@@ -165,7 +165,7 @@ ol.format.WKT.encodeMultiPolygonGeometry_ = function(geom) {
ol.format.WKT.encode_ = function(geom) { ol.format.WKT.encode_ = function(geom) {
var type = geom.getType(); var type = geom.getType();
var geometryEncoder = ol.format.WKT.GeometryEncoder_[type]; var geometryEncoder = ol.format.WKT.GeometryEncoder_[type];
goog.DEBUG && console.assert(geometryEncoder, 'geometryEncoder should be defined'); ol.DEBUG && console.assert(geometryEncoder, 'geometryEncoder should be defined');
var enc = geometryEncoder(geom); var enc = geometryEncoder(geom);
type = type.toUpperCase(); type = type.toUpperCase();
if (enc.length === 0) { if (enc.length === 0) {
@@ -572,7 +572,7 @@ ol.format.WKT.Parser.prototype.match = function(type) {
ol.format.WKT.Parser.prototype.parse = function() { ol.format.WKT.Parser.prototype.parse = function() {
this.consume_(); this.consume_();
var geometry = this.parseGeometry_(); var geometry = this.parseGeometry_();
goog.DEBUG && console.assert(this.token_.type == ol.format.WKT.TokenType.EOF, ol.DEBUG && console.assert(this.token_.type == ol.format.WKT.TokenType.EOF,
'token type should be end of file'); 'token type should be end of file');
return geometry; return geometry;
}; };

View File

@@ -43,7 +43,7 @@ ol.format.WMSCapabilities.prototype.read;
* @return {Object} WMS Capability object. * @return {Object} WMS Capability object.
*/ */
ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) { ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
goog.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE, ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT'); 'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) { for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) { if (n.nodeType == Node.ELEMENT_NODE) {
@@ -59,9 +59,9 @@ ol.format.WMSCapabilities.prototype.readFromDocument = function(doc) {
* @return {Object} WMS Capability object. * @return {Object} WMS Capability object.
*/ */
ol.format.WMSCapabilities.prototype.readFromNode = function(node) { ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'WMS_Capabilities' || ol.DEBUG && console.assert(node.localName == 'WMS_Capabilities' ||
node.localName == 'WMT_MS_Capabilities', node.localName == 'WMT_MS_Capabilities',
'localName should be WMS_Capabilities or WMT_MS_Capabilities'); 'localName should be WMS_Capabilities or WMT_MS_Capabilities');
this.version = node.getAttribute('version').trim(); this.version = node.getAttribute('version').trim();
@@ -79,9 +79,9 @@ ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
* @return {Object|undefined} Attribution object. * @return {Object|undefined} Attribution object.
*/ */
ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) { ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Attribution', ol.DEBUG && console.assert(node.localName == 'Attribution',
'localName should be Attribution'); 'localName should be Attribution');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
@@ -95,9 +95,9 @@ ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
* @return {Object} Bounding box object. * @return {Object} Bounding box object.
*/ */
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) { ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'BoundingBox', ol.DEBUG && console.assert(node.localName == 'BoundingBox',
'localName should be BoundingBox'); 'localName should be BoundingBox');
var extent = [ var extent = [
@@ -127,9 +127,9 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Bounding box object. * @return {ol.Extent|undefined} Bounding box object.
*/ */
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) { ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'EX_GeographicBoundingBox', ol.DEBUG && console.assert(node.localName == 'EX_GeographicBoundingBox',
'localName should be EX_GeographicBoundingBox'); 'localName should be EX_GeographicBoundingBox');
var geographicBoundingBox = ol.xml.pushParseAndPop( var geographicBoundingBox = ol.xml.pushParseAndPop(
{}, {},
@@ -164,9 +164,9 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectSt
* @return {Object|undefined} Capability object. * @return {Object|undefined} Capability object.
*/ */
ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) { ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Capability', ol.DEBUG && console.assert(node.localName == 'Capability',
'localName should be Capability'); 'localName should be Capability');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
@@ -180,9 +180,9 @@ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
* @return {Object|undefined} Service object. * @return {Object|undefined} Service object.
*/ */
ol.format.WMSCapabilities.readService_ = function(node, objectStack) { ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Service', ol.DEBUG && console.assert(node.localName == 'Service',
'localName should be Service'); 'localName should be Service');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
@@ -196,9 +196,9 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
* @return {Object|undefined} Contact information object. * @return {Object|undefined} Contact information object.
*/ */
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) { ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType shpuld be ELEMENT'); 'node.nodeType shpuld be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'ContactInformation', ol.DEBUG && console.assert(node.localName == 'ContactInformation',
'localName should be ContactInformation'); 'localName should be ContactInformation');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_, {}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
@@ -213,9 +213,9 @@ ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack)
* @return {Object|undefined} Contact person object. * @return {Object|undefined} Contact person object.
*/ */
ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) { ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'ContactPersonPrimary', ol.DEBUG && console.assert(node.localName == 'ContactPersonPrimary',
'localName should be ContactPersonPrimary'); 'localName should be ContactPersonPrimary');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_, {}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_,
@@ -230,9 +230,9 @@ ol.format.WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack
* @return {Object|undefined} Contact address object. * @return {Object|undefined} Contact address object.
*/ */
ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) { ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'ContactAddress', ol.DEBUG && console.assert(node.localName == 'ContactAddress',
'localName should be ContactAddress'); 'localName should be ContactAddress');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_, {}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
@@ -247,9 +247,9 @@ ol.format.WMSCapabilities.readContactAddress_ = function(node, objectStack) {
* @return {Array.<string>|undefined} Format array. * @return {Array.<string>|undefined} Format array.
*/ */
ol.format.WMSCapabilities.readException_ = function(node, objectStack) { ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Exception', ol.DEBUG && console.assert(node.localName == 'Exception',
'localName should be Exception'); 'localName should be Exception');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
[], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack); [], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
@@ -263,9 +263,9 @@ ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
* @return {Object|undefined} Layer object. * @return {Object|undefined} Layer object.
*/ */
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) { ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer'); ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
}; };
@@ -278,9 +278,9 @@ ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
* @return {Object|undefined} Layer object. * @return {Object|undefined} Layer object.
*/ */
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) { ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer'); ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
var parentLayerObject = /** @type {Object.<string,*>} */ var parentLayerObject = /** @type {Object.<string,*>} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
@@ -360,9 +360,9 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
* @return {Object} Dimension object. * @return {Object} Dimension object.
*/ */
ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) { ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Dimension', ol.DEBUG && console.assert(node.localName == 'Dimension',
'localName should be Dimension'); 'localName should be Dimension');
var dimensionObject = { var dimensionObject = {
'name': node.getAttribute('name'), 'name': node.getAttribute('name'),
@@ -387,7 +387,7 @@ ol.format.WMSCapabilities.readDimension_ = function(node, objectStack) {
* @return {Object|undefined} Online resource object. * @return {Object|undefined} Online resource object.
*/ */
ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) { ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_, {}, ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
@@ -402,9 +402,9 @@ ol.format.WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack
* @return {Object|undefined} Request object. * @return {Object|undefined} Request object.
*/ */
ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) { ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Request', ol.DEBUG && console.assert(node.localName == 'Request',
'localName should be Request'); 'localName should be Request');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
@@ -418,9 +418,9 @@ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
* @return {Object|undefined} DCP type object. * @return {Object|undefined} DCP type object.
*/ */
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) { ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'DCPType', ol.DEBUG && console.assert(node.localName == 'DCPType',
'localName should be DCPType'); 'localName should be DCPType');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
@@ -434,9 +434,9 @@ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
* @return {Object|undefined} HTTP object. * @return {Object|undefined} HTTP object.
*/ */
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) { ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP'); ol.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack);
}; };
@@ -449,7 +449,7 @@ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
* @return {Object|undefined} Operation type object. * @return {Object|undefined} Operation type object.
*/ */
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) { ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
@@ -463,7 +463,7 @@ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
* @return {Object|undefined} Online resource object. * @return {Object|undefined} Online resource object.
*/ */
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) { ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
var formatOnlineresource = var formatOnlineresource =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack); ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
@@ -486,9 +486,9 @@ ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, object
* @return {Object|undefined} Authority URL object. * @return {Object|undefined} Authority URL object.
*/ */
ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) { ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'AuthorityURL', ol.DEBUG && console.assert(node.localName == 'AuthorityURL',
'localName should be AuthorityURL'); 'localName should be AuthorityURL');
var authorityObject = var authorityObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack); ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
@@ -507,9 +507,9 @@ ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
* @return {Object|undefined} Metadata URL object. * @return {Object|undefined} Metadata URL object.
*/ */
ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) { ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'MetadataURL', ol.DEBUG && console.assert(node.localName == 'MetadataURL',
'localName should be MetadataURL'); 'localName should be MetadataURL');
var metadataObject = var metadataObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack); ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
@@ -528,9 +528,9 @@ ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
* @return {Object|undefined} Style object. * @return {Object|undefined} Style object.
*/ */
ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) { ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style'); ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
{}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack); {}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack);
}; };
@@ -543,9 +543,9 @@ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
* @return {Array.<string>|undefined} Keyword list. * @return {Array.<string>|undefined} Keyword list.
*/ */
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) { ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'KeywordList', ol.DEBUG && console.assert(node.localName == 'KeywordList',
'localName should be KeywordList'); 'localName should be KeywordList');
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
[], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack); [], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);

View File

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

View File

@@ -45,7 +45,7 @@ ol.format.WMTSCapabilities.prototype.read;
* @return {Object} WMTS Capability object. * @return {Object} WMTS Capability object.
*/ */
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) { ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
goog.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE, ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
'doc.nodeType should be DOCUMENT'); 'doc.nodeType should be DOCUMENT');
for (var n = doc.firstChild; n; n = n.nextSibling) { for (var n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) { if (n.nodeType == Node.ELEMENT_NODE) {
@@ -61,9 +61,9 @@ ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
* @return {Object} WMTS Capability object. * @return {Object} WMTS Capability object.
*/ */
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) { ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Capabilities', ol.DEBUG && console.assert(node.localName == 'Capabilities',
'localName should be Capabilities'); 'localName should be Capabilities');
var version = node.getAttribute('version').trim(); var version = node.getAttribute('version').trim();
var WMTSCapabilityObject = this.owsParser_.readFromNode(node); var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
@@ -84,9 +84,9 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
* @return {Object|undefined} Attribution object. * @return {Object|undefined} Attribution object.
*/ */
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) { ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Contents', ol.DEBUG && console.assert(node.localName == 'Contents',
'localName should be Contents'); 'localName should be Contents');
return ol.xml.pushParseAndPop({}, return ol.xml.pushParseAndPop({},
@@ -101,9 +101,9 @@ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
* @return {Object|undefined} Layers object. * @return {Object|undefined} Layers object.
*/ */
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) { ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
goog.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE, ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT'); 'node.nodeType should be ELEMENT');
goog.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer'); ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
return ol.xml.pushParseAndPop({}, return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack); ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
}; };

View File

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

View File

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

View File

@@ -163,7 +163,7 @@ ol.geom.Circle.prototype.intersectsExtent = function(extent) {
*/ */
ol.geom.Circle.prototype.setCenter = function(center) { ol.geom.Circle.prototype.setCenter = function(center) {
var stride = this.stride; var stride = this.stride;
goog.DEBUG && console.assert(center.length == stride, ol.DEBUG && console.assert(center.length == stride,
'center array length should match stride'); 'center array length should match stride');
var radius = this.flatCoordinates[stride] - this.flatCoordinates[0]; var radius = this.flatCoordinates[stride] - this.flatCoordinates[0];
var flatCoordinates = center.slice(); var flatCoordinates = center.slice();

View File

@@ -147,7 +147,7 @@ ol.geom.flat.closest.getClosestPoint = function(flatCoordinates, offset, end,
return minSquaredDistance; return minSquaredDistance;
} }
} }
goog.DEBUG && console.assert(maxDelta > 0, 'maxDelta should be larger than 0'); ol.DEBUG && console.assert(maxDelta > 0, 'maxDelta should be larger than 0');
var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN]; var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];
var index = offset + stride; var index = offset + stride;
while (index < end) { while (index < end) {

View File

@@ -64,7 +64,7 @@ ol.geom.flat.contains.linearRingContainsXY = function(flatCoordinates, offset, e
* @return {boolean} Contains (x, y). * @return {boolean} Contains (x, y).
*/ */
ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset, ends, stride, x, y) { ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset, ends, stride, x, y) {
goog.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array'); ol.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array');
if (ends.length === 0) { if (ends.length === 0) {
return false; return false;
} }
@@ -93,7 +93,7 @@ ol.geom.flat.contains.linearRingsContainsXY = function(flatCoordinates, offset,
* @return {boolean} Contains (x, y). * @return {boolean} Contains (x, y).
*/ */
ol.geom.flat.contains.linearRingssContainsXY = function(flatCoordinates, offset, endss, stride, x, y) { ol.geom.flat.contains.linearRingssContainsXY = function(flatCoordinates, offset, endss, stride, x, y) {
goog.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array'); ol.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array');
if (endss.length === 0) { if (endss.length === 0) {
return false; return false;
} }

View File

@@ -9,7 +9,7 @@ goog.provide('ol.geom.flat.deflate');
* @return {number} offset Offset. * @return {number} offset Offset.
*/ */
ol.geom.flat.deflate.coordinate = function(flatCoordinates, offset, coordinate, stride) { ol.geom.flat.deflate.coordinate = function(flatCoordinates, offset, coordinate, stride) {
goog.DEBUG && console.assert(coordinate.length == stride, ol.DEBUG && console.assert(coordinate.length == stride,
'length of the coordinate array should match stride'); 'length of the coordinate array should match stride');
var i, ii; var i, ii;
for (i = 0, ii = coordinate.length; i < ii; ++i) { for (i = 0, ii = coordinate.length; i < ii; ++i) {
@@ -30,7 +30,7 @@ ol.geom.flat.deflate.coordinates = function(flatCoordinates, offset, coordinates
var i, ii; var i, ii;
for (i = 0, ii = coordinates.length; i < ii; ++i) { for (i = 0, ii = coordinates.length; i < ii; ++i) {
var coordinate = coordinates[i]; var coordinate = coordinates[i];
goog.DEBUG && console.assert(coordinate.length == stride, ol.DEBUG && console.assert(coordinate.length == stride,
'length of coordinate array should match stride'); 'length of coordinate array should match stride');
var j; var j;
for (j = 0; j < stride; ++j) { for (j = 0; j < stride; ++j) {

View File

@@ -64,7 +64,7 @@ ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance)
// segment. // segment.
flatCoordinates.push(b[0], b[1]); flatCoordinates.push(b[0], b[1]);
key = fracB.toString(); key = fracB.toString();
goog.DEBUG && console.assert(!(key in fractions), ol.DEBUG && console.assert(!(key in fractions),
'fractions object should contain key : ' + key); 'fractions object should contain key : ' + key);
fractions[key] = true; fractions[key] = true;
} else { } else {
@@ -75,7 +75,7 @@ ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance)
geoStack.push(geoB, geoM, geoM, geoA); geoStack.push(geoB, geoM, geoM, geoA);
} }
} }
goog.DEBUG && console.assert(maxIterations > 0, ol.DEBUG && console.assert(maxIterations > 0,
'maxIterations should be more than 0'); 'maxIterations should be more than 0');
return flatCoordinates; return flatCoordinates;

View File

@@ -78,7 +78,7 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
* @return {Array.<number>} Interior points. * @return {Array.<number>} Interior points.
*/ */
ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) { ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) {
goog.DEBUG && console.assert(2 * endss.length == flatCenters.length, ol.DEBUG && console.assert(2 * endss.length == flatCenters.length,
'endss.length times 2 should be flatCenters.length'); 'endss.length times 2 should be flatCenters.length');
var interiorPoints = []; var interiorPoints = [];
var i, ii; var i, ii;

View File

@@ -16,13 +16,13 @@ goog.require('ol.math');
ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, stride, fraction, opt_dest) { ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, stride, fraction, opt_dest) {
// FIXME does not work when vertices are repeated // FIXME does not work when vertices are repeated
// FIXME interpolate extra dimensions // FIXME interpolate extra dimensions
goog.DEBUG && console.assert(0 <= fraction && fraction <= 1, ol.DEBUG && console.assert(0 <= fraction && fraction <= 1,
'fraction should be in between 0 and 1'); 'fraction should be in between 0 and 1');
var pointX = NaN; var pointX = NaN;
var pointY = NaN; var pointY = NaN;
var n = (end - offset) / stride; var n = (end - offset) / stride;
if (n === 0) { if (n === 0) {
goog.DEBUG && console.assert(false, 'n cannot be 0'); ol.DEBUG && console.assert(false, 'n cannot be 0');
} else if (n == 1) { } else if (n == 1) {
pointX = flatCoordinates[offset]; pointX = flatCoordinates[offset];
pointY = flatCoordinates[offset + 1]; pointY = flatCoordinates[offset + 1];
@@ -120,8 +120,8 @@ ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, st
return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride); return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);
} }
var m1 = flatCoordinates[(lo + 1) * stride - 1]; var m1 = flatCoordinates[(lo + 1) * stride - 1];
goog.DEBUG && console.assert(m0 < m, 'm0 should be less than m'); ol.DEBUG && console.assert(m0 < m, 'm0 should be less than m');
goog.DEBUG && console.assert(m <= m1, 'm should be less than or equal to m1'); ol.DEBUG && console.assert(m <= m1, 'm should be less than or equal to m1');
var t = (m - m0) / (m1 - m0); var t = (m - m0) / (m1 - m0);
coordinate = []; coordinate = [];
var i; var i;
@@ -130,7 +130,7 @@ ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, st
flatCoordinates[lo * stride + i], t)); flatCoordinates[lo * stride + i], t));
} }
coordinate.push(m); coordinate.push(m);
goog.DEBUG && console.assert(coordinate.length == stride, ol.DEBUG && console.assert(coordinate.length == stride,
'length of coordinate array should match stride'); 'length of coordinate array should match stride');
return coordinate; return coordinate;
}; };
@@ -185,7 +185,7 @@ ol.geom.flat.lineStringsCoordinateAtM = function(
} }
offset = end; offset = end;
} }
goog.DEBUG && console.assert(false, ol.DEBUG && console.assert(false,
'ol.geom.flat.lineStringsCoordinateAtM should have returned'); 'ol.geom.flat.lineStringsCoordinateAtM should have returned');
return null; return null;
}; };

View File

@@ -106,7 +106,7 @@ ol.geom.flat.intersectsextent.linearRing = function(flatCoordinates, offset, end
* @return {boolean} True if the geometry and the extent intersect. * @return {boolean} True if the geometry and the extent intersect.
*/ */
ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, ends, stride, extent) { ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, ends, stride, extent) {
goog.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array'); ol.DEBUG && console.assert(ends.length > 0, 'ends should not be an empty array');
if (!ol.geom.flat.intersectsextent.linearRing( if (!ol.geom.flat.intersectsextent.linearRing(
flatCoordinates, offset, ends[0], stride, extent)) { flatCoordinates, offset, ends[0], stride, extent)) {
return false; return false;
@@ -134,7 +134,7 @@ ol.geom.flat.intersectsextent.linearRings = function(flatCoordinates, offset, en
* @return {boolean} True if the geometry and the extent intersect. * @return {boolean} True if the geometry and the extent intersect.
*/ */
ol.geom.flat.intersectsextent.linearRingss = function(flatCoordinates, offset, endss, stride, extent) { ol.geom.flat.intersectsextent.linearRingss = function(flatCoordinates, offset, endss, stride, extent) {
goog.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array'); ol.DEBUG && console.assert(endss.length > 0, 'endss should not be an empty array');
var i, ii; var i, ii;
for (i = 0, ii = endss.length; i < ii; ++i) { for (i = 0, ii = endss.length; i < ii; ++i) {
var ends = endss[i]; var ends = endss[i];

View File

@@ -279,7 +279,7 @@ ol.geom.Geometry.prototype.translate = function(deltaX, deltaY) {};
* @api stable * @api stable
*/ */
ol.geom.Geometry.prototype.transform = function(source, destination) { ol.geom.Geometry.prototype.transform = function(source, destination) {
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
ol.proj.get(source).getUnits() !== ol.proj.Units.TILE_PIXELS && ol.proj.get(source).getUnits() !== ol.proj.Units.TILE_PIXELS &&
ol.proj.get(destination).getUnits() !== ol.proj.Units.TILE_PIXELS, ol.proj.get(destination).getUnits() !== ol.proj.Units.TILE_PIXELS,
'cannot transform geometries with TILE_PIXELS units'); 'cannot transform geometries with TILE_PIXELS units');

View File

@@ -66,7 +66,7 @@ ol.inherits(ol.geom.LineString, ol.geom.SimpleGeometry);
* @api stable * @api stable
*/ */
ol.geom.LineString.prototype.appendCoordinate = function(coordinate) { ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
goog.DEBUG && console.assert(coordinate.length == this.stride, ol.DEBUG && console.assert(coordinate.length == this.stride,
'length of coordinate array should match stride'); 'length of coordinate array should match stride');
if (!this.flatCoordinates) { if (!this.flatCoordinates) {
this.flatCoordinates = coordinate.slice(); this.flatCoordinates = coordinate.slice();

View File

@@ -59,7 +59,7 @@ ol.inherits(ol.geom.MultiLineString, ol.geom.SimpleGeometry);
* @api stable * @api stable
*/ */
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) { ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
goog.DEBUG && console.assert(lineString.getLayout() == this.layout, ol.DEBUG && console.assert(lineString.getLayout() == this.layout,
'layout of lineString should match the layout'); 'layout of lineString should match the layout');
if (!this.flatCoordinates) { if (!this.flatCoordinates) {
this.flatCoordinates = lineString.getFlatCoordinates().slice(); this.flatCoordinates = lineString.getFlatCoordinates().slice();
@@ -165,7 +165,7 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
* @api stable * @api stable
*/ */
ol.geom.MultiLineString.prototype.getLineString = function(index) { ol.geom.MultiLineString.prototype.getLineString = function(index) {
goog.DEBUG && console.assert(0 <= index && index < this.ends_.length, ol.DEBUG && console.assert(0 <= index && index < this.ends_.length,
'index should be in between 0 and length of the this.ends_ array'); 'index should be in between 0 and length of the this.ends_ array');
if (index < 0 || this.ends_.length <= index) { if (index < 0 || this.ends_.length <= index) {
return null; return null;
@@ -286,13 +286,13 @@ ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_lay
*/ */
ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
if (!flatCoordinates) { if (!flatCoordinates) {
goog.DEBUG && console.assert(ends && ends.length === 0, ol.DEBUG && console.assert(ends && ends.length === 0,
'ends must be truthy and ends.length should be 0'); 'ends must be truthy and ends.length should be 0');
} else if (ends.length === 0) { } else if (ends.length === 0) {
goog.DEBUG && console.assert(flatCoordinates.length === 0, ol.DEBUG && console.assert(flatCoordinates.length === 0,
'flatCoordinates should be an empty array'); 'flatCoordinates should be an empty array');
} else { } else {
goog.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1], ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
'length of flatCoordinates array should match the last value of ends'); 'length of flatCoordinates array should match the last value of ends');
} }
this.setFlatCoordinatesInternal(layout, flatCoordinates); this.setFlatCoordinatesInternal(layout, flatCoordinates);
@@ -315,7 +315,7 @@ ol.geom.MultiLineString.prototype.setLineStrings = function(lineStrings) {
layout = lineString.getLayout(); layout = lineString.getLayout();
} else { } else {
// FIXME better handle the case of non-matching layouts // FIXME better handle the case of non-matching layouts
goog.DEBUG && console.assert(lineString.getLayout() == layout, ol.DEBUG && console.assert(lineString.getLayout() == layout,
'layout of lineString should match layout'); 'layout of lineString should match layout');
} }
ol.array.extend(flatCoordinates, lineString.getFlatCoordinates()); ol.array.extend(flatCoordinates, lineString.getFlatCoordinates());

View File

@@ -35,7 +35,7 @@ ol.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
* @api stable * @api stable
*/ */
ol.geom.MultiPoint.prototype.appendPoint = function(point) { ol.geom.MultiPoint.prototype.appendPoint = function(point) {
goog.DEBUG && console.assert(point.getLayout() == this.layout, ol.DEBUG && console.assert(point.getLayout() == this.layout,
'the layout of point should match layout'); 'the layout of point should match layout');
if (!this.flatCoordinates) { if (!this.flatCoordinates) {
this.flatCoordinates = point.getFlatCoordinates().slice(); this.flatCoordinates = point.getFlatCoordinates().slice();
@@ -104,7 +104,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
ol.geom.MultiPoint.prototype.getPoint = function(index) { ol.geom.MultiPoint.prototype.getPoint = function(index) {
var n = !this.flatCoordinates ? var n = !this.flatCoordinates ?
0 : this.flatCoordinates.length / this.stride; 0 : this.flatCoordinates.length / this.stride;
goog.DEBUG && console.assert(0 <= index && index < n, ol.DEBUG && console.assert(0 <= index && index < n,
'index should be in between 0 and n'); 'index should be in between 0 and n');
if (index < 0 || n <= index) { if (index < 0 || n <= index) {
return null; return null;

View File

@@ -88,7 +88,7 @@ ol.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
* @api stable * @api stable
*/ */
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) { ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
goog.DEBUG && console.assert(polygon.getLayout() == this.layout, ol.DEBUG && console.assert(polygon.getLayout() == this.layout,
'layout of polygon should match layout'); 'layout of polygon should match layout');
/** @type {Array.<number>} */ /** @type {Array.<number>} */
var ends; var ends;
@@ -279,7 +279,7 @@ ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredT
* @api stable * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getPolygon = function(index) { ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
goog.DEBUG && console.assert(0 <= index && index < this.endss_.length, ol.DEBUG && console.assert(0 <= index && index < this.endss_.length,
'index should be in between 0 and the length of this.endss_'); 'index should be in between 0 and the length of this.endss_');
if (index < 0 || this.endss_.length <= index) { if (index < 0 || this.endss_.length <= index) {
return null; return null;
@@ -389,13 +389,13 @@ ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout
* @param {Array.<Array.<number>>} endss Endss. * @param {Array.<Array.<number>>} endss Endss.
*/ */
ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) { ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
goog.DEBUG && console.assert(endss, 'endss must be truthy'); ol.DEBUG && console.assert(endss, 'endss must be truthy');
if (!flatCoordinates || flatCoordinates.length === 0) { if (!flatCoordinates || flatCoordinates.length === 0) {
goog.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0'); ol.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0');
} else { } else {
goog.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array'); ol.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array');
var ends = endss[endss.length - 1]; var ends = endss[endss.length - 1];
goog.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1], ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
'the length of flatCoordinates should be the last value of ends'); 'the length of flatCoordinates should be the last value of ends');
} }
this.setFlatCoordinatesInternal(layout, flatCoordinates); this.setFlatCoordinatesInternal(layout, flatCoordinates);
@@ -418,7 +418,7 @@ ol.geom.MultiPolygon.prototype.setPolygons = function(polygons) {
layout = polygon.getLayout(); layout = polygon.getLayout();
} else { } else {
// FIXME better handle the case of non-matching layouts // FIXME better handle the case of non-matching layouts
goog.DEBUG && console.assert(polygon.getLayout() == layout, ol.DEBUG && console.assert(polygon.getLayout() == layout,
'layout of polygon should be layout'); 'layout of polygon should be layout');
} }
var offset = flatCoordinates.length; var offset = flatCoordinates.length;

View File

@@ -88,7 +88,7 @@ ol.inherits(ol.geom.Polygon, ol.geom.SimpleGeometry);
* @api stable * @api stable
*/ */
ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) { ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
goog.DEBUG && console.assert(linearRing.getLayout() == this.layout, ol.DEBUG && console.assert(linearRing.getLayout() == this.layout,
'layout of linearRing should match layout'); 'layout of linearRing should match layout');
if (!this.flatCoordinates) { if (!this.flatCoordinates) {
this.flatCoordinates = linearRing.getFlatCoordinates().slice(); this.flatCoordinates = linearRing.getFlatCoordinates().slice();
@@ -236,7 +236,7 @@ ol.geom.Polygon.prototype.getLinearRingCount = function() {
* @api stable * @api stable
*/ */
ol.geom.Polygon.prototype.getLinearRing = function(index) { ol.geom.Polygon.prototype.getLinearRing = function(index) {
goog.DEBUG && console.assert(0 <= index && index < this.ends_.length, ol.DEBUG && console.assert(0 <= index && index < this.ends_.length,
'index should be in between 0 and and length of this.ends_'); 'index should be in between 0 and and length of this.ends_');
if (index < 0 || this.ends_.length <= index) { if (index < 0 || this.ends_.length <= index) {
return null; return null;
@@ -357,13 +357,13 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
*/ */
ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
if (!flatCoordinates) { if (!flatCoordinates) {
goog.DEBUG && console.assert(ends && ends.length === 0, ol.DEBUG && console.assert(ends && ends.length === 0,
'ends must be an empty array'); 'ends must be an empty array');
} else if (ends.length === 0) { } else if (ends.length === 0) {
goog.DEBUG && console.assert(flatCoordinates.length === 0, ol.DEBUG && console.assert(flatCoordinates.length === 0,
'flatCoordinates should be an empty array'); 'flatCoordinates should be an empty array');
} else { } else {
goog.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1], ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
'the length of flatCoordinates should be the last entry of ends'); 'the length of flatCoordinates should be the last entry of ends');
} }
this.setFlatCoordinatesInternal(layout, flatCoordinates); this.setFlatCoordinatesInternal(layout, flatCoordinates);
@@ -460,7 +460,7 @@ ol.geom.Polygon.makeRegular = function(polygon, center, radius, opt_angle) {
var layout = polygon.getLayout(); var layout = polygon.getLayout();
var stride = polygon.getStride(); var stride = polygon.getStride();
var ends = polygon.getEnds(); var ends = polygon.getEnds();
goog.DEBUG && console.assert(ends.length === 1, 'only 1 ring is supported'); ol.DEBUG && console.assert(ends.length === 1, 'only 1 ring is supported');
var sides = flatCoordinates.length / stride - 1; var sides = flatCoordinates.length / stride - 1;
var startAngle = opt_angle ? opt_angle : 0; var startAngle = opt_angle ? opt_angle : 0;
var angle, offset; var angle, offset;

View File

@@ -58,7 +58,7 @@ ol.geom.SimpleGeometry.getLayoutForStride_ = function(stride) {
} else if (stride == 4) { } else if (stride == 4) {
layout = ol.geom.GeometryLayout.XYZM; layout = ol.geom.GeometryLayout.XYZM;
} }
goog.DEBUG && console.assert(layout, 'unsupported stride: ' + stride); ol.DEBUG && console.assert(layout, 'unsupported stride: ' + stride);
return /** @type {ol.geom.GeometryLayout} */ (layout); return /** @type {ol.geom.GeometryLayout} */ (layout);
}; };
@@ -76,7 +76,7 @@ ol.geom.SimpleGeometry.getStrideForLayout = function(layout) {
} else if (layout == ol.geom.GeometryLayout.XYZM) { } else if (layout == ol.geom.GeometryLayout.XYZM) {
stride = 4; stride = 4;
} }
goog.DEBUG && console.assert(stride, 'unsupported layout: ' + layout); ol.DEBUG && console.assert(stride, 'unsupported layout: ' + layout);
return /** @type {number} */ (stride); return /** @type {number} */ (stride);
}; };

View File

@@ -92,7 +92,7 @@ ol.Graticule = function(opt_options) {
* @private * @private
*/ */
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100; this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
goog.DEBUG && console.assert(this.maxLines_ > 0, ol.DEBUG && console.assert(this.maxLines_ > 0,
'this.maxLines_ should be more than 0'); 'this.maxLines_ should be more than 0');
/** /**
@@ -333,13 +333,13 @@ ol.Graticule.prototype.getMap = function() {
*/ */
ol.Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat, ol.Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat,
squaredTolerance, index) { squaredTolerance, index) {
goog.DEBUG && console.assert(lon >= this.minLon_, ol.DEBUG && console.assert(lon >= this.minLon_,
'lon should be larger than or equal to this.minLon_'); 'lon should be larger than or equal to this.minLon_');
goog.DEBUG && console.assert(lon <= this.maxLon_, ol.DEBUG && console.assert(lon <= this.maxLon_,
'lon should be smaller than or equal to this.maxLon_'); 'lon should be smaller than or equal to this.maxLon_');
var flatCoordinates = ol.geom.flat.geodesic.meridian(lon, var flatCoordinates = ol.geom.flat.geodesic.meridian(lon,
minLat, maxLat, this.projection_, squaredTolerance); minLat, maxLat, this.projection_, squaredTolerance);
goog.DEBUG && console.assert(flatCoordinates.length > 0, ol.DEBUG && console.assert(flatCoordinates.length > 0,
'flatCoordinates cannot be empty'); 'flatCoordinates cannot be empty');
var lineString = this.meridians_[index] !== undefined ? var lineString = this.meridians_[index] !== undefined ?
this.meridians_[index] : new ol.geom.LineString(null); this.meridians_[index] : new ol.geom.LineString(null);
@@ -369,13 +369,13 @@ ol.Graticule.prototype.getMeridians = function() {
*/ */
ol.Graticule.prototype.getParallel_ = function(lat, minLon, maxLon, ol.Graticule.prototype.getParallel_ = function(lat, minLon, maxLon,
squaredTolerance, index) { squaredTolerance, index) {
goog.DEBUG && console.assert(lat >= this.minLat_, ol.DEBUG && console.assert(lat >= this.minLat_,
'lat should be larger than or equal to this.minLat_'); 'lat should be larger than or equal to this.minLat_');
goog.DEBUG && console.assert(lat <= this.maxLat_, ol.DEBUG && console.assert(lat <= this.maxLat_,
'lat should be smaller than or equal to this.maxLat_'); 'lat should be smaller than or equal to this.maxLat_');
var flatCoordinates = ol.geom.flat.geodesic.parallel(lat, var flatCoordinates = ol.geom.flat.geodesic.parallel(lat,
this.minLon_, this.maxLon_, this.projection_, squaredTolerance); this.minLon_, this.maxLon_, this.projection_, squaredTolerance);
goog.DEBUG && console.assert(flatCoordinates.length > 0, ol.DEBUG && console.assert(flatCoordinates.length > 0,
'flatCoordinates cannot be empty'); 'flatCoordinates cannot be empty');
var lineString = this.parallels_[index] !== undefined ? var lineString = this.parallels_[index] !== undefined ?
this.parallels_[index] : new ol.geom.LineString(null); this.parallels_[index] : new ol.geom.LineString(null);
@@ -472,18 +472,18 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) {
var minLatP = worldExtentP[1]; var minLatP = worldExtentP[1];
var minLonP = worldExtentP[0]; var minLonP = worldExtentP[0];
goog.DEBUG && console.assert(maxLat !== undefined, 'maxLat should be defined'); ol.DEBUG && console.assert(maxLat !== undefined, 'maxLat should be defined');
goog.DEBUG && console.assert(maxLon !== undefined, 'maxLon should be defined'); ol.DEBUG && console.assert(maxLon !== undefined, 'maxLon should be defined');
goog.DEBUG && console.assert(minLat !== undefined, 'minLat should be defined'); ol.DEBUG && console.assert(minLat !== undefined, 'minLat should be defined');
goog.DEBUG && console.assert(minLon !== undefined, 'minLon should be defined'); ol.DEBUG && console.assert(minLon !== undefined, 'minLon should be defined');
goog.DEBUG && console.assert(maxLatP !== undefined, ol.DEBUG && console.assert(maxLatP !== undefined,
'projected maxLat should be defined'); 'projected maxLat should be defined');
goog.DEBUG && console.assert(maxLonP !== undefined, ol.DEBUG && console.assert(maxLonP !== undefined,
'projected maxLon should be defined'); 'projected maxLon should be defined');
goog.DEBUG && console.assert(minLatP !== undefined, ol.DEBUG && console.assert(minLatP !== undefined,
'projected minLat should be defined'); 'projected minLat should be defined');
goog.DEBUG && console.assert(minLonP !== undefined, ol.DEBUG && console.assert(minLonP !== undefined,
'projected minLon should be defined'); 'projected minLon should be defined');
this.maxLat_ = maxLat; this.maxLat_ = maxLat;

View File

@@ -131,7 +131,7 @@ ol.Image.prototype.load = function() {
if (this.state == ol.Image.State.IDLE || this.state == ol.Image.State.ERROR) { if (this.state == ol.Image.State.IDLE || this.state == ol.Image.State.ERROR) {
this.state = ol.Image.State.LOADING; this.state = ol.Image.State.LOADING;
this.changed(); this.changed();
goog.DEBUG && console.assert(!this.imageListenerKeys_, ol.DEBUG && console.assert(!this.imageListenerKeys_,
'this.imageListenerKeys_ should be null'); 'this.imageListenerKeys_ should be null');
this.imageListenerKeys_ = [ this.imageListenerKeys_ = [
ol.events.listenOnce(this.image_, ol.events.EventType.ERROR, ol.events.listenOnce(this.image_, ol.events.EventType.ERROR,

View File

@@ -96,7 +96,7 @@ ol.ImageBase.prototype.getPixelRatio = function() {
* @return {number} Resolution. * @return {number} Resolution.
*/ */
ol.ImageBase.prototype.getResolution = function() { ol.ImageBase.prototype.getResolution = function() {
goog.DEBUG && console.assert(this.resolution !== undefined, 'resolution not yet set'); ol.DEBUG && console.assert(this.resolution !== undefined, 'resolution not yet set');
return /** @type {number} */ (this.resolution); return /** @type {number} */ (this.resolution);
}; };

View File

@@ -77,7 +77,7 @@ ol.ImageCanvas.prototype.handleLoad_ = function(err) {
*/ */
ol.ImageCanvas.prototype.load = function() { ol.ImageCanvas.prototype.load = function() {
if (this.state == ol.Image.State.IDLE) { if (this.state == ol.Image.State.IDLE) {
goog.DEBUG && console.assert(this.loader_, 'this.loader_ must be set'); ol.DEBUG && console.assert(this.loader_, 'this.loader_ must be set');
this.state = ol.Image.State.LOADING; this.state = ol.Image.State.LOADING;
this.changed(); this.changed();
this.loader_(this.handleLoad_.bind(this)); this.loader_(this.handleLoad_.bind(this));

View File

@@ -145,7 +145,7 @@ ol.ImageTile.prototype.load = function() {
if (this.state == ol.Tile.State.IDLE || this.state == ol.Tile.State.ERROR) { if (this.state == ol.Tile.State.IDLE || this.state == ol.Tile.State.ERROR) {
this.state = ol.Tile.State.LOADING; this.state = ol.Tile.State.LOADING;
this.changed(); this.changed();
goog.DEBUG && console.assert(!this.imageListenerKeys_, ol.DEBUG && console.assert(!this.imageListenerKeys_,
'this.imageListenerKeys_ should be null'); 'this.imageListenerKeys_ should be null');
this.imageListenerKeys_ = [ this.imageListenerKeys_ = [
ol.events.listenOnce(this.image_, ol.events.EventType.ERROR, ol.events.listenOnce(this.image_, ol.events.EventType.ERROR,

View File

@@ -8,6 +8,12 @@ goog.provide('ol');
*/ */
/**
* @define {boolean} Enable debug mode. Default is `true`.
*/
ol.DEBUG = true;
/** /**
* @define {boolean} Assume touch. Default is `false`. * @define {boolean} Assume touch. Default is `false`.
*/ */

View File

@@ -101,7 +101,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) {
if (!projection) { if (!projection) {
var view = map.getView(); var view = map.getView();
projection = view.getProjection(); projection = view.getProjection();
goog.DEBUG && console.assert(projection !== undefined, ol.DEBUG && console.assert(projection !== undefined,
'projection should be defined'); 'projection should be defined');
} }
var formatConstructors = this.formatConstructors_; var formatConstructors = this.formatConstructors_;

View File

@@ -67,7 +67,7 @@ ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
* @private * @private
*/ */
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) { ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
goog.DEBUG && console.assert(this.targetPointers.length >= 1, ol.DEBUG && console.assert(this.targetPointers.length >= 1,
'the length of this.targetPointers should be more than 1'); 'the length of this.targetPointers should be more than 1');
var centroid = var centroid =
ol.interaction.Pointer.centroid(this.targetPointers); ol.interaction.Pointer.centroid(this.targetPointers);

View File

@@ -514,7 +514,7 @@ ol.interaction.Draw.prototype.startDrawing_ = function(event) {
new ol.geom.LineString(this.sketchLineCoords_)); new ol.geom.LineString(this.sketchLineCoords_));
} }
var geometry = this.geometryFunction_(this.sketchCoords_); var geometry = this.geometryFunction_(this.sketchCoords_);
goog.DEBUG && console.assert(geometry !== undefined, 'geometry should be defined'); ol.DEBUG && console.assert(geometry !== undefined, 'geometry should be defined');
this.sketchFeature_ = new ol.Feature(); this.sketchFeature_ = new ol.Feature();
if (this.geometryName_) { if (this.geometryName_) {
this.sketchFeature_.setGeometryName(this.geometryName_); this.sketchFeature_.setGeometryName(this.geometryName_);
@@ -550,7 +550,7 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
} }
last[0] = coordinate[0]; last[0] = coordinate[0];
last[1] = coordinate[1]; last[1] = coordinate[1];
goog.DEBUG && console.assert(this.sketchCoords_, 'sketchCoords_ expected'); ol.DEBUG && console.assert(this.sketchCoords_, 'sketchCoords_ expected');
this.geometryFunction_( this.geometryFunction_(
/** @type {!ol.Coordinate|!Array.<ol.Coordinate>|!Array.<Array.<ol.Coordinate>>} */ (this.sketchCoords_), /** @type {!ol.Coordinate|!Array.<ol.Coordinate>|!Array.<Array.<ol.Coordinate>>} */ (this.sketchCoords_),
geometry); geometry);
@@ -708,9 +708,9 @@ ol.interaction.Draw.prototype.abortDrawing_ = function() {
*/ */
ol.interaction.Draw.prototype.extend = function(feature) { ol.interaction.Draw.prototype.extend = function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
goog.DEBUG && console.assert(this.mode_ == ol.interaction.DrawMode.LINE_STRING, ol.DEBUG && console.assert(this.mode_ == ol.interaction.DrawMode.LINE_STRING,
'interaction mode must be "line"'); 'interaction mode must be "line"');
goog.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.LINE_STRING, ol.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.LINE_STRING,
'feature geometry must be a line string'); 'feature geometry must be a line string');
var lineString = /** @type {ol.geom.LineString} */ (geometry); var lineString = /** @type {ol.geom.LineString} */ (geometry);
this.sketchFeature_ = feature; this.sketchFeature_ = feature;

View File

@@ -975,7 +975,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() {
segments.push(right.segment[1]); segments.push(right.segment[1]);
} }
if (left !== undefined && right !== undefined) { if (left !== undefined && right !== undefined) {
goog.DEBUG && console.assert(newIndex >= 0, 'newIndex should be larger than 0'); ol.DEBUG && console.assert(newIndex >= 0, 'newIndex should be larger than 0');
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({ var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
depth: segmentData.depth, depth: segmentData.depth,

View File

@@ -73,7 +73,7 @@ ol.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer);
* @private * @private
*/ */
ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) { ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
goog.DEBUG && console.assert(this.targetPointers.length >= 2, ol.DEBUG && console.assert(this.targetPointers.length >= 2,
'length of this.targetPointers should be greater than or equal to 2'); 'length of this.targetPointers should be greater than or equal to 2');
var rotationDelta = 0.0; var rotationDelta = 0.0;

View File

@@ -61,7 +61,7 @@ ol.inherits(ol.interaction.PinchZoom, ol.interaction.Pointer);
* @private * @private
*/ */
ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) { ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
goog.DEBUG && console.assert(this.targetPointers.length >= 2, ol.DEBUG && console.assert(this.targetPointers.length >= 2,
'length of this.targetPointers should be 2 or more'); 'length of this.targetPointers should be 2 or more');
var scaleDelta = 1.0; var scaleDelta = 1.0;

View File

@@ -130,7 +130,7 @@ ol.layer.Group.prototype.handleLayersChanged_ = function(event) {
ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) { ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) {
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element); var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
var key = ol.getUid(layer).toString(); var key = ol.getUid(layer).toString();
goog.DEBUG && console.assert(!(key in this.listenerKeys_), ol.DEBUG && console.assert(!(key in this.listenerKeys_),
'listeners already registered'); 'listeners already registered');
this.listenerKeys_[key] = [ this.listenerKeys_[key] = [
ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE, ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE,
@@ -149,7 +149,7 @@ ol.layer.Group.prototype.handleLayersAdd_ = function(collectionEvent) {
ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) { ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) {
var layer = /** @type {ol.layer.Base} */ (collectionEvent.element); var layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
var key = ol.getUid(layer).toString(); var key = ol.getUid(layer).toString();
goog.DEBUG && console.assert(key in this.listenerKeys_, 'no listeners to unregister'); ol.DEBUG && console.assert(key in this.listenerKeys_, 'no listeners to unregister');
this.listenerKeys_[key].forEach(ol.events.unlistenByKey); this.listenerKeys_[key].forEach(ol.events.unlistenByKey);
delete this.listenerKeys_[key]; delete this.listenerKeys_[key];
this.changed(); this.changed();

View File

@@ -100,12 +100,12 @@ ol.layer.Heatmap = function(opt_options) {
} else { } else {
weightFunction = weight; weightFunction = weight;
} }
goog.DEBUG && console.assert(typeof weightFunction === 'function', ol.DEBUG && console.assert(typeof weightFunction === 'function',
'weightFunction should be a function'); 'weightFunction should be a function');
this.setStyle(function(feature, resolution) { this.setStyle(function(feature, resolution) {
goog.DEBUG && console.assert(this.styleCache_, 'this.styleCache_ expected'); ol.DEBUG && console.assert(this.styleCache_, 'this.styleCache_ expected');
goog.DEBUG && console.assert(this.circleImage_ !== undefined, ol.DEBUG && console.assert(this.circleImage_ !== undefined,
'this.circleImage_ should be defined'); 'this.circleImage_ should be defined');
var weight = weightFunction(feature); var weight = weightFunction(feature);
var opacity = weight !== undefined ? ol.math.clamp(weight, 0, 1) : 1; var opacity = weight !== undefined ? ol.math.clamp(weight, 0, 1) : 1;
@@ -173,7 +173,7 @@ ol.layer.Heatmap.createGradient_ = function(colors) {
ol.layer.Heatmap.prototype.createCircle_ = function() { ol.layer.Heatmap.prototype.createCircle_ = function() {
var radius = this.getRadius(); var radius = this.getRadius();
var blur = this.getBlur(); var blur = this.getBlur();
goog.DEBUG && console.assert(radius !== undefined && blur !== undefined, ol.DEBUG && console.assert(radius !== undefined && blur !== undefined,
'radius and blur should be defined'); 'radius and blur should be defined');
var halfSize = radius + blur + 1; var halfSize = radius + blur + 1;
var size = 2 * halfSize; var size = 2 * halfSize;
@@ -246,9 +246,9 @@ ol.layer.Heatmap.prototype.handleStyleChanged_ = function() {
* @private * @private
*/ */
ol.layer.Heatmap.prototype.handleRender_ = function(event) { ol.layer.Heatmap.prototype.handleRender_ = function(event) {
goog.DEBUG && console.assert(event.type == ol.render.EventType.RENDER, ol.DEBUG && console.assert(event.type == ol.render.EventType.RENDER,
'event.type should be RENDER'); 'event.type should be RENDER');
goog.DEBUG && console.assert(this.gradient_, 'this.gradient_ expected'); ol.DEBUG && console.assert(this.gradient_, 'this.gradient_ expected');
var context = event.context; var context = event.context;
var canvas = context.canvas; var canvas = context.canvas;
var image = context.getImageData(0, 0, canvas.width, canvas.height); var image = context.getImageData(0, 0, canvas.width, canvas.height);

View File

@@ -32,7 +32,7 @@ ol.layer.Vector = function(opt_options) {
var options = opt_options ? var options = opt_options ?
opt_options : /** @type {olx.layer.VectorOptions} */ ({}); opt_options : /** @type {olx.layer.VectorOptions} */ ({});
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
options.renderOrder === undefined || !options.renderOrder || options.renderOrder === undefined || !options.renderOrder ||
typeof options.renderOrder === 'function', typeof options.renderOrder === 'function',
'renderOrder must be a comparator function'); 'renderOrder must be a comparator function');
@@ -158,7 +158,7 @@ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() {
* Render order. * Render order.
*/ */
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) { ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
renderOrder === undefined || !renderOrder || renderOrder === undefined || !renderOrder ||
typeof renderOrder === 'function', typeof renderOrder === 'function',
'renderOrder must be a comparator function'); 'renderOrder must be a comparator function');

View File

@@ -1047,7 +1047,7 @@ ol.Map.prototype.handleTargetChanged_ = function() {
var targetElement; var targetElement;
if (this.getTarget()) { if (this.getTarget()) {
targetElement = this.getTargetElement(); targetElement = this.getTargetElement();
goog.DEBUG && console.assert(targetElement !== null, ol.DEBUG && console.assert(targetElement !== null,
'expects a non-null value for targetElement'); 'expects a non-null value for targetElement');
} }

View File

@@ -270,11 +270,11 @@ ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
// to 0). // to 0).
// See http://www.w3.org/TR/pointerevents/#button-states // See http://www.w3.org/TR/pointerevents/#button-states
if (!this.dragging_ && this.isMouseActionButton_(pointerEvent)) { if (!this.dragging_ && this.isMouseActionButton_(pointerEvent)) {
goog.DEBUG && console.assert(this.down_, 'this.down_ must be truthy'); ol.DEBUG && console.assert(this.down_, 'this.down_ must be truthy');
this.emulateClick_(this.down_); this.emulateClick_(this.down_);
} }
goog.DEBUG && console.assert(this.activePointers_ >= 0, ol.DEBUG && console.assert(this.activePointers_ >= 0,
'this.activePointers_ should be equal to or larger than 0'); 'this.activePointers_ should be equal to or larger than 0');
if (this.activePointers_ === 0) { if (this.activePointers_ === 0) {
this.dragListenerKeys_.forEach(ol.events.unlistenByKey); this.dragListenerKeys_.forEach(ol.events.unlistenByKey);

View File

@@ -106,7 +106,7 @@ ol.math.squaredDistance = function(x1, y1, x2, y2) {
ol.math.solveLinearSystem = function(mat) { ol.math.solveLinearSystem = function(mat) {
var n = mat.length; var n = mat.length;
if (goog.DEBUG) { if (ol.DEBUG) {
for (var row = 0; row < n; row++) { for (var row = 0; row < n; row++) {
console.assert(mat[row].length == n + 1, console.assert(mat[row].length == n + 1,
'every row should have correct number of columns'); 'every row should have correct number of columns');

View File

@@ -495,7 +495,7 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
var offset = this.getOffset(); var offset = this.getOffset();
var positioning = this.getPositioning(); var positioning = this.getPositioning();
goog.DEBUG && console.assert(positioning !== undefined, ol.DEBUG && console.assert(positioning !== undefined,
'positioning should be defined'); 'positioning should be defined');
var offsetX = offset[0]; var offsetX = offset[0];

View File

@@ -114,7 +114,7 @@ ol.proj.EPSG3857.fromEPSG4326 = function(input, opt_output, opt_dimension) {
output = new Array(length); output = new Array(length);
} }
} }
goog.DEBUG && console.assert(output.length % dimension === 0, ol.DEBUG && console.assert(output.length % dimension === 0,
'modulus of output.length with dimension should be 0'); 'modulus of output.length with dimension should be 0');
for (var i = 0; i < length; i += dimension) { for (var i = 0; i < length; i += dimension) {
output[i] = ol.proj.EPSG3857.RADIUS * Math.PI * input[i] / 180; output[i] = ol.proj.EPSG3857.RADIUS * Math.PI * input[i] / 180;
@@ -145,7 +145,7 @@ ol.proj.EPSG3857.toEPSG4326 = function(input, opt_output, opt_dimension) {
output = new Array(length); output = new Array(length);
} }
} }
goog.DEBUG && console.assert(output.length % dimension === 0, ol.DEBUG && console.assert(output.length % dimension === 0,
'modulus of output.length with dimension should be 0'); 'modulus of output.length with dimension should be 0');
for (var i = 0; i < length; i += dimension) { for (var i = 0; i < length; i += dimension) {
output[i] = 180 * input[i] / (ol.proj.EPSG3857.RADIUS * Math.PI); output[i] = 180 * input[i] / (ol.proj.EPSG3857.RADIUS * Math.PI);

View File

@@ -136,7 +136,7 @@ ol.proj.Projection = function(options) {
var projections = ol.proj.projections_; var projections = ol.proj.projections_;
var code = options.code; var code = options.code;
goog.DEBUG && console.assert(code !== undefined, ol.DEBUG && console.assert(code !== undefined,
'Option "code" is required for constructing instance'); 'Option "code" is required for constructing instance');
if (ol.ENABLE_PROJ4JS) { if (ol.ENABLE_PROJ4JS) {
var proj4js = ol.proj.proj4_ || ol.global['proj4']; var proj4js = ol.proj.proj4_ || ol.global['proj4'];
@@ -416,7 +416,7 @@ if (ol.ENABLE_PROJ4JS) {
* @api * @api
*/ */
ol.proj.setProj4 = function(proj4) { ol.proj.setProj4 = function(proj4) {
goog.DEBUG && console.assert(typeof proj4 == 'function', ol.DEBUG && console.assert(typeof proj4 == 'function',
'proj4 argument should be a function'); 'proj4 argument should be a function');
ol.proj.proj4_ = proj4; ol.proj.proj4_ = proj4;
}; };
@@ -608,9 +608,9 @@ ol.proj.removeTransform = function(source, destination) {
var sourceCode = source.getCode(); var sourceCode = source.getCode();
var destinationCode = destination.getCode(); var destinationCode = destination.getCode();
var transforms = ol.proj.transforms_; var transforms = ol.proj.transforms_;
goog.DEBUG && console.assert(sourceCode in transforms, ol.DEBUG && console.assert(sourceCode in transforms,
'sourceCode should be in transforms'); 'sourceCode should be in transforms');
goog.DEBUG && console.assert(destinationCode in transforms[sourceCode], ol.DEBUG && console.assert(destinationCode in transforms[sourceCode],
'destinationCode should be in transforms of sourceCode'); 'destinationCode should be in transforms of sourceCode');
var transform = transforms[sourceCode][destinationCode]; var transform = transforms[sourceCode][destinationCode];
delete transforms[sourceCode][destinationCode]; delete transforms[sourceCode][destinationCode];
@@ -741,7 +741,7 @@ ol.proj.getTransformFromProjections = function(sourceProjection, destinationProj
transform = transforms[sourceCode][destinationCode]; transform = transforms[sourceCode][destinationCode];
} }
if (transform === undefined) { if (transform === undefined) {
goog.DEBUG && console.assert(transform !== undefined, 'transform should be defined'); ol.DEBUG && console.assert(transform !== undefined, 'transform should be defined');
transform = ol.proj.identityTransform; transform = ol.proj.identityTransform;
} }
return transform; return transform;
@@ -757,7 +757,7 @@ ol.proj.getTransformFromProjections = function(sourceProjection, destinationProj
ol.proj.identityTransform = function(input, opt_output, opt_dimension) { ol.proj.identityTransform = function(input, opt_output, opt_dimension) {
if (opt_output !== undefined && input !== opt_output) { if (opt_output !== undefined && input !== opt_output) {
// TODO: consider making this a warning instead // TODO: consider making this a warning instead
goog.DEBUG && console.assert(false, 'This should not be used internally.'); ol.DEBUG && console.assert(false, 'This should not be used internally.');
for (var i = 0, ii = input.length; i < ii; ++i) { for (var i = 0, ii = input.length; i < ii; ++i) {
opt_output[i] = input[i]; opt_output[i] = input[i];
} }

View File

@@ -252,8 +252,8 @@ ol.render.canvas.Immediate.prototype.drawImages_ = function(flatCoordinates, off
if (!this.image_) { if (!this.image_) {
return; return;
} }
goog.DEBUG && console.assert(offset === 0, 'offset should be 0'); ol.DEBUG && console.assert(offset === 0, 'offset should be 0');
goog.DEBUG && console.assert(end == flatCoordinates.length, ol.DEBUG && console.assert(end == flatCoordinates.length,
'end should be equal to the length of flatCoordinates'); 'end should be equal to the length of flatCoordinates');
var pixelCoordinates = ol.geom.flat.transform.transform2D( var pixelCoordinates = ol.geom.flat.transform.transform2D(
flatCoordinates, offset, end, 2, this.transform_, flatCoordinates, offset, end, 2, this.transform_,
@@ -317,8 +317,8 @@ ol.render.canvas.Immediate.prototype.drawText_ = function(flatCoordinates, offse
this.setContextStrokeState_(this.textStrokeState_); this.setContextStrokeState_(this.textStrokeState_);
} }
this.setContextTextState_(this.textState_); this.setContextTextState_(this.textState_);
goog.DEBUG && console.assert(offset === 0, 'offset should be 0'); ol.DEBUG && console.assert(offset === 0, 'offset should be 0');
goog.DEBUG && console.assert(end == flatCoordinates.length, ol.DEBUG && console.assert(end == flatCoordinates.length,
'end should be equal to the length of flatCoordinates'); 'end should be equal to the length of flatCoordinates');
var pixelCoordinates = ol.geom.flat.transform.transform2D( var pixelCoordinates = ol.geom.flat.transform.transform2D(
flatCoordinates, offset, end, stride, this.transform_, flatCoordinates, offset, end, stride, this.transform_,
@@ -488,7 +488,7 @@ ol.render.canvas.Immediate.prototype.drawGeometry = function(geometry) {
this.drawCircle(/** @type {ol.geom.Circle} */ (geometry)); this.drawCircle(/** @type {ol.geom.Circle} */ (geometry));
break; break;
default: default:
goog.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type); ol.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type);
} }
}; };
@@ -863,7 +863,7 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) {
var imageImage = imageStyle.getImage(1); var imageImage = imageStyle.getImage(1);
var imageOrigin = imageStyle.getOrigin(); var imageOrigin = imageStyle.getOrigin();
var imageSize = imageStyle.getSize(); var imageSize = imageStyle.getSize();
goog.DEBUG && console.assert(imageImage, 'imageImage must be truthy'); ol.DEBUG && console.assert(imageImage, 'imageImage must be truthy');
this.imageAnchorX_ = imageAnchor[0]; this.imageAnchorX_ = imageAnchor[0];
this.imageAnchorY_ = imageAnchor[1]; this.imageAnchorY_ = imageAnchor[1];
this.imageHeight_ = imageSize[1]; this.imageHeight_ = imageSize[1];

View File

@@ -253,7 +253,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
this.coordinates, 0, this.coordinates.length, 2, this.coordinates, 0, this.coordinates.length, 2,
transform, this.pixelCoordinates_); transform, this.pixelCoordinates_);
ol.transform.setFromArray(this.renderedTransform_, transform); ol.transform.setFromArray(this.renderedTransform_, transform);
goog.DEBUG && console.assert(pixelCoordinates === this.pixelCoordinates_, ol.DEBUG && console.assert(pixelCoordinates === this.pixelCoordinates_,
'pixelCoordinates should be the same as this.pixelCoordinates_'); 'pixelCoordinates should be the same as this.pixelCoordinates_');
} }
var skipFeatures = !ol.obj.isEmpty(skippedFeaturesHash); var skipFeatures = !ol.obj.isEmpty(skippedFeaturesHash);
@@ -303,7 +303,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.CIRCLE: case ol.render.canvas.Instruction.CIRCLE:
goog.DEBUG && console.assert(typeof instruction[1] === 'number', ol.DEBUG && console.assert(typeof instruction[1] === 'number',
'second instruction should be a number'); 'second instruction should be a number');
d = /** @type {number} */ (instruction[1]); d = /** @type {number} */ (instruction[1]);
var x1 = pixelCoordinates[d]; var x1 = pixelCoordinates[d];
@@ -322,10 +322,10 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.DRAW_IMAGE: case ol.render.canvas.Instruction.DRAW_IMAGE:
goog.DEBUG && console.assert(typeof instruction[1] === 'number', ol.DEBUG && console.assert(typeof instruction[1] === 'number',
'second instruction should be a number'); 'second instruction should be a number');
d = /** @type {number} */ (instruction[1]); d = /** @type {number} */ (instruction[1]);
goog.DEBUG && console.assert(typeof instruction[2] === 'number', ol.DEBUG && console.assert(typeof instruction[2] === 'number',
'third instruction should be a number'); 'third instruction should be a number');
dd = /** @type {number} */ (instruction[2]); dd = /** @type {number} */ (instruction[2]);
var image = /** @type {HTMLCanvasElement|HTMLVideoElement|Image} */ var image = /** @type {HTMLCanvasElement|HTMLVideoElement|Image} */
@@ -381,31 +381,31 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.DRAW_TEXT: case ol.render.canvas.Instruction.DRAW_TEXT:
goog.DEBUG && console.assert(typeof instruction[1] === 'number', ol.DEBUG && console.assert(typeof instruction[1] === 'number',
'2nd instruction should be a number'); '2nd instruction should be a number');
d = /** @type {number} */ (instruction[1]); d = /** @type {number} */ (instruction[1]);
goog.DEBUG && console.assert(typeof instruction[2] === 'number', ol.DEBUG && console.assert(typeof instruction[2] === 'number',
'3rd instruction should be a number'); '3rd instruction should be a number');
dd = /** @type {number} */ (instruction[2]); dd = /** @type {number} */ (instruction[2]);
goog.DEBUG && console.assert(typeof instruction[3] === 'string', ol.DEBUG && console.assert(typeof instruction[3] === 'string',
'4th instruction should be a string'); '4th instruction should be a string');
text = /** @type {string} */ (instruction[3]); text = /** @type {string} */ (instruction[3]);
goog.DEBUG && console.assert(typeof instruction[4] === 'number', ol.DEBUG && console.assert(typeof instruction[4] === 'number',
'5th instruction should be a number'); '5th instruction should be a number');
var offsetX = /** @type {number} */ (instruction[4]) * pixelRatio; var offsetX = /** @type {number} */ (instruction[4]) * pixelRatio;
goog.DEBUG && console.assert(typeof instruction[5] === 'number', ol.DEBUG && console.assert(typeof instruction[5] === 'number',
'6th instruction should be a number'); '6th instruction should be a number');
var offsetY = /** @type {number} */ (instruction[5]) * pixelRatio; var offsetY = /** @type {number} */ (instruction[5]) * pixelRatio;
goog.DEBUG && console.assert(typeof instruction[6] === 'number', ol.DEBUG && console.assert(typeof instruction[6] === 'number',
'7th instruction should be a number'); '7th instruction should be a number');
rotation = /** @type {number} */ (instruction[6]); rotation = /** @type {number} */ (instruction[6]);
goog.DEBUG && console.assert(typeof instruction[7] === 'number', ol.DEBUG && console.assert(typeof instruction[7] === 'number',
'8th instruction should be a number'); '8th instruction should be a number');
scale = /** @type {number} */ (instruction[7]) * pixelRatio; scale = /** @type {number} */ (instruction[7]) * pixelRatio;
goog.DEBUG && console.assert(typeof instruction[8] === 'boolean', ol.DEBUG && console.assert(typeof instruction[8] === 'boolean',
'9th instruction should be a boolean'); '9th instruction should be a boolean');
fill = /** @type {boolean} */ (instruction[8]); fill = /** @type {boolean} */ (instruction[8]);
goog.DEBUG && console.assert(typeof instruction[9] === 'boolean', ol.DEBUG && console.assert(typeof instruction[9] === 'boolean',
'10th instruction should be a boolean'); '10th instruction should be a boolean');
stroke = /** @type {boolean} */ (instruction[9]); stroke = /** @type {boolean} */ (instruction[9]);
rotateWithView = /** @type {boolean} */ (instruction[10]); rotateWithView = /** @type {boolean} */ (instruction[10]);
@@ -474,10 +474,10 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.MOVE_TO_LINE_TO: case ol.render.canvas.Instruction.MOVE_TO_LINE_TO:
goog.DEBUG && console.assert(typeof instruction[1] === 'number', ol.DEBUG && console.assert(typeof instruction[1] === 'number',
'2nd instruction should be a number'); '2nd instruction should be a number');
d = /** @type {number} */ (instruction[1]); d = /** @type {number} */ (instruction[1]);
goog.DEBUG && console.assert(typeof instruction[2] === 'number', ol.DEBUG && console.assert(typeof instruction[2] === 'number',
'3rd instruction should be a number'); '3rd instruction should be a number');
dd = /** @type {number} */ (instruction[2]); dd = /** @type {number} */ (instruction[2]);
x = pixelCoordinates[d]; x = pixelCoordinates[d];
@@ -503,7 +503,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.SET_FILL_STYLE: case ol.render.canvas.Instruction.SET_FILL_STYLE:
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
ol.colorlike.isColorLike(instruction[1]), ol.colorlike.isColorLike(instruction[1]),
'2nd instruction should be a string, ' + '2nd instruction should be a string, ' +
'CanvasPattern, or CanvasGradient'); 'CanvasPattern, or CanvasGradient');
@@ -516,17 +516,17 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.SET_STROKE_STYLE: case ol.render.canvas.Instruction.SET_STROKE_STYLE:
goog.DEBUG && console.assert(typeof instruction[1] === 'string', ol.DEBUG && console.assert(typeof instruction[1] === 'string',
'2nd instruction should be a string'); '2nd instruction should be a string');
goog.DEBUG && console.assert(typeof instruction[2] === 'number', ol.DEBUG && console.assert(typeof instruction[2] === 'number',
'3rd instruction should be a number'); '3rd instruction should be a number');
goog.DEBUG && console.assert(typeof instruction[3] === 'string', ol.DEBUG && console.assert(typeof instruction[3] === 'string',
'4rd instruction should be a string'); '4rd instruction should be a string');
goog.DEBUG && console.assert(typeof instruction[4] === 'string', ol.DEBUG && console.assert(typeof instruction[4] === 'string',
'5th instruction should be a string'); '5th instruction should be a string');
goog.DEBUG && console.assert(typeof instruction[5] === 'number', ol.DEBUG && console.assert(typeof instruction[5] === 'number',
'6th instruction should be a number'); '6th instruction should be a number');
goog.DEBUG && console.assert(instruction[6], ol.DEBUG && console.assert(instruction[6],
'7th instruction should not be null'); '7th instruction should not be null');
var usePixelRatio = instruction[7] !== undefined ? var usePixelRatio = instruction[7] !== undefined ?
instruction[7] : true; instruction[7] : true;
@@ -548,11 +548,11 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
case ol.render.canvas.Instruction.SET_TEXT_STYLE: case ol.render.canvas.Instruction.SET_TEXT_STYLE:
goog.DEBUG && console.assert(typeof instruction[1] === 'string', ol.DEBUG && console.assert(typeof instruction[1] === 'string',
'2nd instruction should be a string'); '2nd instruction should be a string');
goog.DEBUG && console.assert(typeof instruction[2] === 'string', ol.DEBUG && console.assert(typeof instruction[2] === 'string',
'3rd instruction should be a string'); '3rd instruction should be a string');
goog.DEBUG && console.assert(typeof instruction[3] === 'string', ol.DEBUG && console.assert(typeof instruction[3] === 'string',
'4th instruction should be a string'); '4th instruction should be a string');
context.font = /** @type {string} */ (instruction[1]); context.font = /** @type {string} */ (instruction[1]);
context.textAlign = /** @type {string} */ (instruction[2]); context.textAlign = /** @type {string} */ (instruction[2]);
@@ -568,7 +568,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
++i; ++i;
break; break;
default: default:
goog.DEBUG && console.assert(false, 'Unknown canvas render instruction'); ol.DEBUG && console.assert(false, 'Unknown canvas render instruction');
++i; // consume the instruction anyway, to avoid an infinite loop ++i; // consume the instruction anyway, to avoid an infinite loop
break; break;
} }
@@ -580,7 +580,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
context.stroke(); context.stroke();
} }
// assert that all instructions were consumed // assert that all instructions were consumed
goog.DEBUG && console.assert(i == instructions.length, ol.DEBUG && console.assert(i == instructions.length,
'all instructions should be consumed'); 'all instructions should be consumed');
return undefined; return undefined;
}; };
@@ -641,11 +641,11 @@ ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ = function()
instruction = hitDetectionInstructions[i]; instruction = hitDetectionInstructions[i];
type = /** @type {ol.render.canvas.Instruction} */ (instruction[0]); type = /** @type {ol.render.canvas.Instruction} */ (instruction[0]);
if (type == ol.render.canvas.Instruction.END_GEOMETRY) { if (type == ol.render.canvas.Instruction.END_GEOMETRY) {
goog.DEBUG && console.assert(begin == -1, 'begin should be -1'); ol.DEBUG && console.assert(begin == -1, 'begin should be -1');
begin = i; begin = i;
} else if (type == ol.render.canvas.Instruction.BEGIN_GEOMETRY) { } else if (type == ol.render.canvas.Instruction.BEGIN_GEOMETRY) {
instruction[2] = i; instruction[2] = i;
goog.DEBUG && console.assert(begin >= 0, ol.DEBUG && console.assert(begin >= 0,
'begin should be larger than or equal to 0'); 'begin should be larger than or equal to 0');
ol.array.reverseSubArray(this.hitDetectionInstructions, begin, i); ol.array.reverseSubArray(this.hitDetectionInstructions, begin, i);
begin = -1; begin = -1;
@@ -659,11 +659,11 @@ ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ = function()
* @param {ol.Feature|ol.render.Feature} feature Feature. * @param {ol.Feature|ol.render.Feature} feature Feature.
*/ */
ol.render.canvas.Replay.prototype.endGeometry = function(geometry, feature) { ol.render.canvas.Replay.prototype.endGeometry = function(geometry, feature) {
goog.DEBUG && console.assert(this.beginGeometryInstruction1_, ol.DEBUG && console.assert(this.beginGeometryInstruction1_,
'this.beginGeometryInstruction1_ should not be null'); 'this.beginGeometryInstruction1_ should not be null');
this.beginGeometryInstruction1_[2] = this.instructions.length; this.beginGeometryInstruction1_[2] = this.instructions.length;
this.beginGeometryInstruction1_ = null; this.beginGeometryInstruction1_ = null;
goog.DEBUG && console.assert(this.beginGeometryInstruction2_, ol.DEBUG && console.assert(this.beginGeometryInstruction2_,
'this.beginGeometryInstruction2_ should not be null'); 'this.beginGeometryInstruction2_ should not be null');
this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length; this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;
this.beginGeometryInstruction2_ = null; this.beginGeometryInstruction2_ = null;
@@ -808,25 +808,25 @@ ol.render.canvas.ImageReplay.prototype.drawPoint = function(pointGeometry, featu
if (!this.image_) { if (!this.image_) {
return; return;
} }
goog.DEBUG && console.assert(this.anchorX_ !== undefined, ol.DEBUG && console.assert(this.anchorX_ !== undefined,
'this.anchorX_ should be defined'); 'this.anchorX_ should be defined');
goog.DEBUG && console.assert(this.anchorY_ !== undefined, ol.DEBUG && console.assert(this.anchorY_ !== undefined,
'this.anchorY_ should be defined'); 'this.anchorY_ should be defined');
goog.DEBUG && console.assert(this.height_ !== undefined, ol.DEBUG && console.assert(this.height_ !== undefined,
'this.height_ should be defined'); 'this.height_ should be defined');
goog.DEBUG && console.assert(this.opacity_ !== undefined, ol.DEBUG && console.assert(this.opacity_ !== undefined,
'this.opacity_ should be defined'); 'this.opacity_ should be defined');
goog.DEBUG && console.assert(this.originX_ !== undefined, ol.DEBUG && console.assert(this.originX_ !== undefined,
'this.originX_ should be defined'); 'this.originX_ should be defined');
goog.DEBUG && console.assert(this.originY_ !== undefined, ol.DEBUG && console.assert(this.originY_ !== undefined,
'this.originY_ should be defined'); 'this.originY_ should be defined');
goog.DEBUG && console.assert(this.rotateWithView_ !== undefined, ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
'this.rotateWithView_ should be defined'); 'this.rotateWithView_ should be defined');
goog.DEBUG && console.assert(this.rotation_ !== undefined, ol.DEBUG && console.assert(this.rotation_ !== undefined,
'this.rotation_ should be defined'); 'this.rotation_ should be defined');
goog.DEBUG && console.assert(this.scale_ !== undefined, ol.DEBUG && console.assert(this.scale_ !== undefined,
'this.scale_ should be defined'); 'this.scale_ should be defined');
goog.DEBUG && console.assert(this.width_ !== undefined, ol.DEBUG && console.assert(this.width_ !== undefined,
'this.width_ should be defined'); 'this.width_ should be defined');
this.beginGeometry(pointGeometry, feature); this.beginGeometry(pointGeometry, feature);
var flatCoordinates = pointGeometry.getFlatCoordinates(); var flatCoordinates = pointGeometry.getFlatCoordinates();
@@ -860,25 +860,25 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPoint = function(multiPointGeome
if (!this.image_) { if (!this.image_) {
return; return;
} }
goog.DEBUG && console.assert(this.anchorX_ !== undefined, ol.DEBUG && console.assert(this.anchorX_ !== undefined,
'this.anchorX_ should be defined'); 'this.anchorX_ should be defined');
goog.DEBUG && console.assert(this.anchorY_ !== undefined, ol.DEBUG && console.assert(this.anchorY_ !== undefined,
'this.anchorY_ should be defined'); 'this.anchorY_ should be defined');
goog.DEBUG && console.assert(this.height_ !== undefined, ol.DEBUG && console.assert(this.height_ !== undefined,
'this.height_ should be defined'); 'this.height_ should be defined');
goog.DEBUG && console.assert(this.opacity_ !== undefined, ol.DEBUG && console.assert(this.opacity_ !== undefined,
'this.opacity_ should be defined'); 'this.opacity_ should be defined');
goog.DEBUG && console.assert(this.originX_ !== undefined, ol.DEBUG && console.assert(this.originX_ !== undefined,
'this.originX_ should be defined'); 'this.originX_ should be defined');
goog.DEBUG && console.assert(this.originY_ !== undefined, ol.DEBUG && console.assert(this.originY_ !== undefined,
'this.originY_ should be defined'); 'this.originY_ should be defined');
goog.DEBUG && console.assert(this.rotateWithView_ !== undefined, ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
'this.rotateWithView_ should be defined'); 'this.rotateWithView_ should be defined');
goog.DEBUG && console.assert(this.rotation_ !== undefined, ol.DEBUG && console.assert(this.rotation_ !== undefined,
'this.rotation_ should be defined'); 'this.rotation_ should be defined');
goog.DEBUG && console.assert(this.scale_ !== undefined, ol.DEBUG && console.assert(this.scale_ !== undefined,
'this.scale_ should be defined'); 'this.scale_ should be defined');
goog.DEBUG && console.assert(this.width_ !== undefined, ol.DEBUG && console.assert(this.width_ !== undefined,
'this.width_ should be defined'); 'this.width_ should be defined');
this.beginGeometry(multiPointGeometry, feature); this.beginGeometry(multiPointGeometry, feature);
var flatCoordinates = multiPointGeometry.getFlatCoordinates(); var flatCoordinates = multiPointGeometry.getFlatCoordinates();
@@ -931,18 +931,18 @@ ol.render.canvas.ImageReplay.prototype.finish = function() {
* @inheritDoc * @inheritDoc
*/ */
ol.render.canvas.ImageReplay.prototype.setImageStyle = function(imageStyle) { ol.render.canvas.ImageReplay.prototype.setImageStyle = function(imageStyle) {
goog.DEBUG && console.assert(imageStyle, 'imageStyle should not be null'); ol.DEBUG && console.assert(imageStyle, 'imageStyle should not be null');
var anchor = imageStyle.getAnchor(); var anchor = imageStyle.getAnchor();
goog.DEBUG && console.assert(anchor, 'anchor should not be null'); ol.DEBUG && console.assert(anchor, 'anchor should not be null');
var size = imageStyle.getSize(); var size = imageStyle.getSize();
goog.DEBUG && console.assert(size, 'size should not be null'); ol.DEBUG && console.assert(size, 'size should not be null');
var hitDetectionImage = imageStyle.getHitDetectionImage(1); var hitDetectionImage = imageStyle.getHitDetectionImage(1);
goog.DEBUG && console.assert(hitDetectionImage, ol.DEBUG && console.assert(hitDetectionImage,
'hitDetectionImage should not be null'); 'hitDetectionImage should not be null');
var image = imageStyle.getImage(1); var image = imageStyle.getImage(1);
goog.DEBUG && console.assert(image, 'image should not be null'); ol.DEBUG && console.assert(image, 'image should not be null');
var origin = imageStyle.getOrigin(); var origin = imageStyle.getOrigin();
goog.DEBUG && console.assert(origin, 'origin should not be null'); ol.DEBUG && console.assert(origin, 'origin should not be null');
this.anchorX_ = anchor[0]; this.anchorX_ = anchor[0];
this.anchorY_ = anchor[1]; this.anchorY_ = anchor[1];
this.hitDetectionImage_ = hitDetectionImage; this.hitDetectionImage_ = hitDetectionImage;
@@ -1055,13 +1055,13 @@ ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_ = function() {
var lineJoin = state.lineJoin; var lineJoin = state.lineJoin;
var lineWidth = state.lineWidth; var lineWidth = state.lineWidth;
var miterLimit = state.miterLimit; var miterLimit = state.miterLimit;
goog.DEBUG && console.assert(strokeStyle !== undefined, ol.DEBUG && console.assert(strokeStyle !== undefined,
'strokeStyle should be defined'); 'strokeStyle should be defined');
goog.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined'); ol.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined');
goog.DEBUG && console.assert(lineDash, 'lineDash should not be null'); ol.DEBUG && console.assert(lineDash, 'lineDash should not be null');
goog.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined'); ol.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined');
goog.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth should be defined'); ol.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth should be defined');
goog.DEBUG && console.assert(miterLimit !== undefined, 'miterLimit should be defined'); ol.DEBUG && console.assert(miterLimit !== undefined, 'miterLimit should be defined');
if (state.currentStrokeStyle != strokeStyle || if (state.currentStrokeStyle != strokeStyle ||
state.currentLineCap != lineCap || state.currentLineCap != lineCap ||
!ol.array.equals(state.currentLineDash, lineDash) || !ol.array.equals(state.currentLineDash, lineDash) ||
@@ -1092,7 +1092,7 @@ ol.render.canvas.LineStringReplay.prototype.setStrokeStyle_ = function() {
*/ */
ol.render.canvas.LineStringReplay.prototype.drawLineString = function(lineStringGeometry, feature) { ol.render.canvas.LineStringReplay.prototype.drawLineString = function(lineStringGeometry, feature) {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
var strokeStyle = state.strokeStyle; var strokeStyle = state.strokeStyle;
var lineWidth = state.lineWidth; var lineWidth = state.lineWidth;
if (strokeStyle === undefined || lineWidth === undefined) { if (strokeStyle === undefined || lineWidth === undefined) {
@@ -1119,7 +1119,7 @@ ol.render.canvas.LineStringReplay.prototype.drawLineString = function(lineString
*/ */
ol.render.canvas.LineStringReplay.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) { ol.render.canvas.LineStringReplay.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
var strokeStyle = state.strokeStyle; var strokeStyle = state.strokeStyle;
var lineWidth = state.lineWidth; var lineWidth = state.lineWidth;
if (strokeStyle === undefined || lineWidth === undefined) { if (strokeStyle === undefined || lineWidth === undefined) {
@@ -1151,7 +1151,7 @@ ol.render.canvas.LineStringReplay.prototype.drawMultiLineString = function(multi
*/ */
ol.render.canvas.LineStringReplay.prototype.finish = function() { ol.render.canvas.LineStringReplay.prototype.finish = function() {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
if (state.lastStroke != this.coordinates.length) { if (state.lastStroke != this.coordinates.length) {
this.instructions.push([ol.render.canvas.Instruction.STROKE]); this.instructions.push([ol.render.canvas.Instruction.STROKE]);
} }
@@ -1164,9 +1164,9 @@ ol.render.canvas.LineStringReplay.prototype.finish = function() {
* @inheritDoc * @inheritDoc
*/ */
ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { ol.render.canvas.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
goog.DEBUG && console.assert(this.state_, 'this.state_ should not be null'); ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
goog.DEBUG && console.assert(!fillStyle, 'fillStyle should be null'); ol.DEBUG && console.assert(!fillStyle, 'fillStyle should be null');
goog.DEBUG && console.assert(strokeStyle, 'strokeStyle should not be null'); ol.DEBUG && console.assert(strokeStyle, 'strokeStyle should not be null');
var strokeStyleColor = strokeStyle.getColor(); var strokeStyleColor = strokeStyle.getColor();
this.state_.strokeStyle = ol.color.asString(strokeStyleColor ? this.state_.strokeStyle = ol.color.asString(strokeStyleColor ?
strokeStyleColor : ol.render.canvas.defaultStrokeStyle); strokeStyleColor : ol.render.canvas.defaultStrokeStyle);
@@ -1291,7 +1291,7 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo
this.instructions.push(fillInstruction); this.instructions.push(fillInstruction);
} }
if (stroke) { if (stroke) {
goog.DEBUG && console.assert(state.lineWidth !== undefined, ol.DEBUG && console.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
var strokeInstruction = [ol.render.canvas.Instruction.STROKE]; var strokeInstruction = [ol.render.canvas.Instruction.STROKE];
this.instructions.push(strokeInstruction); this.instructions.push(strokeInstruction);
@@ -1306,14 +1306,14 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo
*/ */
ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, feature) { ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, feature) {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
var fillStyle = state.fillStyle; var fillStyle = state.fillStyle;
var strokeStyle = state.strokeStyle; var strokeStyle = state.strokeStyle;
if (fillStyle === undefined && strokeStyle === undefined) { if (fillStyle === undefined && strokeStyle === undefined) {
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.DEBUG && console.assert(state.lineWidth !== undefined, ol.DEBUG && console.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();
@@ -1343,7 +1343,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, f
this.instructions.push(fillInstruction); this.instructions.push(fillInstruction);
} }
if (state.strokeStyle !== undefined) { if (state.strokeStyle !== undefined) {
goog.DEBUG && console.assert(state.lineWidth !== undefined, ol.DEBUG && console.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
var strokeInstruction = [ol.render.canvas.Instruction.STROKE]; var strokeInstruction = [ol.render.canvas.Instruction.STROKE];
this.instructions.push(strokeInstruction); this.instructions.push(strokeInstruction);
@@ -1358,14 +1358,14 @@ ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, f
*/ */
ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) { ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
var fillStyle = state.fillStyle; var fillStyle = state.fillStyle;
var strokeStyle = state.strokeStyle; var strokeStyle = state.strokeStyle;
if (fillStyle === undefined && strokeStyle === undefined) { if (fillStyle === undefined && strokeStyle === undefined) {
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.DEBUG && console.assert(state.lineWidth !== undefined, ol.DEBUG && console.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();
@@ -1393,14 +1393,14 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry,
*/ */
ol.render.canvas.PolygonReplay.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) { ol.render.canvas.PolygonReplay.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {
var state = this.state_; var state = this.state_;
goog.DEBUG && console.assert(state, 'state should not be null'); ol.DEBUG && console.assert(state, 'state should not be null');
var fillStyle = state.fillStyle; var fillStyle = state.fillStyle;
var strokeStyle = state.strokeStyle; var strokeStyle = state.strokeStyle;
if (fillStyle === undefined && strokeStyle === undefined) { if (fillStyle === undefined && strokeStyle === undefined) {
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.DEBUG && console.assert(state.lineWidth !== undefined, ol.DEBUG && console.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();
@@ -1432,7 +1432,7 @@ ol.render.canvas.PolygonReplay.prototype.drawMultiPolygon = function(multiPolygo
* @inheritDoc * @inheritDoc
*/ */
ol.render.canvas.PolygonReplay.prototype.finish = function() { ol.render.canvas.PolygonReplay.prototype.finish = function() {
goog.DEBUG && console.assert(this.state_, 'this.state_ should not be null'); ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
this.reverseHitDetectionInstructions_(); this.reverseHitDetectionInstructions_();
this.state_ = null; this.state_ = null;
// We want to preserve topology when drawing polygons. Polygons are // We want to preserve topology when drawing polygons. Polygons are
@@ -1469,8 +1469,8 @@ ol.render.canvas.PolygonReplay.prototype.getBufferedMaxExtent = function() {
* @inheritDoc * @inheritDoc
*/ */
ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
goog.DEBUG && console.assert(this.state_, 'this.state_ should not be null'); ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
goog.DEBUG && console.assert(fillStyle || strokeStyle, ol.DEBUG && console.assert(fillStyle || strokeStyle,
'fillStyle or strokeStyle should not be null'); 'fillStyle or strokeStyle should not be null');
var state = this.state_; var state = this.state_;
if (fillStyle) { if (fillStyle) {
@@ -1534,11 +1534,11 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_ = function() {
state.currentFillStyle = state.fillStyle; state.currentFillStyle = state.fillStyle;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined'); ol.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined');
goog.DEBUG && console.assert(lineDash, 'lineDash should not be null'); ol.DEBUG && console.assert(lineDash, 'lineDash should not be null');
goog.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined'); ol.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined');
goog.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth should be defined'); ol.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth should be defined');
goog.DEBUG && console.assert(miterLimit !== undefined, ol.DEBUG && console.assert(miterLimit !== undefined,
'miterLimit should be defined'); 'miterLimit should be defined');
if (state.currentStrokeStyle != strokeStyle || if (state.currentStrokeStyle != strokeStyle ||
state.currentLineCap != lineCap || state.currentLineCap != lineCap ||
@@ -2025,7 +2025,7 @@ ol.render.canvas.ReplayGroup.prototype.getReplay = function(zIndex, replayType)
var replay = replays[replayType]; var replay = replays[replayType];
if (replay === undefined) { if (replay === undefined) {
var Constructor = ol.render.canvas.BATCH_CONSTRUCTORS_[replayType]; var Constructor = ol.render.canvas.BATCH_CONSTRUCTORS_[replayType];
goog.DEBUG && console.assert(Constructor !== undefined, ol.DEBUG && console.assert(Constructor !== undefined,
replayType + replayType +
' constructor missing from ol.render.canvas.BATCH_CONSTRUCTORS_'); ' constructor missing from ol.render.canvas.BATCH_CONSTRUCTORS_');
replay = new Constructor(this.tolerance_, this.maxExtent_, replay = new Constructor(this.tolerance_, this.maxExtent_,

View File

@@ -25,7 +25,7 @@ ol.render.Feature = function(type, flatCoordinates, ends, properties) {
*/ */
this.extent_; this.extent_;
goog.DEBUG && console.assert(type === ol.geom.GeometryType.POINT || ol.DEBUG && console.assert(type === ol.geom.GeometryType.POINT ||
type === ol.geom.GeometryType.MULTI_POINT || type === ol.geom.GeometryType.MULTI_POINT ||
type === ol.geom.GeometryType.LINE_STRING || type === ol.geom.GeometryType.LINE_STRING ||
type === ol.geom.GeometryType.MULTI_LINE_STRING || type === ol.geom.GeometryType.MULTI_LINE_STRING ||

View File

@@ -35,7 +35,7 @@ ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE = 'precision
* @const * @const
* @type {string} * @type {string}
*/ */
ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = goog.DEBUG ? ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.DEBUG ?
ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE : ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE :
ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
@@ -72,7 +72,7 @@ ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE = 'varying vec
* @const * @const
* @type {string} * @type {string}
*/ */
ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = goog.DEBUG ? ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.DEBUG ?
ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE : ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE :
ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE; ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
@@ -92,59 +92,59 @@ ol.render.webgl.imagereplay.defaultshader.Locations = function(gl, program) {
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_image = gl.getUniformLocation( this.u_image = gl.getUniformLocation(
program, goog.DEBUG ? 'u_image' : 'l'); program, ol.DEBUG ? 'u_image' : 'l');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetRotateMatrix = gl.getUniformLocation( this.u_offsetRotateMatrix = gl.getUniformLocation(
program, goog.DEBUG ? 'u_offsetRotateMatrix' : 'j'); program, ol.DEBUG ? 'u_offsetRotateMatrix' : 'j');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_offsetScaleMatrix = gl.getUniformLocation( this.u_offsetScaleMatrix = gl.getUniformLocation(
program, goog.DEBUG ? 'u_offsetScaleMatrix' : 'i'); program, ol.DEBUG ? 'u_offsetScaleMatrix' : 'i');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, goog.DEBUG ? 'u_opacity' : 'k'); program, ol.DEBUG ? 'u_opacity' : 'k');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, goog.DEBUG ? 'u_projectionMatrix' : 'h'); program, ol.DEBUG ? 'u_projectionMatrix' : 'h');
/** /**
* @type {number} * @type {number}
*/ */
this.a_offsets = gl.getAttribLocation( this.a_offsets = gl.getAttribLocation(
program, goog.DEBUG ? 'a_offsets' : 'e'); program, ol.DEBUG ? 'a_offsets' : 'e');
/** /**
* @type {number} * @type {number}
*/ */
this.a_opacity = gl.getAttribLocation( this.a_opacity = gl.getAttribLocation(
program, goog.DEBUG ? 'a_opacity' : 'f'); program, ol.DEBUG ? 'a_opacity' : 'f');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, goog.DEBUG ? 'a_position' : 'c'); program, ol.DEBUG ? 'a_position' : 'c');
/** /**
* @type {number} * @type {number}
*/ */
this.a_rotateWithView = gl.getAttribLocation( this.a_rotateWithView = gl.getAttribLocation(
program, goog.DEBUG ? 'a_rotateWithView' : 'g'); program, ol.DEBUG ? 'a_rotateWithView' : 'g');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, goog.DEBUG ? 'a_texCoord' : 'd'); program, ol.DEBUG ? 'a_texCoord' : 'd');
}; };

View File

@@ -224,9 +224,9 @@ ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = function(cont
// be used by other ImageReplay instances (for other layers). And // be used by other ImageReplay instances (for other layers). And
// they will be deleted when disposing of the ol.webgl.Context // they will be deleted when disposing of the ol.webgl.Context
// object. // object.
goog.DEBUG && console.assert(this.verticesBuffer_, ol.DEBUG && console.assert(this.verticesBuffer_,
'verticesBuffer must not be null'); 'verticesBuffer must not be null');
goog.DEBUG && console.assert(this.indicesBuffer_, ol.DEBUG && console.assert(this.indicesBuffer_,
'indicesBuffer must not be null'); 'indicesBuffer must not be null');
var verticesBuffer = this.verticesBuffer_; var verticesBuffer = this.verticesBuffer_;
var indicesBuffer = this.indicesBuffer_; var indicesBuffer = this.indicesBuffer_;
@@ -258,20 +258,20 @@ ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = function(cont
* @private * @private
*/ */
ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = function(flatCoordinates, offset, end, stride) { ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = function(flatCoordinates, offset, end, stride) {
goog.DEBUG && console.assert(this.anchorX_ !== undefined, 'anchorX is defined'); ol.DEBUG && console.assert(this.anchorX_ !== undefined, 'anchorX is defined');
goog.DEBUG && console.assert(this.anchorY_ !== undefined, 'anchorY is defined'); ol.DEBUG && console.assert(this.anchorY_ !== undefined, 'anchorY is defined');
goog.DEBUG && console.assert(this.height_ !== undefined, 'height is defined'); ol.DEBUG && console.assert(this.height_ !== undefined, 'height is defined');
goog.DEBUG && console.assert(this.imageHeight_ !== undefined, ol.DEBUG && console.assert(this.imageHeight_ !== undefined,
'imageHeight is defined'); 'imageHeight is defined');
goog.DEBUG && console.assert(this.imageWidth_ !== undefined, 'imageWidth is defined'); ol.DEBUG && console.assert(this.imageWidth_ !== undefined, 'imageWidth is defined');
goog.DEBUG && console.assert(this.opacity_ !== undefined, 'opacity is defined'); ol.DEBUG && console.assert(this.opacity_ !== undefined, 'opacity is defined');
goog.DEBUG && console.assert(this.originX_ !== undefined, 'originX is defined'); ol.DEBUG && console.assert(this.originX_ !== undefined, 'originX is defined');
goog.DEBUG && console.assert(this.originY_ !== undefined, 'originY is defined'); ol.DEBUG && console.assert(this.originY_ !== undefined, 'originY is defined');
goog.DEBUG && console.assert(this.rotateWithView_ !== undefined, ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
'rotateWithView is defined'); 'rotateWithView is defined');
goog.DEBUG && console.assert(this.rotation_ !== undefined, 'rotation is defined'); ol.DEBUG && console.assert(this.rotation_ !== undefined, 'rotation is defined');
goog.DEBUG && console.assert(this.scale_ !== undefined, 'scale is defined'); ol.DEBUG && console.assert(this.scale_ !== undefined, 'scale is defined');
goog.DEBUG && console.assert(this.width_ !== undefined, 'width is defined'); ol.DEBUG && console.assert(this.width_ !== undefined, 'width is defined');
var anchorX = /** @type {number} */ (this.anchorX_); var anchorX = /** @type {number} */ (this.anchorX_);
var anchorY = /** @type {number} */ (this.anchorY_); var anchorY = /** @type {number} */ (this.anchorY_);
var height = /** @type {number} */ (this.height_); var height = /** @type {number} */ (this.height_);
@@ -398,10 +398,10 @@ ol.render.webgl.ImageReplay.prototype.finish = function(context) {
var gl = context.getGL(); var gl = context.getGL();
this.groupIndices_.push(this.indices_.length); this.groupIndices_.push(this.indices_.length);
goog.DEBUG && console.assert(this.images_.length === this.groupIndices_.length, ol.DEBUG && console.assert(this.images_.length === this.groupIndices_.length,
'number of images and groupIndices match'); 'number of images and groupIndices match');
this.hitDetectionGroupIndices_.push(this.indices_.length); this.hitDetectionGroupIndices_.push(this.indices_.length);
goog.DEBUG && console.assert(this.hitDetectionImages_.length === ol.DEBUG && console.assert(this.hitDetectionImages_.length ===
this.hitDetectionGroupIndices_.length, this.hitDetectionGroupIndices_.length,
'number of hitDetectionImages and hitDetectionGroupIndices match'); 'number of hitDetectionImages and hitDetectionGroupIndices match');
@@ -411,7 +411,7 @@ ol.render.webgl.ImageReplay.prototype.finish = function(context) {
var indices = this.indices_; var indices = this.indices_;
var bits = context.hasOESElementIndexUint ? 32 : 16; var bits = context.hasOESElementIndexUint ? 32 : 16;
goog.DEBUG && console.assert(indices[indices.length - 1] < Math.pow(2, bits), ol.DEBUG && console.assert(indices[indices.length - 1] < Math.pow(2, bits),
'Too large element index detected [%s] (OES_element_index_uint "%s")', 'Too large element index detected [%s] (OES_element_index_uint "%s")',
indices[indices.length - 1], context.hasOESElementIndexUint); indices[indices.length - 1], context.hasOESElementIndexUint);
@@ -424,12 +424,12 @@ ol.render.webgl.ImageReplay.prototype.finish = function(context) {
var texturePerImage = {}; var texturePerImage = {};
this.createTextures_(this.textures_, this.images_, texturePerImage, gl); this.createTextures_(this.textures_, this.images_, texturePerImage, gl);
goog.DEBUG && console.assert(this.textures_.length === this.groupIndices_.length, ol.DEBUG && console.assert(this.textures_.length === this.groupIndices_.length,
'number of textures and groupIndices match'); 'number of textures and groupIndices match');
this.createTextures_(this.hitDetectionTextures_, this.hitDetectionImages_, this.createTextures_(this.hitDetectionTextures_, this.hitDetectionImages_,
texturePerImage, gl); texturePerImage, gl);
goog.DEBUG && console.assert(this.hitDetectionTextures_.length === ol.DEBUG && console.assert(this.hitDetectionTextures_.length ===
this.hitDetectionGroupIndices_.length, this.hitDetectionGroupIndices_.length,
'number of hitDetectionTextures and hitDetectionGroupIndices match'); 'number of hitDetectionTextures and hitDetectionGroupIndices match');
@@ -461,7 +461,7 @@ ol.render.webgl.ImageReplay.prototype.finish = function(context) {
* @param {WebGLRenderingContext} gl Gl. * @param {WebGLRenderingContext} gl Gl.
*/ */
ol.render.webgl.ImageReplay.prototype.createTextures_ = function(textures, images, texturePerImage, gl) { ol.render.webgl.ImageReplay.prototype.createTextures_ = function(textures, images, texturePerImage, gl) {
goog.DEBUG && console.assert(textures.length === 0, ol.DEBUG && console.assert(textures.length === 0,
'upon creation, textures is empty'); 'upon creation, textures is empty');
var texture, image, uid, i; var texture, image, uid, i;
@@ -506,12 +506,12 @@ ol.render.webgl.ImageReplay.prototype.replay = function(context,
var gl = context.getGL(); var gl = context.getGL();
// bind the vertices buffer // bind the vertices buffer
goog.DEBUG && console.assert(this.verticesBuffer_, ol.DEBUG && console.assert(this.verticesBuffer_,
'verticesBuffer must not be null'); 'verticesBuffer must not be null');
context.bindBuffer(ol.webgl.ARRAY_BUFFER, this.verticesBuffer_); context.bindBuffer(ol.webgl.ARRAY_BUFFER, this.verticesBuffer_);
// bind the indices buffer // bind the indices buffer
goog.DEBUG && console.assert(this.indicesBuffer_, ol.DEBUG && console.assert(this.indicesBuffer_,
'indecesBuffer must not be null'); 'indecesBuffer must not be null');
context.bindBuffer(ol.webgl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer_); context.bindBuffer(ol.webgl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer_);
@@ -608,7 +608,7 @@ ol.render.webgl.ImageReplay.prototype.replay = function(context,
* @param {Array.<number>} groupIndices Texture group indices. * @param {Array.<number>} groupIndices Texture group indices.
*/ */
ol.render.webgl.ImageReplay.prototype.drawReplay_ = function(gl, context, skippedFeaturesHash, textures, groupIndices) { ol.render.webgl.ImageReplay.prototype.drawReplay_ = function(gl, context, skippedFeaturesHash, textures, groupIndices) {
goog.DEBUG && console.assert(textures.length === groupIndices.length, ol.DEBUG && console.assert(textures.length === groupIndices.length,
'number of textures and groupIndeces match'); 'number of textures and groupIndeces match');
var elementType = context.hasOESElementIndexUint ? var elementType = context.hasOESElementIndexUint ?
ol.webgl.UNSIGNED_INT : ol.webgl.UNSIGNED_SHORT; ol.webgl.UNSIGNED_INT : ol.webgl.UNSIGNED_SHORT;
@@ -782,7 +782,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = function(gl,
*/ */
ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ = function(gl, context, skippedFeaturesHash, featureCallback, ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ = function(gl, context, skippedFeaturesHash, featureCallback,
opt_hitExtent) { opt_hitExtent) {
goog.DEBUG && console.assert(this.hitDetectionTextures_.length === ol.DEBUG && console.assert(this.hitDetectionTextures_.length ===
this.hitDetectionGroupIndices_.length, this.hitDetectionGroupIndices_.length,
'number of hitDetectionTextures and hitDetectionGroupIndices match'); 'number of hitDetectionTextures and hitDetectionGroupIndices match');
var elementType = context.hasOESElementIndexUint ? var elementType = context.hasOESElementIndexUint ?
@@ -847,21 +847,21 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) {
var rotation = imageStyle.getRotation(); var rotation = imageStyle.getRotation();
var size = imageStyle.getSize(); var size = imageStyle.getSize();
var scale = imageStyle.getScale(); var scale = imageStyle.getScale();
goog.DEBUG && console.assert(anchor, 'imageStyle anchor is not null'); ol.DEBUG && console.assert(anchor, 'imageStyle anchor is not null');
goog.DEBUG && console.assert(image, 'imageStyle image is not null'); ol.DEBUG && console.assert(image, 'imageStyle image is not null');
goog.DEBUG && console.assert(imageSize, ol.DEBUG && console.assert(imageSize,
'imageStyle imageSize is not null'); 'imageStyle imageSize is not null');
goog.DEBUG && console.assert(hitDetectionImage, ol.DEBUG && console.assert(hitDetectionImage,
'imageStyle hitDetectionImage is not null'); 'imageStyle hitDetectionImage is not null');
goog.DEBUG && console.assert(hitDetectionImageSize, ol.DEBUG && console.assert(hitDetectionImageSize,
'imageStyle hitDetectionImageSize is not null'); 'imageStyle hitDetectionImageSize is not null');
goog.DEBUG && console.assert(opacity !== undefined, 'imageStyle opacity is defined'); ol.DEBUG && console.assert(opacity !== undefined, 'imageStyle opacity is defined');
goog.DEBUG && console.assert(origin, 'imageStyle origin is not null'); ol.DEBUG && console.assert(origin, 'imageStyle origin is not null');
goog.DEBUG && console.assert(rotateWithView !== undefined, ol.DEBUG && console.assert(rotateWithView !== undefined,
'imageStyle rotateWithView is defined'); 'imageStyle rotateWithView is defined');
goog.DEBUG && console.assert(rotation !== undefined, 'imageStyle rotation is defined'); ol.DEBUG && console.assert(rotation !== undefined, 'imageStyle rotation is defined');
goog.DEBUG && console.assert(size, 'imageStyle size is not null'); ol.DEBUG && console.assert(size, 'imageStyle size is not null');
goog.DEBUG && console.assert(scale !== undefined, 'imageStyle scale is defined'); ol.DEBUG && console.assert(scale !== undefined, 'imageStyle scale is defined');
var currentImage; var currentImage;
if (this.images_.length === 0) { if (this.images_.length === 0) {
@@ -870,7 +870,7 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) {
currentImage = this.images_[this.images_.length - 1]; currentImage = this.images_[this.images_.length - 1];
if (ol.getUid(currentImage) != ol.getUid(image)) { if (ol.getUid(currentImage) != ol.getUid(image)) {
this.groupIndices_.push(this.indices_.length); this.groupIndices_.push(this.indices_.length);
goog.DEBUG && console.assert(this.groupIndices_.length === this.images_.length, ol.DEBUG && console.assert(this.groupIndices_.length === this.images_.length,
'number of groupIndices and images match'); 'number of groupIndices and images match');
this.images_.push(image); this.images_.push(image);
} }
@@ -883,7 +883,7 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) {
this.hitDetectionImages_[this.hitDetectionImages_.length - 1]; this.hitDetectionImages_[this.hitDetectionImages_.length - 1];
if (ol.getUid(currentImage) != ol.getUid(hitDetectionImage)) { if (ol.getUid(currentImage) != ol.getUid(hitDetectionImage)) {
this.hitDetectionGroupIndices_.push(this.indices_.length); this.hitDetectionGroupIndices_.push(this.indices_.length);
goog.DEBUG && console.assert(this.hitDetectionGroupIndices_.length === ol.DEBUG && console.assert(this.hitDetectionGroupIndices_.length ===
this.hitDetectionImages_.length, this.hitDetectionImages_.length,
'number of hitDetectionGroupIndices and hitDetectionImages match'); 'number of hitDetectionGroupIndices and hitDetectionImages match');
this.hitDetectionImages_.push(hitDetectionImage); this.hitDetectionImages_.push(hitDetectionImage);

View File

@@ -100,7 +100,7 @@ ol.render.webgl.Immediate.prototype.drawGeometry = function(geometry) {
this.drawGeometryCollection(/** @type {ol.geom.GeometryCollection} */ (geometry), null); this.drawGeometryCollection(/** @type {ol.geom.GeometryCollection} */ (geometry), null);
break; break;
default: default:
goog.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type); ol.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type);
} }
}; };
@@ -116,7 +116,7 @@ ol.render.webgl.Immediate.prototype.drawFeature = function(feature, style) {
return; return;
} }
this.setStyle(style); this.setStyle(style);
goog.DEBUG && console.assert(geometry, 'geometry must be truthy'); ol.DEBUG && console.assert(geometry, 'geometry must be truthy');
this.drawGeometry(geometry); this.drawGeometry(geometry);
}; };

View File

@@ -167,7 +167,7 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame = function(frameState, laye
if (!ol.ENABLE_RASTER_REPROJECTION) { if (!ol.ENABLE_RASTER_REPROJECTION) {
var sourceProjection = imageSource.getProjection(); var sourceProjection = imageSource.getProjection();
if (sourceProjection) { if (sourceProjection) {
goog.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection), ol.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection),
'projection and sourceProjection are equivalent'); 'projection and sourceProjection are equivalent');
projection = sourceProjection; projection = sourceProjection;
} }

View File

@@ -81,7 +81,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) {
} else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) { } else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) {
return new ol.renderer.canvas.VectorLayer(layer); return new ol.renderer.canvas.VectorLayer(layer);
} else { } else {
goog.DEBUG && console.assert(false, 'unexpected layer configuration'); ol.DEBUG && console.assert(false, 'unexpected layer configuration');
return null; return null;
} }
}; };

View File

@@ -96,7 +96,7 @@ ol.renderer.dom.ImageLayer.prototype.prepareFrame = function(frameState, layerSt
if (!ol.ENABLE_RASTER_REPROJECTION) { if (!ol.ENABLE_RASTER_REPROJECTION) {
var sourceProjection = imageSource.getProjection(); var sourceProjection = imageSource.getProjection();
if (sourceProjection) { if (sourceProjection) {
goog.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection), ol.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection),
'projection and sourceProjection are equivalent'); 'projection and sourceProjection are equivalent');
projection = sourceProjection; projection = sourceProjection;
} }

View File

@@ -99,7 +99,7 @@ ol.renderer.dom.Map.prototype.createLayerRenderer = function(layer) {
} else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) { } else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) {
layerRenderer = new ol.renderer.dom.VectorLayer(layer); layerRenderer = new ol.renderer.dom.VectorLayer(layer);
} else { } else {
goog.DEBUG && console.assert(false, 'unexpected layer configuration'); ol.DEBUG && console.assert(false, 'unexpected layer configuration');
return null; return null;
} }
return layerRenderer; return layerRenderer;

View File

@@ -329,7 +329,7 @@ ol.renderer.dom.TileLayerZ_.prototype.addTile = function(tile, tileGutter) {
var tileCoordZ = tileCoord[0]; var tileCoordZ = tileCoord[0];
var tileCoordX = tileCoord[1]; var tileCoordX = tileCoord[1];
var tileCoordY = tileCoord[2]; var tileCoordY = tileCoord[2];
goog.DEBUG && console.assert(tileCoordZ == this.tileCoordOrigin_[0], ol.DEBUG && console.assert(tileCoordZ == this.tileCoordOrigin_[0],
'tileCoordZ matches z of tileCoordOrigin'); 'tileCoordZ matches z of tileCoordOrigin');
var tileCoordKey = tileCoord.toString(); var tileCoordKey = tileCoord.toString();
if (tileCoordKey in this.tiles_) { if (tileCoordKey in this.tiles_) {

View File

@@ -141,7 +141,7 @@ ol.renderer.Layer.prototype.loadImage = function(image) {
imageState != ol.Image.State.ERROR) { imageState != ol.Image.State.ERROR) {
// the image is either "idle" or "loading", register the change // the image is either "idle" or "loading", register the change
// listener (a noop if the listener was already registered) // listener (a noop if the listener was already registered)
goog.DEBUG && console.assert(imageState == ol.Image.State.IDLE || ol.DEBUG && console.assert(imageState == ol.Image.State.IDLE ||
imageState == ol.Image.State.LOADING, imageState == ol.Image.State.LOADING,
'imageState is "idle" or "loading"'); 'imageState is "idle" or "loading"');
ol.events.listen(image, ol.events.EventType.CHANGE, ol.events.listen(image, ol.events.EventType.CHANGE,
@@ -150,7 +150,7 @@ ol.renderer.Layer.prototype.loadImage = function(image) {
if (imageState == ol.Image.State.IDLE) { if (imageState == ol.Image.State.IDLE) {
image.load(); image.load();
imageState = image.getState(); imageState = image.getState();
goog.DEBUG && console.assert(imageState == ol.Image.State.LOADING || ol.DEBUG && console.assert(imageState == ol.Image.State.LOADING ||
imageState == ol.Image.State.LOADED, imageState == ol.Image.State.LOADED,
'imageState is "loading" or "loaded"'); 'imageState is "loading" or "loaded"');
} }

View File

@@ -65,7 +65,7 @@ ol.renderer.Map.prototype.calculateMatrices2D = function(frameState) {
var viewState = frameState.viewState; var viewState = frameState.viewState;
var coordinateToPixelTransform = frameState.coordinateToPixelTransform; var coordinateToPixelTransform = frameState.coordinateToPixelTransform;
var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform; var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;
goog.DEBUG && console.assert(coordinateToPixelTransform, ol.DEBUG && console.assert(coordinateToPixelTransform,
'frameState has a coordinateToPixelTransform'); 'frameState has a coordinateToPixelTransform');
ol.transform.compose(coordinateToPixelTransform, ol.transform.compose(coordinateToPixelTransform,
@@ -263,7 +263,7 @@ ol.renderer.Map.prototype.getLayerRenderer = function(layer) {
* @return {ol.renderer.Layer} Layer renderer. * @return {ol.renderer.Layer} Layer renderer.
*/ */
ol.renderer.Map.prototype.getLayerRendererByKey = function(layerKey) { ol.renderer.Map.prototype.getLayerRendererByKey = function(layerKey) {
goog.DEBUG && console.assert(layerKey in this.layerRenderers_, ol.DEBUG && console.assert(layerKey in this.layerRenderers_,
'given layerKey (%s) exists in layerRenderers', layerKey); 'given layerKey (%s) exists in layerRenderers', layerKey);
return this.layerRenderers_[layerKey]; return this.layerRenderers_[layerKey];
}; };
@@ -308,12 +308,12 @@ ol.renderer.Map.prototype.handleLayerRendererChange_ = function() {
* @private * @private
*/ */
ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) { ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) {
goog.DEBUG && console.assert(layerKey in this.layerRenderers_, ol.DEBUG && console.assert(layerKey in this.layerRenderers_,
'given layerKey (%s) exists in layerRenderers', layerKey); 'given layerKey (%s) exists in layerRenderers', layerKey);
var layerRenderer = this.layerRenderers_[layerKey]; var layerRenderer = this.layerRenderers_[layerKey];
delete this.layerRenderers_[layerKey]; delete this.layerRenderers_[layerKey];
goog.DEBUG && console.assert(layerKey in this.layerRendererListeners_, ol.DEBUG && console.assert(layerKey in this.layerRendererListeners_,
'given layerKey (%s) exists in layerRendererListeners', layerKey); 'given layerKey (%s) exists in layerRendererListeners', layerKey);
ol.events.unlistenByKey(this.layerRendererListeners_[layerKey]); ol.events.unlistenByKey(this.layerRendererListeners_[layerKey]);
delete this.layerRendererListeners_[layerKey]; delete this.layerRendererListeners_[layerKey];

View File

@@ -87,7 +87,7 @@ ol.renderer.vector.renderFeature = function(
imageStyle.load(); imageStyle.load();
} }
imageState = imageStyle.getImageState(); imageState = imageStyle.getImageState();
goog.DEBUG && console.assert(imageState == ol.Image.State.LOADING, ol.DEBUG && console.assert(imageState == ol.Image.State.LOADING,
'imageState should be LOADING'); 'imageState should be LOADING');
imageStyle.listenImageChange(listener, thisArg); imageStyle.listenImageChange(listener, thisArg);
loading = true; loading = true;

View File

@@ -35,7 +35,7 @@ ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE = 'precision medium
* @const * @const
* @type {string} * @type {string}
*/ */
ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = goog.DEBUG ? ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.DEBUG ?
ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE : ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE :
ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE;
@@ -72,7 +72,7 @@ ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE = 'varying vec2 a;att
* @const * @const
* @type {string} * @type {string}
*/ */
ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = goog.DEBUG ? ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.DEBUG ?
ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE : ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE :
ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE;
@@ -92,35 +92,35 @@ ol.renderer.webgl.defaultmapshader.Locations = function(gl, program) {
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_opacity = gl.getUniformLocation( this.u_opacity = gl.getUniformLocation(
program, goog.DEBUG ? 'u_opacity' : 'f'); program, ol.DEBUG ? 'u_opacity' : 'f');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_projectionMatrix = gl.getUniformLocation( this.u_projectionMatrix = gl.getUniformLocation(
program, goog.DEBUG ? 'u_projectionMatrix' : 'e'); program, ol.DEBUG ? 'u_projectionMatrix' : 'e');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texCoordMatrix = gl.getUniformLocation( this.u_texCoordMatrix = gl.getUniformLocation(
program, goog.DEBUG ? 'u_texCoordMatrix' : 'd'); program, ol.DEBUG ? 'u_texCoordMatrix' : 'd');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texture = gl.getUniformLocation( this.u_texture = gl.getUniformLocation(
program, goog.DEBUG ? 'u_texture' : 'g'); program, ol.DEBUG ? 'u_texture' : 'g');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, goog.DEBUG ? 'a_position' : 'b'); program, ol.DEBUG ? 'a_position' : 'b');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, goog.DEBUG ? 'a_texCoord' : 'c'); program, ol.DEBUG ? 'a_texCoord' : 'c');
}; };

View File

@@ -118,7 +118,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
if (!ol.ENABLE_RASTER_REPROJECTION) { if (!ol.ENABLE_RASTER_REPROJECTION) {
var sourceProjection = imageSource.getProjection(); var sourceProjection = imageSource.getProjection();
if (sourceProjection) { if (sourceProjection) {
goog.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection), ol.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection),
'projection and sourceProjection are equivalent'); 'projection and sourceProjection are equivalent');
projection = sourceProjection; projection = sourceProjection;
} }
@@ -149,7 +149,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
} }
if (image) { if (image) {
goog.DEBUG && console.assert(texture, 'texture is truthy'); ol.DEBUG && console.assert(texture, 'texture is truthy');
var canvas = this.mapRenderer.getContext().getCanvas(); var canvas = this.mapRenderer.getContext().getCanvas();

View File

@@ -83,7 +83,7 @@ ol.renderer.webgl.Map = function(container, map) {
preserveDrawingBuffer: false, preserveDrawingBuffer: false,
stencil: true stencil: true
}); });
goog.DEBUG && console.assert(this.gl_, 'got a WebGLRenderingContext'); ol.DEBUG && console.assert(this.gl_, 'got a WebGLRenderingContext');
/** /**
* @private * @private
@@ -244,7 +244,7 @@ ol.renderer.webgl.Map.prototype.createLayerRenderer = function(layer) {
} else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) { } else if (ol.ENABLE_VECTOR && layer instanceof ol.layer.Vector) {
return new ol.renderer.webgl.VectorLayer(this, layer); return new ol.renderer.webgl.VectorLayer(this, layer);
} else { } else {
goog.DEBUG && console.assert(false, 'unexpected layer configuration'); ol.DEBUG && console.assert(false, 'unexpected layer configuration');
return null; return null;
} }
}; };

View File

@@ -35,7 +35,7 @@ ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE = 'precision mediump
* @const * @const
* @type {string} * @type {string}
*/ */
ol.renderer.webgl.tilelayershader.Fragment.SOURCE = goog.DEBUG ? ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.DEBUG ?
ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE : ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE :
ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE;
@@ -72,7 +72,7 @@ ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE = 'varying vec2 a;attr
* @const * @const
* @type {string} * @type {string}
*/ */
ol.renderer.webgl.tilelayershader.Vertex.SOURCE = goog.DEBUG ? ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.DEBUG ?
ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE : ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE :
ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE; ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE;
@@ -92,23 +92,23 @@ ol.renderer.webgl.tilelayershader.Locations = function(gl, program) {
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_texture = gl.getUniformLocation( this.u_texture = gl.getUniformLocation(
program, goog.DEBUG ? 'u_texture' : 'e'); program, ol.DEBUG ? 'u_texture' : 'e');
/** /**
* @type {WebGLUniformLocation} * @type {WebGLUniformLocation}
*/ */
this.u_tileOffset = gl.getUniformLocation( this.u_tileOffset = gl.getUniformLocation(
program, goog.DEBUG ? 'u_tileOffset' : 'd'); program, ol.DEBUG ? 'u_tileOffset' : 'd');
/** /**
* @type {number} * @type {number}
*/ */
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, goog.DEBUG ? 'a_position' : 'b'); program, ol.DEBUG ? 'a_position' : 'b');
/** /**
* @type {number} * @type {number}
*/ */
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, goog.DEBUG ? 'a_texCoord' : 'c'); program, ol.DEBUG ? 'a_texCoord' : 'c');
}; };

View File

@@ -194,7 +194,7 @@ ol.reproj.Image.prototype.load = function() {
* @private * @private
*/ */
ol.reproj.Image.prototype.unlistenSource_ = function() { ol.reproj.Image.prototype.unlistenSource_ = function() {
goog.DEBUG && console.assert(this.sourceListenerKey_, ol.DEBUG && console.assert(this.sourceListenerKey_,
'this.sourceListenerKey_ should not be null'); 'this.sourceListenerKey_ should not be null');
ol.events.unlistenByKey(/** @type {!ol.EventsKey} */ (this.sourceListenerKey_)); ol.events.unlistenByKey(/** @type {!ol.EventsKey} */ (this.sourceListenerKey_));
this.sourceListenerKey_ = null; this.sourceListenerKey_ = null;

View File

@@ -180,7 +180,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
sourceExtent, this.sourceZ_); sourceExtent, this.sourceZ_);
var tilesRequired = sourceRange.getWidth() * sourceRange.getHeight(); var tilesRequired = sourceRange.getWidth() * sourceRange.getHeight();
if (goog.DEBUG && !(tilesRequired < ol.RASTER_REPROJECTION_MAX_SOURCE_TILES)) { if (ol.DEBUG && !(tilesRequired < ol.RASTER_REPROJECTION_MAX_SOURCE_TILES)) {
console.assert(false, 'reasonable number of tiles is required'); console.assert(false, 'reasonable number of tiles is required');
this.state = ol.Tile.State.ERROR; this.state = ol.Tile.State.ERROR;
return; return;
@@ -283,7 +283,7 @@ ol.reproj.Tile.prototype.load = function() {
var leftToLoad = 0; var leftToLoad = 0;
goog.DEBUG && console.assert(!this.sourcesListenerKeys_, ol.DEBUG && console.assert(!this.sourcesListenerKeys_,
'this.sourcesListenerKeys_ should be null'); 'this.sourcesListenerKeys_ should be null');
this.sourcesListenerKeys_ = []; this.sourcesListenerKeys_ = [];
@@ -301,7 +301,7 @@ ol.reproj.Tile.prototype.load = function() {
state == ol.Tile.State.EMPTY) { state == ol.Tile.State.EMPTY) {
ol.events.unlistenByKey(sourceListenKey); ol.events.unlistenByKey(sourceListenKey);
leftToLoad--; leftToLoad--;
goog.DEBUG && console.assert(leftToLoad >= 0, ol.DEBUG && console.assert(leftToLoad >= 0,
'leftToLoad should not be negative'); 'leftToLoad should not be negative');
if (leftToLoad === 0) { if (leftToLoad === 0) {
this.unlistenSources_(); this.unlistenSources_();

View File

@@ -118,7 +118,7 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent,
// Fix coordinates (ol.proj returns wrapped coordinates, "unwrap" here). // Fix coordinates (ol.proj returns wrapped coordinates, "unwrap" here).
// This significantly simplifies the rest of the reprojection process. // This significantly simplifies the rest of the reprojection process.
goog.DEBUG && console.assert(this.sourceWorldWidth_ !== null); ol.DEBUG && console.assert(this.sourceWorldWidth_ !== null);
var leftBound = Infinity; var leftBound = Infinity;
this.triangles_.forEach(function(triangle, i, arr) { this.triangles_.forEach(function(triangle, i, arr) {
leftBound = Math.min(leftBound, leftBound = Math.min(leftBound,

View File

@@ -91,7 +91,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response)
} }
//var copyright = response.copyright; // FIXME do we need to display this? //var copyright = response.copyright; // FIXME do we need to display this?
var resource = response.resourceSets[0].resources[0]; var resource = response.resourceSets[0].resources[0];
goog.DEBUG && console.assert(resource.imageWidth == resource.imageHeight, ol.DEBUG && console.assert(resource.imageWidth == resource.imageHeight,
'resource has imageWidth equal to imageHeight, i.e. is square'); 'resource has imageWidth equal to imageHeight, i.e. is square');
var maxZoom = this.maxZoom_ == -1 ? resource.zoomMax : this.maxZoom_; var maxZoom = this.maxZoom_ == -1 ? resource.zoomMax : this.maxZoom_;
@@ -122,7 +122,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response)
* @return {string|undefined} Tile URL. * @return {string|undefined} Tile URL.
*/ */
function(tileCoord, pixelRatio, projection) { function(tileCoord, pixelRatio, projection) {
goog.DEBUG && console.assert(ol.proj.equivalent( ol.DEBUG && console.assert(ol.proj.equivalent(
projection, sourceProjection), projection, sourceProjection),
'projections are equivalent'); 'projections are equivalent');
if (!tileCoord) { if (!tileCoord) {

View File

@@ -149,7 +149,7 @@ ol.source.Cluster.prototype.cluster_ = function() {
ol.extent.buffer(extent, mapDistance, extent); ol.extent.buffer(extent, mapDistance, extent);
var neighbors = this.source_.getFeaturesInExtent(extent); var neighbors = this.source_.getFeaturesInExtent(extent);
goog.DEBUG && console.assert(neighbors.length >= 1, 'at least one neighbor found'); ol.DEBUG && console.assert(neighbors.length >= 1, 'at least one neighbor found');
neighbors = neighbors.filter(function(neighbor) { neighbors = neighbors.filter(function(neighbor) {
var uid = ol.getUid(neighbor).toString(); var uid = ol.getUid(neighbor).toString();
if (!(uid in clustered)) { if (!(uid in clustered)) {
@@ -163,7 +163,7 @@ ol.source.Cluster.prototype.cluster_ = function() {
} }
} }
} }
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
Object.keys(clustered).length == this.source_.getFeatures().length, Object.keys(clustered).length == this.source_.getFeatures().length,
'number of clustered equals number of features in the source'); 'number of clustered equals number of features in the source');
}; };

View File

@@ -38,7 +38,7 @@ ol.source.Image = function(options) {
*/ */
this.resolutions_ = options.resolutions !== undefined ? this.resolutions_ = options.resolutions !== undefined ?
options.resolutions : null; options.resolutions : null;
goog.DEBUG && console.assert(!this.resolutions_ || ol.DEBUG && console.assert(!this.resolutions_ ||
ol.array.isSorted(this.resolutions_, ol.array.isSorted(this.resolutions_,
function(a, b) { function(a, b) {
return b - a; return b - a;

View File

@@ -195,7 +195,7 @@ ol.source.ImageArcGISRest.prototype.getImageLoadFunction = function() {
*/ */
ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) { ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) {
goog.DEBUG && console.assert(this.url_ !== undefined, 'url is defined'); ol.DEBUG && console.assert(this.url_ !== undefined, 'url is defined');
// ArcGIS Server only wants the numeric portion of the projection ID. // ArcGIS Server only wants the numeric portion of the projection ID.
var srid = projection.getCode().split(':').pop(); var srid = projection.getCode().split(':').pop();

View File

@@ -135,7 +135,7 @@ ol.source.ImageWMS.GETFEATUREINFO_IMAGE_SIZE_ = [101, 101];
*/ */
ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) { ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) {
goog.DEBUG && console.assert(!('VERSION' in params), ol.DEBUG && console.assert(!('VERSION' in params),
'key VERSION is not allowed in params'); 'key VERSION is not allowed in params');
if (this.url_ === undefined) { if (this.url_ === undefined) {

View File

@@ -425,7 +425,7 @@ ol.source.Raster.createRenderer_ = function(source) {
} else if (source instanceof ol.source.Image) { } else if (source instanceof ol.source.Image) {
renderer = ol.source.Raster.createImageRenderer_(source); renderer = ol.source.Raster.createImageRenderer_(source);
} else { } else {
goog.DEBUG && console.assert(false, 'Unsupported source type: ' + source); ol.DEBUG && console.assert(false, 'Unsupported source type: ' + source);
} }
return renderer; return renderer;
}; };

View File

@@ -89,11 +89,11 @@ ol.source.Stamen = function(options) {
var i = options.layer.indexOf('-'); var i = options.layer.indexOf('-');
var provider = i == -1 ? options.layer : options.layer.slice(0, i); var provider = i == -1 ? options.layer : options.layer.slice(0, i);
goog.DEBUG && console.assert(provider in ol.source.StamenProviderConfig, ol.DEBUG && console.assert(provider in ol.source.StamenProviderConfig,
'known provider configured'); 'known provider configured');
var providerConfig = ol.source.StamenProviderConfig[provider]; var providerConfig = ol.source.StamenProviderConfig[provider];
goog.DEBUG && console.assert(options.layer in ol.source.StamenLayerConfig, ol.DEBUG && console.assert(options.layer in ol.source.StamenLayerConfig,
'known layer configured'); 'known layer configured');
var layerConfig = ol.source.StamenLayerConfig[options.layer]; var layerConfig = ol.source.StamenLayerConfig[options.layer];

View File

@@ -303,8 +303,8 @@ ol.source.TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, pr
// cases we attempt to assign an interim tile to the new tile. // cases we attempt to assign an interim tile to the new tile.
var /** @type {ol.Tile} */ interimTile = tile; var /** @type {ol.Tile} */ interimTile = tile;
if (tile.interimTile && tile.interimTile.key == key) { if (tile.interimTile && tile.interimTile.key == key) {
goog.DEBUG && console.assert(tile.interimTile.getState() == ol.Tile.State.LOADED); ol.DEBUG && console.assert(tile.interimTile.getState() == ol.Tile.State.LOADED);
goog.DEBUG && console.assert(tile.interimTile.interimTile === null); ol.DEBUG && console.assert(tile.interimTile.interimTile === null);
tile = tile.interimTile; tile = tile.interimTile;
if (interimTile.getState() == ol.Tile.State.LOADED) { if (interimTile.getState() == ol.Tile.State.LOADED) {
tile.interimTile = interimTile; tile.interimTile = interimTile;

View File

@@ -118,7 +118,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
} }
if (tileJSON.scheme !== undefined) { if (tileJSON.scheme !== undefined) {
goog.DEBUG && console.assert(tileJSON.scheme == 'xyz', 'tileJSON-scheme is "xyz"'); ol.DEBUG && console.assert(tileJSON.scheme == 'xyz', 'tileJSON-scheme is "xyz"');
} }
var minZoom = tileJSON.minzoom || 0; var minZoom = tileJSON.minzoom || 0;
var maxZoom = tileJSON.maxzoom || 22; var maxZoom = tileJSON.maxzoom || 22;

View File

@@ -175,7 +175,7 @@ ol.source.TileUTFGrid.prototype.handleTileJSONResponse = function(tileJSON) {
} }
if (tileJSON.scheme !== undefined) { if (tileJSON.scheme !== undefined) {
goog.DEBUG && console.assert(tileJSON.scheme == 'xyz', 'tileJSON-scheme is "xyz"'); ol.DEBUG && console.assert(tileJSON.scheme == 'xyz', 'tileJSON-scheme is "xyz"');
} }
var minZoom = tileJSON.minzoom || 0; var minZoom = tileJSON.minzoom || 0;
var maxZoom = tileJSON.maxzoom || 22; var maxZoom = tileJSON.maxzoom || 22;
@@ -229,7 +229,7 @@ ol.source.TileUTFGrid.prototype.getTile = function(z, x, y, pixelRatio, projecti
if (this.tileCache.containsKey(tileCoordKey)) { if (this.tileCache.containsKey(tileCoordKey)) {
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey)); return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
} else { } else {
goog.DEBUG && console.assert(projection, 'argument projection is truthy'); ol.DEBUG && console.assert(projection, 'argument projection is truthy');
var tileCoord = [z, x, y]; var tileCoord = [z, x, y];
var urlTileCoord = var urlTileCoord =
this.getTileCoordForTileUrlFunction(tileCoord, projection); this.getTileCoordForTileUrlFunction(tileCoord, projection);

View File

@@ -116,7 +116,7 @@ ol.inherits(ol.source.TileWMS, ol.source.TileImage);
*/ */
ol.source.TileWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) { ol.source.TileWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) {
goog.DEBUG && console.assert(!('VERSION' in params), ol.DEBUG && console.assert(!('VERSION' in params),
'key VERSION is not allowed in params'); 'key VERSION is not allowed in params');
var projectionObj = ol.proj.get(projection); var projectionObj = ol.proj.get(projection);

View File

@@ -237,7 +237,7 @@ ol.source.Vector.prototype.addFeatureInternal = function(feature) {
* @private * @private
*/ */
ol.source.Vector.prototype.setupChangeEvents_ = function(featureKey, feature) { ol.source.Vector.prototype.setupChangeEvents_ = function(featureKey, feature) {
goog.DEBUG && console.assert(!(featureKey in this.featureChangeKeys_), ol.DEBUG && console.assert(!(featureKey in this.featureChangeKeys_),
'key (%s) not yet registered in featureChangeKey', featureKey); 'key (%s) not yet registered in featureChangeKey', featureKey);
this.featureChangeKeys_[featureKey] = [ this.featureChangeKeys_[featureKey] = [
ol.events.listen(feature, ol.events.EventType.CHANGE, ol.events.listen(feature, ol.events.EventType.CHANGE,
@@ -334,7 +334,7 @@ ol.source.Vector.prototype.addFeaturesInternal = function(features) {
* @private * @private
*/ */
ol.source.Vector.prototype.bindFeaturesCollection_ = function(collection) { ol.source.Vector.prototype.bindFeaturesCollection_ = function(collection) {
goog.DEBUG && console.assert(!this.featuresCollection_, ol.DEBUG && console.assert(!this.featuresCollection_,
'bindFeaturesCollection can only be called once'); 'bindFeaturesCollection can only be called once');
var modifyingCollection = false; var modifyingCollection = false;
ol.events.listen(this, ol.source.VectorEventType.ADDFEATURE, ol.events.listen(this, ol.source.VectorEventType.ADDFEATURE,
@@ -400,11 +400,11 @@ ol.source.Vector.prototype.clear = function(opt_fast) {
if (this.featuresCollection_) { if (this.featuresCollection_) {
this.featuresCollection_.clear(); this.featuresCollection_.clear();
} }
goog.DEBUG && console.assert(ol.obj.isEmpty(this.featureChangeKeys_), ol.DEBUG && console.assert(ol.obj.isEmpty(this.featureChangeKeys_),
'featureChangeKeys is an empty object now'); 'featureChangeKeys is an empty object now');
goog.DEBUG && console.assert(ol.obj.isEmpty(this.idIndex_), ol.DEBUG && console.assert(ol.obj.isEmpty(this.idIndex_),
'idIndex is an empty object now'); 'idIndex is an empty object now');
goog.DEBUG && console.assert(ol.obj.isEmpty(this.undefIdIndex_), ol.DEBUG && console.assert(ol.obj.isEmpty(this.undefIdIndex_),
'undefIdIndex is an empty object now'); 'undefIdIndex is an empty object now');
if (this.featuresRtree_) { if (this.featuresRtree_) {
@@ -457,7 +457,7 @@ ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = function(coordinat
var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]]; var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];
return this.forEachFeatureInExtent(extent, function(feature) { return this.forEachFeatureInExtent(extent, function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
goog.DEBUG && console.assert(geometry, 'feature geometry is defined and not null'); ol.DEBUG && console.assert(geometry, 'feature geometry is defined and not null');
if (geometry.intersectsCoordinate(coordinate)) { if (geometry.intersectsCoordinate(coordinate)) {
return callback.call(opt_this, feature); return callback.call(opt_this, feature);
} else { } else {
@@ -523,7 +523,7 @@ ol.source.Vector.prototype.forEachFeatureIntersectingExtent = function(extent, c
*/ */
function(feature) { function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
goog.DEBUG && console.assert(geometry, ol.DEBUG && console.assert(geometry,
'feature geometry is defined and not null'); 'feature geometry is defined and not null');
if (geometry.intersectsExtent(extent)) { if (geometry.intersectsExtent(extent)) {
var result = callback.call(opt_this, feature); var result = callback.call(opt_this, feature);
@@ -594,7 +594,7 @@ ol.source.Vector.prototype.getFeaturesAtCoordinate = function(coordinate) {
* @api * @api
*/ */
ol.source.Vector.prototype.getFeaturesInExtent = function(extent) { ol.source.Vector.prototype.getFeaturesInExtent = function(extent) {
goog.DEBUG && console.assert(this.featuresRtree_, ol.DEBUG && console.assert(this.featuresRtree_,
'getFeaturesInExtent does not work when useSpatialIndex is set to false'); 'getFeaturesInExtent does not work when useSpatialIndex is set to false');
return this.featuresRtree_.getInExtent(extent); return this.featuresRtree_.getInExtent(extent);
}; };
@@ -626,7 +626,7 @@ ol.source.Vector.prototype.getClosestFeatureToCoordinate = function(coordinate,
var closestPoint = [NaN, NaN]; var closestPoint = [NaN, NaN];
var minSquaredDistance = Infinity; var minSquaredDistance = Infinity;
var extent = [-Infinity, -Infinity, Infinity, Infinity]; var extent = [-Infinity, -Infinity, Infinity, Infinity];
goog.DEBUG && console.assert(this.featuresRtree_, ol.DEBUG && console.assert(this.featuresRtree_,
'getClosestFeatureToCoordinate does not work with useSpatialIndex set ' + 'getClosestFeatureToCoordinate does not work with useSpatialIndex set ' +
'to false'); 'to false');
var filter = opt_filter ? opt_filter : ol.functions.TRUE; var filter = opt_filter ? opt_filter : ol.functions.TRUE;
@@ -637,7 +637,7 @@ ol.source.Vector.prototype.getClosestFeatureToCoordinate = function(coordinate,
function(feature) { function(feature) {
if (filter(feature)) { if (filter(feature)) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
goog.DEBUG && console.assert(geometry, ol.DEBUG && console.assert(geometry,
'feature geometry is defined and not null'); 'feature geometry is defined and not null');
var previousMinSquaredDistance = minSquaredDistance; var previousMinSquaredDistance = minSquaredDistance;
minSquaredDistance = geometry.closestPointXY( minSquaredDistance = geometry.closestPointXY(
@@ -669,7 +669,7 @@ ol.source.Vector.prototype.getClosestFeatureToCoordinate = function(coordinate,
* @api stable * @api stable
*/ */
ol.source.Vector.prototype.getExtent = function() { ol.source.Vector.prototype.getExtent = function() {
goog.DEBUG && console.assert(this.featuresRtree_, ol.DEBUG && console.assert(this.featuresRtree_,
'getExtent does not work when useSpatialIndex is set to false'); 'getExtent does not work when useSpatialIndex is set to false');
return this.featuresRtree_.getExtent(); return this.featuresRtree_.getExtent();
}; };
@@ -758,7 +758,7 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) {
} else { } else {
if (this.idIndex_[sid] !== feature) { if (this.idIndex_[sid] !== feature) {
removed = this.removeFromIdIndex_(feature); removed = this.removeFromIdIndex_(feature);
goog.DEBUG && console.assert(removed, ol.DEBUG && console.assert(removed,
'Expected feature to be removed from index'); 'Expected feature to be removed from index');
this.idIndex_[sid] = feature; this.idIndex_[sid] = feature;
} }
@@ -766,11 +766,11 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) {
} else { } else {
if (!(featureKey in this.undefIdIndex_)) { if (!(featureKey in this.undefIdIndex_)) {
removed = this.removeFromIdIndex_(feature); removed = this.removeFromIdIndex_(feature);
goog.DEBUG && console.assert(removed, ol.DEBUG && console.assert(removed,
'Expected feature to be removed from index'); 'Expected feature to be removed from index');
this.undefIdIndex_[featureKey] = feature; this.undefIdIndex_[featureKey] = feature;
} else { } else {
goog.DEBUG && console.assert(this.undefIdIndex_[featureKey] === feature, ol.DEBUG && console.assert(this.undefIdIndex_[featureKey] === feature,
'feature keyed under %s in undefIdKeys', featureKey); 'feature keyed under %s in undefIdKeys', featureKey);
} }
} }
@@ -845,7 +845,7 @@ ol.source.Vector.prototype.removeFeature = function(feature) {
*/ */
ol.source.Vector.prototype.removeFeatureInternal = function(feature) { ol.source.Vector.prototype.removeFeatureInternal = function(feature) {
var featureKey = ol.getUid(feature).toString(); var featureKey = ol.getUid(feature).toString();
goog.DEBUG && console.assert(featureKey in this.featureChangeKeys_, ol.DEBUG && console.assert(featureKey in this.featureChangeKeys_,
'featureKey exists in featureChangeKeys'); 'featureKey exists in featureChangeKeys');
this.featureChangeKeys_[featureKey].forEach(ol.events.unlistenByKey); this.featureChangeKeys_[featureKey].forEach(ol.events.unlistenByKey);
delete this.featureChangeKeys_[featureKey]; delete this.featureChangeKeys_[featureKey];

View File

@@ -308,16 +308,16 @@ ol.source.WMTS.prototype.updateDimensions = function(dimensions) {
ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) { ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
// TODO: add support for TileMatrixLimits // TODO: add support for TileMatrixLimits
goog.DEBUG && console.assert(config['layer'], ol.DEBUG && console.assert(config['layer'],
'config "layer" must not be null'); 'config "layer" must not be null');
var layers = wmtsCap['Contents']['Layer']; var layers = wmtsCap['Contents']['Layer'];
var l = ol.array.find(layers, function(elt, index, array) { var l = ol.array.find(layers, function(elt, index, array) {
return elt['Identifier'] == config['layer']; return elt['Identifier'] == config['layer'];
}); });
goog.DEBUG && console.assert(l, 'found a matching layer in Contents/Layer'); ol.DEBUG && console.assert(l, 'found a matching layer in Contents/Layer');
goog.DEBUG && console.assert(l['TileMatrixSetLink'].length > 0, ol.DEBUG && console.assert(l['TileMatrixSetLink'].length > 0,
'layer has TileMatrixSetLink'); 'layer has TileMatrixSetLink');
var tileMatrixSets = wmtsCap['Contents']['TileMatrixSet']; var tileMatrixSets = wmtsCap['Contents']['TileMatrixSet'];
var idx, matrixSet; var idx, matrixSet;
@@ -347,7 +347,7 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
matrixSet = /** @type {string} */ matrixSet = /** @type {string} */
(l['TileMatrixSetLink'][idx]['TileMatrixSet']); (l['TileMatrixSetLink'][idx]['TileMatrixSet']);
goog.DEBUG && console.assert(matrixSet, 'TileMatrixSet must not be null'); ol.DEBUG && console.assert(matrixSet, 'TileMatrixSet must not be null');
var format = /** @type {string} */ (l['Format'][0]); var format = /** @type {string} */ (l['Format'][0]);
if ('format' in config) { if ('format' in config) {
@@ -371,12 +371,12 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
var key = elt['Identifier']; var key = elt['Identifier'];
var value = elt['Default']; var value = elt['Default'];
if (value !== undefined) { if (value !== undefined) {
goog.DEBUG && console.assert(ol.array.includes(elt['Value'], value), ol.DEBUG && console.assert(ol.array.includes(elt['Value'], value),
'default value contained in values'); 'default value contained in values');
} else { } else {
value = elt['Value'][0]; value = elt['Value'][0];
} }
goog.DEBUG && console.assert(value !== undefined, 'value could be found'); ol.DEBUG && console.assert(value !== undefined, 'value could be found');
dimensions[key] = value; dimensions[key] = value;
}); });
} }
@@ -385,7 +385,7 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
var matrixSetObj = ol.array.find(matrixSets, function(elt, index, array) { var matrixSetObj = ol.array.find(matrixSets, function(elt, index, array) {
return elt['Identifier'] == matrixSet; return elt['Identifier'] == matrixSet;
}); });
goog.DEBUG && console.assert(matrixSetObj, ol.DEBUG && console.assert(matrixSetObj,
'found matrixSet in Contents/TileMatrixSet'); 'found matrixSet in Contents/TileMatrixSet');
var projection; var projection;
@@ -422,21 +422,21 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
var requestEncoding = config['requestEncoding']; var requestEncoding = config['requestEncoding'];
requestEncoding = requestEncoding !== undefined ? requestEncoding : ''; requestEncoding = requestEncoding !== undefined ? requestEncoding : '';
goog.DEBUG && console.assert( ol.DEBUG && console.assert(
ol.array.includes(['REST', 'RESTful', 'KVP', ''], requestEncoding), ol.array.includes(['REST', 'RESTful', 'KVP', ''], requestEncoding),
'requestEncoding (%s) is one of "REST", "RESTful", "KVP" or ""', 'requestEncoding (%s) is one of "REST", "RESTful", "KVP" or ""',
requestEncoding); requestEncoding);
if ('OperationsMetadata' in wmtsCap && 'GetTile' in wmtsCap['OperationsMetadata']) { if ('OperationsMetadata' in wmtsCap && 'GetTile' in wmtsCap['OperationsMetadata']) {
var gets = wmtsCap['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get']; var gets = wmtsCap['OperationsMetadata']['GetTile']['DCP']['HTTP']['Get'];
goog.DEBUG && console.assert(gets.length >= 1); ol.DEBUG && console.assert(gets.length >= 1);
for (var i = 0, ii = gets.length; i < ii; ++i) { for (var i = 0, ii = gets.length; i < ii; ++i) {
var constraint = ol.array.find(gets[i]['Constraint'], function(element) { var constraint = ol.array.find(gets[i]['Constraint'], function(element) {
return element['name'] == 'GetEncoding'; return element['name'] == 'GetEncoding';
}); });
var encodings = constraint['AllowedValues']['Value']; var encodings = constraint['AllowedValues']['Value'];
goog.DEBUG && console.assert(encodings.length >= 1); ol.DEBUG && console.assert(encodings.length >= 1);
if (requestEncoding === '') { if (requestEncoding === '') {
// requestEncoding not provided, use the first encoding from the list // requestEncoding not provided, use the first encoding from the list
@@ -460,7 +460,7 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, config) {
} }
}); });
} }
goog.DEBUG && console.assert(urls.length > 0, 'At least one URL found'); ol.DEBUG && console.assert(urls.length > 0, 'At least one URL found');
return { return {
urls: urls, urls: urls,

View File

@@ -41,7 +41,7 @@ ol.structs.LRUCache = function() {
}; };
if (goog.DEBUG) { if (ol.DEBUG) {
/** /**
* FIXME empty description for jsdoc * FIXME empty description for jsdoc
*/ */
@@ -168,7 +168,7 @@ ol.structs.LRUCache.prototype.getKeys = function() {
for (entry = this.newest_; entry; entry = entry.older) { for (entry = this.newest_; entry; entry = entry.older) {
keys[i++] = entry.key_; keys[i++] = entry.key_;
} }
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times'); ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
return keys; return keys;
}; };
@@ -183,7 +183,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
for (entry = this.newest_; entry; entry = entry.older) { for (entry = this.newest_; entry; entry = entry.older) {
values[i++] = entry.value_; values[i++] = entry.value_;
} }
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times'); ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
return values; return values;
}; };
@@ -192,7 +192,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
* @return {T} Last value. * @return {T} Last value.
*/ */
ol.structs.LRUCache.prototype.peekLast = function() { ol.structs.LRUCache.prototype.peekLast = function() {
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null'); ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
return this.oldest_.value_; return this.oldest_.value_;
}; };
@@ -201,7 +201,7 @@ ol.structs.LRUCache.prototype.peekLast = function() {
* @return {string} Last key. * @return {string} Last key.
*/ */
ol.structs.LRUCache.prototype.peekLastKey = function() { ol.structs.LRUCache.prototype.peekLastKey = function() {
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null'); ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
return this.oldest_.key_; return this.oldest_.key_;
}; };
@@ -210,10 +210,10 @@ ol.structs.LRUCache.prototype.peekLastKey = function() {
* @return {T} value Value. * @return {T} value Value.
*/ */
ol.structs.LRUCache.prototype.pop = function() { ol.structs.LRUCache.prototype.pop = function() {
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null'); ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
goog.DEBUG && console.assert(this.newest_, 'newest must not be null'); ol.DEBUG && console.assert(this.newest_, 'newest must not be null');
var entry = this.oldest_; var entry = this.oldest_;
goog.DEBUG && console.assert(entry.key_ in this.entries_, ol.DEBUG && console.assert(entry.key_ in this.entries_,
'oldest is indexed in entries'); 'oldest is indexed in entries');
delete this.entries_[entry.key_]; delete this.entries_[entry.key_];
if (entry.newer) { if (entry.newer) {
@@ -243,7 +243,7 @@ ol.structs.LRUCache.prototype.replace = function(key, value) {
* @param {T} value Value. * @param {T} value Value.
*/ */
ol.structs.LRUCache.prototype.set = function(key, value) { ol.structs.LRUCache.prototype.set = function(key, value) {
goog.DEBUG && console.assert(!(key in {}), ol.DEBUG && console.assert(!(key in {}),
'key is not a standard property of objects (e.g. "__proto__")'); 'key is not a standard property of objects (e.g. "__proto__")');
ol.asserts.assert(!(key in this.entries_), ol.asserts.assert(!(key in this.entries_),
16); // Tried to set a value for a key that is used already 16); // Tried to set a value for a key that is used already

View File

@@ -61,7 +61,7 @@ ol.structs.PriorityQueue = function(priorityFunction, keyFunction) {
ol.structs.PriorityQueue.DROP = Infinity; ol.structs.PriorityQueue.DROP = Infinity;
if (goog.DEBUG) { if (ol.DEBUG) {
/** /**
* FIXME empty description for jsdoc * FIXME empty description for jsdoc
*/ */
@@ -100,7 +100,7 @@ ol.structs.PriorityQueue.prototype.clear = function() {
*/ */
ol.structs.PriorityQueue.prototype.dequeue = function() { ol.structs.PriorityQueue.prototype.dequeue = function() {
var elements = this.elements_; var elements = this.elements_;
goog.DEBUG && console.assert(elements.length > 0, ol.DEBUG && console.assert(elements.length > 0,
'must have elements in order to be able to dequeue'); 'must have elements in order to be able to dequeue');
var priorities = this.priorities_; var priorities = this.priorities_;
var element = elements[0]; var element = elements[0];
@@ -113,7 +113,7 @@ ol.structs.PriorityQueue.prototype.dequeue = function() {
this.siftUp_(0); this.siftUp_(0);
} }
var elementKey = this.keyFunction_(element); var elementKey = this.keyFunction_(element);
goog.DEBUG && console.assert(elementKey in this.queuedElements_, ol.DEBUG && console.assert(elementKey in this.queuedElements_,
'key %s is not listed as queued', elementKey); 'key %s is not listed as queued', elementKey);
delete this.queuedElements_[elementKey]; delete this.queuedElements_[elementKey];
return element; return element;

View File

@@ -30,7 +30,7 @@ ol.structs.RBush = function(opt_maxEntries) {
*/ */
this.items_ = {}; this.items_ = {};
if (goog.DEBUG) { if (ol.DEBUG) {
/** /**
* @private * @private
* @type {number} * @type {number}
@@ -46,7 +46,7 @@ ol.structs.RBush = function(opt_maxEntries) {
* @param {T} value Value. * @param {T} value Value.
*/ */
ol.structs.RBush.prototype.insert = function(extent, value) { ol.structs.RBush.prototype.insert = function(extent, value) {
if (goog.DEBUG && this.readers_) { if (ol.DEBUG && this.readers_) {
throw new Error('Can not insert value while reading'); throw new Error('Can not insert value while reading');
} }
/** @type {ol.RBushEntry} */ /** @type {ol.RBushEntry} */
@@ -60,7 +60,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
this.rbush_.insert(item); this.rbush_.insert(item);
// remember the object that was added to the internal rbush // remember the object that was added to the internal rbush
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_), ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
'uid (%s) of value (%s) already exists', ol.getUid(value), value); 'uid (%s) of value (%s) already exists', ol.getUid(value), value);
this.items_[ol.getUid(value)] = item; this.items_[ol.getUid(value)] = item;
}; };
@@ -72,10 +72,10 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
* @param {Array.<T>} values Values. * @param {Array.<T>} values Values.
*/ */
ol.structs.RBush.prototype.load = function(extents, values) { ol.structs.RBush.prototype.load = function(extents, values) {
if (goog.DEBUG && this.readers_) { if (ol.DEBUG && this.readers_) {
throw new Error('Can not insert values while reading'); throw new Error('Can not insert values while reading');
} }
goog.DEBUG && console.assert(extents.length === values.length, ol.DEBUG && console.assert(extents.length === values.length,
'extens and values must have same length (%s === %s)', 'extens and values must have same length (%s === %s)',
extents.length, values.length); extents.length, values.length);
@@ -93,7 +93,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
value: value value: value
}; };
items[i] = item; items[i] = item;
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_), ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
'uid (%s) of value (%s) already exists', ol.getUid(value), value); 'uid (%s) of value (%s) already exists', ol.getUid(value), value);
this.items_[ol.getUid(value)] = item; this.items_[ol.getUid(value)] = item;
} }
@@ -107,11 +107,11 @@ ol.structs.RBush.prototype.load = function(extents, values) {
* @return {boolean} Removed. * @return {boolean} Removed.
*/ */
ol.structs.RBush.prototype.remove = function(value) { ol.structs.RBush.prototype.remove = function(value) {
if (goog.DEBUG && this.readers_) { if (ol.DEBUG && this.readers_) {
throw new Error('Can not remove value while reading'); throw new Error('Can not remove value while reading');
} }
var uid = ol.getUid(value); var uid = ol.getUid(value);
goog.DEBUG && console.assert(uid in this.items_, ol.DEBUG && console.assert(uid in this.items_,
'uid (%s) of value (%s) does not exist', uid, value); 'uid (%s) of value (%s) does not exist', uid, value);
// get the object in which the value was wrapped when adding to the // get the object in which the value was wrapped when adding to the
@@ -128,13 +128,13 @@ ol.structs.RBush.prototype.remove = function(value) {
* @param {T} value Value. * @param {T} value Value.
*/ */
ol.structs.RBush.prototype.update = function(extent, value) { ol.structs.RBush.prototype.update = function(extent, value) {
goog.DEBUG && console.assert(ol.getUid(value) in this.items_, ol.DEBUG && console.assert(ol.getUid(value) in this.items_,
'uid (%s) of value (%s) does not exist', ol.getUid(value), value); 'uid (%s) of value (%s) does not exist', ol.getUid(value), value);
var item = this.items_[ol.getUid(value)]; var item = this.items_[ol.getUid(value)];
var bbox = [item.minX, item.minY, item.maxX, item.maxY]; var bbox = [item.minX, item.minY, item.maxX, item.maxY];
if (!ol.extent.equals(bbox, extent)) { if (!ol.extent.equals(bbox, extent)) {
if (goog.DEBUG && this.readers_) { if (ol.DEBUG && this.readers_) {
throw new Error('Can not update extent while reading'); throw new Error('Can not update extent while reading');
} }
this.remove(value); this.remove(value);
@@ -185,7 +185,7 @@ ol.structs.RBush.prototype.getInExtent = function(extent) {
* @template S * @template S
*/ */
ol.structs.RBush.prototype.forEach = function(callback, opt_this) { ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
if (goog.DEBUG) { if (ol.DEBUG) {
++this.readers_; ++this.readers_;
try { try {
return this.forEach_(this.getAll(), callback, opt_this); return this.forEach_(this.getAll(), callback, opt_this);
@@ -207,7 +207,7 @@ ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
* @template S * @template S
*/ */
ol.structs.RBush.prototype.forEachInExtent = function(extent, callback, opt_this) { ol.structs.RBush.prototype.forEachInExtent = function(extent, callback, opt_this) {
if (goog.DEBUG) { if (ol.DEBUG) {
++this.readers_; ++this.readers_;
try { try {
return this.forEach_(this.getInExtent(extent), callback, opt_this); return this.forEach_(this.getInExtent(extent), callback, opt_this);

Some files were not shown because too many files have changed in this diff Show More