Remove ol.DEBUG
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#### Removed build flags (`@define`)
|
#### Removed build flags (`@define`)
|
||||||
|
|
||||||
The `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
|
The `ol.DEBUG`, `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
|
||||||
|
|
||||||
#### Simplified `ol.View#fit()` API
|
#### Simplified `ol.View#fit()` API
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
"externs/tilejson.js",
|
"externs/tilejson.js",
|
||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
|
||||||
"ol.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
"externs/tilejson.js",
|
"externs/tilejson.js",
|
||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
|
||||||
"ol.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
"externs/tilejson.js",
|
"externs/tilejson.js",
|
||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
|
||||||
"ol.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ The minimum config file looks like this:
|
|||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false",
|
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
@@ -220,7 +219,6 @@ 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": [
|
||||||
"ol.DEBUG=false",
|
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ Creating a custom build requires writing a build configuration file. The format
|
|||||||
"externs/tilejson.js",
|
"externs/tilejson.js",
|
||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
|
||||||
"ol.DEBUG=false"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
],
|
],
|
||||||
@@ -205,8 +202,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openl
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.ENABLE_WEBGL=false",
|
"ol.ENABLE_WEBGL=false",
|
||||||
"ol.ENABLE_PROJ4JS=false",
|
"ol.ENABLE_PROJ4JS=false"
|
||||||
"ol.DEBUG=false"
|
|
||||||
],
|
],
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"manage_closure_dependencies": true
|
"manage_closure_dependencies": true
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ goog.require('ol.easing');
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.animation.bounce = function(options) {
|
ol.animation.bounce = function(options) {
|
||||||
ol.DEBUG && console.warn('ol.animation.bounce() is deprecated. Use view.animate() instead.');
|
|
||||||
var resolution = options.resolution;
|
var resolution = options.resolution;
|
||||||
var start = options.start ? options.start : Date.now();
|
var start = options.start ? options.start : Date.now();
|
||||||
var duration = options.duration !== undefined ? options.duration : 1000;
|
var duration = options.duration !== undefined ? options.duration : 1000;
|
||||||
@@ -54,7 +53,6 @@ ol.animation.bounce = function(options) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.animation.pan = function(options) {
|
ol.animation.pan = function(options) {
|
||||||
ol.DEBUG && console.warn('ol.animation.pan() is deprecated. Use view.animate() instead.');
|
|
||||||
var source = options.source;
|
var source = options.source;
|
||||||
var start = options.start ? options.start : Date.now();
|
var start = options.start ? options.start : Date.now();
|
||||||
var sourceX = source[0];
|
var sourceX = source[0];
|
||||||
@@ -97,7 +95,6 @@ ol.animation.pan = function(options) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.animation.rotate = function(options) {
|
ol.animation.rotate = function(options) {
|
||||||
ol.DEBUG && console.warn('ol.animation.rotate() is deprecated. Use view.animate() instead.');
|
|
||||||
var sourceRotation = options.rotation ? options.rotation : 0;
|
var sourceRotation = options.rotation ? options.rotation : 0;
|
||||||
var start = options.start ? options.start : Date.now();
|
var start = options.start ? options.start : Date.now();
|
||||||
var duration = options.duration !== undefined ? options.duration : 1000;
|
var duration = options.duration !== undefined ? options.duration : 1000;
|
||||||
@@ -146,7 +143,6 @@ ol.animation.rotate = function(options) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.animation.zoom = function(options) {
|
ol.animation.zoom = function(options) {
|
||||||
ol.DEBUG && console.warn('ol.animation.zoom() is deprecated. Use view.animate() instead.');
|
|
||||||
var sourceResolution = options.resolution;
|
var sourceResolution = options.resolution;
|
||||||
var start = options.start ? options.start : Date.now();
|
var start = options.start ? options.start : Date.now();
|
||||||
var duration = options.duration !== undefined ? options.duration : 1000;
|
var duration = options.duration !== undefined ? options.duration : 1000;
|
||||||
|
|||||||
@@ -114,10 +114,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(begin >= 0,
|
|
||||||
'Array begin index should be equal to or greater than 0');
|
|
||||||
ol.DEBUG && console.assert(end < arr.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];
|
||||||
arr[begin] = arr[end];
|
arr[begin] = arr[end];
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ 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);
|
||||||
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;
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(xs.length > 0, 'xs 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);
|
||||||
|
|||||||
@@ -144,8 +144,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(typeof object.x === 'number', 'object.x should be number');
|
|
||||||
ol.DEBUG && console.assert(typeof object.y === 'number', 'object.y should be number');
|
|
||||||
var point;
|
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,10 +167,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(Array.isArray(object.paths),
|
|
||||||
'object.paths should be an array');
|
|
||||||
ol.DEBUG && console.assert(object.paths.length === 1,
|
|
||||||
'object.paths array length should be 1');
|
|
||||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
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,10 +178,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(Array.isArray(object.paths),
|
|
||||||
'object.paths should be an array');
|
|
||||||
ol.DEBUG && console.assert(object.paths.length > 1,
|
|
||||||
'object.paths array length should be more than 1');
|
|
||||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||||
return new ol.geom.MultiLineString(object.paths, layout);
|
return new ol.geom.MultiLineString(object.paths, layout);
|
||||||
};
|
};
|
||||||
@@ -228,8 +218,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.rings.length > 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(
|
||||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
||||||
@@ -243,7 +231,6 @@ 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) {
|
||||||
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,9 +456,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(esriJSONFeature.geometry ||
|
|
||||||
esriJSONFeature.attributes,
|
|
||||||
'geometry or attributes should be defined');
|
|
||||||
var geometry = ol.format.EsriJSON.readGeometry_(esriJSONFeature.geometry,
|
var geometry = ol.format.EsriJSON.readGeometry_(esriJSONFeature.geometry,
|
||||||
opt_options);
|
opt_options);
|
||||||
var feature = new ol.Feature();
|
var feature = new ol.Feature();
|
||||||
@@ -481,9 +465,6 @@ 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]) {
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
typeof esriJSONFeature.attributes[opt_options.idField] === 'number',
|
|
||||||
'objectIdFieldName value should be a number');
|
|
||||||
feature.setId(/** @type {number} */(
|
feature.setId(/** @type {number} */(
|
||||||
esriJSONFeature.attributes[opt_options.idField]));
|
esriJSONFeature.attributes[opt_options.idField]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ ol.format.GeoJSON.readGeometry_ = function(object, opt_options) {
|
|||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
|
ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
|
||||||
object, opt_options) {
|
object, opt_options) {
|
||||||
ol.DEBUG && console.assert(object.type == 'GeometryCollection',
|
|
||||||
'object.type should be GeometryCollection');
|
|
||||||
var geometries = object.geometries.map(
|
var geometries = object.geometries.map(
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} geometry Geometry.
|
* @param {GeoJSONGeometry} geometry Geometry.
|
||||||
@@ -110,8 +108,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'Point',
|
|
||||||
'object.type should be Point');
|
|
||||||
return new ol.geom.Point(object.coordinates);
|
return new ol.geom.Point(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,8 +118,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'LineString',
|
|
||||||
'object.type should be LineString');
|
|
||||||
return new ol.geom.LineString(object.coordinates);
|
return new ol.geom.LineString(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -134,8 +128,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'MultiLineString',
|
|
||||||
'object.type should be MultiLineString');
|
|
||||||
return new ol.geom.MultiLineString(object.coordinates);
|
return new ol.geom.MultiLineString(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,8 +138,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'MultiPoint',
|
|
||||||
'object.type should be MultiPoint');
|
|
||||||
return new ol.geom.MultiPoint(object.coordinates);
|
return new ol.geom.MultiPoint(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -158,8 +148,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'MultiPolygon',
|
|
||||||
'object.type should be MultiPolygon');
|
|
||||||
return new ol.geom.MultiPolygon(object.coordinates);
|
return new ol.geom.MultiPolygon(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -170,8 +158,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(object.type == 'Polygon',
|
|
||||||
'object.type should be Polygon');
|
|
||||||
return new ol.geom.Polygon(object.coordinates);
|
return new ol.geom.Polygon(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -389,9 +375,6 @@ ol.format.GeoJSON.prototype.readFeatures;
|
|||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.readFeatureFromObject = function(
|
ol.format.GeoJSON.prototype.readFeatureFromObject = function(
|
||||||
object, opt_options) {
|
object, opt_options) {
|
||||||
|
|
||||||
ol.DEBUG && console.assert(object.type !== 'FeatureCollection', 'Expected a Feature or geometry');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {GeoJSONFeature}
|
* @type {GeoJSONFeature}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -100,9 +100,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Box', 'localName should be Box');
|
|
||||||
/** @type {Array.<number>} */
|
/** @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,20 +115,12 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'innerBoundaryIs',
|
|
||||||
'localName should be innerBoundaryIs');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings should have an array length larger than 0');
|
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -143,20 +132,12 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'outerBoundaryIs',
|
|
||||||
'localName should be outerBoundaryIs');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings should have an array length larger than 0');
|
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-68
@@ -88,10 +88,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiCurve',
|
|
||||||
'localName should be MultiCurve');
|
|
||||||
/** @type {Array.<ol.geom.LineString>} */
|
/** @type {Array.<ol.geom.LineString>} */
|
||||||
var lineStrings = ol.xml.pushParseAndPop([],
|
var lineStrings = ol.xml.pushParseAndPop([],
|
||||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||||
@@ -112,10 +108,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiSurface',
|
|
||||||
'localName should be MultiSurface');
|
|
||||||
/** @type {Array.<ol.geom.Polygon>} */
|
/** @type {Array.<ol.geom.Polygon>} */
|
||||||
var polygons = ol.xml.pushParseAndPop([],
|
var polygons = ol.xml.pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
@@ -135,11 +127,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'curveMember' ||
|
|
||||||
node.localName == 'curveMembers',
|
|
||||||
'localName should be curveMember or curveMembers');
|
|
||||||
ol.xml.parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
|
ol.xml.parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -150,11 +137,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'surfaceMember' ||
|
|
||||||
node.localName == 'surfaceMembers',
|
|
||||||
'localName should be surfaceMember or surfaceMembers');
|
|
||||||
ol.xml.parseNode(this.SURFACEMEMBER_PARSERS_,
|
ol.xml.parseNode(this.SURFACEMEMBER_PARSERS_,
|
||||||
node, objectStack, this);
|
node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -167,10 +149,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'patches',
|
|
||||||
'localName should be patches');
|
|
||||||
return ol.xml.pushParseAndPop([null],
|
return ol.xml.pushParseAndPop([null],
|
||||||
this.PATCHES_PARSERS_, node, objectStack, this);
|
this.PATCHES_PARSERS_, node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -183,10 +161,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'segments',
|
|
||||||
'localName should be segments');
|
|
||||||
return ol.xml.pushParseAndPop([null],
|
return ol.xml.pushParseAndPop([null],
|
||||||
this.SEGMENTS_PARSERS_, node, objectStack, this);
|
this.SEGMENTS_PARSERS_, node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -199,10 +173,6 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
|
|||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'npde.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'PolygonPatch',
|
|
||||||
'localName should be PolygonPatch');
|
|
||||||
return ol.xml.pushParseAndPop([null],
|
return ol.xml.pushParseAndPop([null],
|
||||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -215,10 +185,6 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array.<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LineStringSegment',
|
|
||||||
'localName should be LineStringSegment');
|
|
||||||
return ol.xml.pushParseAndPop([null],
|
return ol.xml.pushParseAndPop([null],
|
||||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
|
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
|
||||||
node, objectStack, this);
|
node, objectStack, this);
|
||||||
@@ -231,20 +197,12 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'interior',
|
|
||||||
'localName should be interior');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings should have an array length of 1 or more');
|
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -256,20 +214,12 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
/** @type {Array.<number>|undefined} */
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'exterior',
|
|
||||||
'localName should be exterior');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings should have an array length of 1 or more');
|
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -282,10 +232,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Surface',
|
|
||||||
'localName should be Surface');
|
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
||||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||||
@@ -314,9 +260,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Curve', 'localName should be Curve');
|
|
||||||
/** @type {Array.<number>} */
|
/** @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,10 +280,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Envelope',
|
|
||||||
'localName should be Envelope');
|
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
var flatCoordinates = ol.xml.pushParseAndPop([null],
|
var flatCoordinates = ol.xml.pushParseAndPop([null],
|
||||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||||
@@ -718,7 +657,6 @@ 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) {
|
||||||
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,8 +1117,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'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]);
|
||||||
};
|
};
|
||||||
@@ -1200,9 +1136,6 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o
|
|||||||
var surface = context['surface'];
|
var surface = context['surface'];
|
||||||
var curve = context['curve'];
|
var curve = context['curve'];
|
||||||
var multiCurve = context['multiCurve'];
|
var multiCurve = context['multiCurve'];
|
||||||
var parentNode = objectStack[objectStack.length - 1].node;
|
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'parentNode should be a node');
|
|
||||||
var nodeName;
|
var nodeName;
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
nodeName = /** @type {ol.geom.Geometry} */ (value).getType();
|
nodeName = /** @type {ol.geom.Geometry} */ (value).getType();
|
||||||
|
|||||||
@@ -107,8 +107,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
var localName = node.localName;
|
var localName = node.localName;
|
||||||
var features = null;
|
var features = null;
|
||||||
if (localName == 'FeatureCollection') {
|
if (localName == 'FeatureCollection') {
|
||||||
@@ -259,15 +257,10 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point');
|
|
||||||
var flatCoordinates =
|
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);
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length == 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,10 +273,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiPoint',
|
|
||||||
'localName should be MultiPoint');
|
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
var coordinates = ol.xml.pushParseAndPop([],
|
var coordinates = ol.xml.pushParseAndPop([],
|
||||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||||
@@ -301,10 +290,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiLineString',
|
|
||||||
'localName should be MultiLineString');
|
|
||||||
/** @type {Array.<ol.geom.LineString>} */
|
/** @type {Array.<ol.geom.LineString>} */
|
||||||
var lineStrings = ol.xml.pushParseAndPop([],
|
var lineStrings = ol.xml.pushParseAndPop([],
|
||||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||||
@@ -324,10 +309,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiPolygon',
|
|
||||||
'localName should be MultiPolygon');
|
|
||||||
/** @type {Array.<ol.geom.Polygon>} */
|
/** @type {Array.<ol.geom.Polygon>} */
|
||||||
var polygons = ol.xml.pushParseAndPop([],
|
var polygons = ol.xml.pushParseAndPop([],
|
||||||
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
@@ -347,11 +328,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'pointMember' ||
|
|
||||||
node.localName == 'pointMembers',
|
|
||||||
'localName should be pointMember or pointMembers');
|
|
||||||
ol.xml.parseNode(this.POINTMEMBER_PARSERS_,
|
ol.xml.parseNode(this.POINTMEMBER_PARSERS_,
|
||||||
node, objectStack, this);
|
node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -363,11 +339,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'lineStringMember' ||
|
|
||||||
node.localName == 'lineStringMembers',
|
|
||||||
'localName should be LineStringMember or LineStringMembers');
|
|
||||||
ol.xml.parseNode(this.LINESTRINGMEMBER_PARSERS_,
|
ol.xml.parseNode(this.LINESTRINGMEMBER_PARSERS_,
|
||||||
node, objectStack, this);
|
node, objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -379,11 +350,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'polygonMember' ||
|
|
||||||
node.localName == 'polygonMembers',
|
|
||||||
'localName should be polygonMember or polygonMembers');
|
|
||||||
ol.xml.parseNode(this.POLYGONMEMBER_PARSERS_, node,
|
ol.xml.parseNode(this.POLYGONMEMBER_PARSERS_, node,
|
||||||
objectStack, this);
|
objectStack, this);
|
||||||
};
|
};
|
||||||
@@ -395,10 +361,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LineString',
|
|
||||||
'localName should be LineString');
|
|
||||||
var flatCoordinates =
|
var flatCoordinates =
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
@@ -418,10 +380,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LinearRing',
|
|
||||||
'localName should be LinearRing');
|
|
||||||
var ring = ol.xml.pushParseAndPop(null,
|
var ring = ol.xml.pushParseAndPop(null,
|
||||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||||
objectStack, this);
|
objectStack, this);
|
||||||
@@ -439,10 +397,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LinearRing',
|
|
||||||
'localName should be LinearRing');
|
|
||||||
var flatCoordinates =
|
var flatCoordinates =
|
||||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
@@ -461,10 +415,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Polygon',
|
|
||||||
'localName should be Polygon');
|
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
||||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||||
@@ -493,8 +443,6 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array.<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
return ol.xml.pushParseAndPop(null,
|
return ol.xml.pushParseAndPop(null,
|
||||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||||
objectStack, this);
|
objectStack, this);
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ 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, layoutOptions, node, values) {
|
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
flatCoordinates.push(
|
flatCoordinates.push(
|
||||||
parseFloat(node.getAttribute('lon')),
|
parseFloat(node.getAttribute('lon')),
|
||||||
parseFloat(node.getAttribute('lat')));
|
parseFloat(node.getAttribute('lat')));
|
||||||
@@ -147,9 +145,6 @@ ol.format.GPX.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, end
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseLink_ = function(node, objectStack) {
|
ol.format.GPX.parseLink_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'link', 'localName should be link');
|
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
var href = node.getAttribute('href');
|
var href = node.getAttribute('href');
|
||||||
if (href !== null) {
|
if (href !== null) {
|
||||||
@@ -165,10 +160,6 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'extensions',
|
|
||||||
'localName should be extensions');
|
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
values['extensionsNode_'] = node;
|
values['extensionsNode_'] = node;
|
||||||
};
|
};
|
||||||
@@ -180,9 +171,6 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'rtept', 'localName should be rtept');
|
|
||||||
var values = ol.xml.pushParseAndPop(
|
var values = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.GPX.RTEPT_PARSERS_, node, objectStack);
|
{}, ol.format.GPX.RTEPT_PARSERS_, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
@@ -202,9 +190,6 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'trkpt', 'localName should be trkpt');
|
|
||||||
var values = ol.xml.pushParseAndPop(
|
var values = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.GPX.TRKPT_PARSERS_, node, objectStack);
|
{}, ol.format.GPX.TRKPT_PARSERS_, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
@@ -224,10 +209,6 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'trkseg',
|
|
||||||
'localName should be trkseg');
|
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
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);
|
||||||
var flatCoordinates = /** @type {Array.<number>} */
|
var flatCoordinates = /** @type {Array.<number>} */
|
||||||
@@ -244,9 +225,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'rte', 'localName should be rte');
|
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
var values = ol.xml.pushParseAndPop({
|
var values = ol.xml.pushParseAndPop({
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
@@ -277,9 +255,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'trk', 'localName should be trk');
|
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||||
var values = ol.xml.pushParseAndPop({
|
var values = ol.xml.pushParseAndPop({
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
@@ -313,9 +288,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'wpt', 'localName should be wpt');
|
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var 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);
|
||||||
@@ -516,8 +488,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -552,8 +522,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -612,8 +580,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'parentNode should be an XML node');
|
|
||||||
var namespaceURI = parentNode.namespaceURI;
|
var namespaceURI = parentNode.namespaceURI;
|
||||||
var properties = context['properties'];
|
var properties = context['properties'];
|
||||||
//FIXME Projection handling
|
//FIXME Projection handling
|
||||||
@@ -919,8 +885,6 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
|||||||
var nodeName = ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
|
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;
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'parentNode should be an XML node');
|
|
||||||
return ol.xml.createElementNS(parentNode.namespaceURI, nodeName);
|
return ol.xml.createElementNS(parentNode.namespaceURI, nodeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ 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 {
|
||||||
ol.DEBUG && console.assert(false, 'Unknown altitude mode.');
|
|
||||||
z = 0;
|
z = 0;
|
||||||
}
|
}
|
||||||
flatCoordinates.push(z);
|
flatCoordinates.push(z);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ goog.require('ol.geom.GeometryCollection');
|
|||||||
goog.require('ol.geom.GeometryLayout');
|
goog.require('ol.geom.GeometryLayout');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
goog.require('ol.geom.LinearRing');
|
|
||||||
goog.require('ol.geom.MultiLineString');
|
goog.require('ol.geom.MultiLineString');
|
||||||
goog.require('ol.geom.MultiPoint');
|
goog.require('ol.geom.MultiPoint');
|
||||||
goog.require('ol.geom.MultiPolygon');
|
goog.require('ol.geom.MultiPolygon');
|
||||||
@@ -548,10 +547,6 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be an ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'IconStyle',
|
|
||||||
'localName should be IconStyle');
|
|
||||||
// FIXME refreshMode
|
// FIXME refreshMode
|
||||||
// FIXME refreshInterval
|
// FIXME refreshInterval
|
||||||
// FIXME viewRefreshTime
|
// FIXME viewRefreshTime
|
||||||
@@ -654,10 +649,6 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LabelStyle',
|
|
||||||
'localName should be LabelStyle');
|
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
var object = ol.xml.pushParseAndPop(
|
var object = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.KML.LABEL_STYLE_PARSERS_, node, objectStack);
|
{}, ol.format.KML.LABEL_STYLE_PARSERS_, node, objectStack);
|
||||||
@@ -683,10 +674,6 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LineStyle',
|
|
||||||
'localName should be LineStyle');
|
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
// FIXME gx:outerColor
|
// FIXME gx:outerColor
|
||||||
// FIXME gx:outerWidth
|
// FIXME gx:outerWidth
|
||||||
@@ -713,10 +700,6 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'PolyStyle',
|
|
||||||
'localName should be PolyStyle');
|
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
var object = ol.xml.pushParseAndPop(
|
var object = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.KML.POLY_STYLE_PARSERS_, node, objectStack);
|
{}, ol.format.KML.POLY_STYLE_PARSERS_, node, objectStack);
|
||||||
@@ -748,10 +731,6 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
|||||||
* @return {Array.<number>} LinearRing flat coordinates.
|
* @return {Array.<number>} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LinearRing',
|
|
||||||
'localName should be LinearRing');
|
|
||||||
return ol.xml.pushParseAndPop(null,
|
return ol.xml.pushParseAndPop(null,
|
||||||
ol.format.KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
|
ol.format.KML.FLAT_LINEAR_RING_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -763,12 +742,6 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(ol.array.includes(
|
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
|
||||||
'namespaceURI of the node should be known to the KML parser');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'coord', 'localName should be coord');
|
|
||||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
var flatCoordinates = gxTrackObject.flatCoordinates;
|
var flatCoordinates = gxTrackObject.flatCoordinates;
|
||||||
@@ -794,13 +767,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(ol.array.includes(
|
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
|
||||||
'namespaceURI of the node should be known to the KML parser');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiTrack',
|
|
||||||
'localName should be MultiTrack');
|
|
||||||
var lineStrings = ol.xml.pushParseAndPop([],
|
var lineStrings = ol.xml.pushParseAndPop([],
|
||||||
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
|
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_, node, objectStack);
|
||||||
if (!lineStrings) {
|
if (!lineStrings) {
|
||||||
@@ -819,12 +785,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(ol.array.includes(
|
|
||||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
|
||||||
'namespaceURI of the node should be known to the KML parser');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Track', 'localName should be Track');
|
|
||||||
var gxTrackObject = ol.xml.pushParseAndPop(
|
var gxTrackObject = ol.xml.pushParseAndPop(
|
||||||
/** @type {ol.KMLGxTrackObject_} */ ({
|
/** @type {ol.KMLGxTrackObject_} */ ({
|
||||||
flatCoordinates: [],
|
flatCoordinates: [],
|
||||||
@@ -835,9 +795,6 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
|||||||
}
|
}
|
||||||
var flatCoordinates = gxTrackObject.flatCoordinates;
|
var flatCoordinates = gxTrackObject.flatCoordinates;
|
||||||
var whens = gxTrackObject.whens;
|
var whens = gxTrackObject.whens;
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length / 4 == whens.length,
|
|
||||||
'the length of the flatCoordinates array divided by 4 should be the ' +
|
|
||||||
'length of the whens array');
|
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = Math.min(flatCoordinates.length, whens.length); i < ii;
|
for (i = 0, ii = Math.min(flatCoordinates.length, whens.length); i < ii;
|
||||||
++i) {
|
++i) {
|
||||||
@@ -856,9 +813,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Icon', 'localName should be Icon');
|
|
||||||
var iconObject = ol.xml.pushParseAndPop(
|
var iconObject = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.KML.ICON_PARSERS_, node, objectStack);
|
{}, ol.format.KML.ICON_PARSERS_, node, objectStack);
|
||||||
if (iconObject) {
|
if (iconObject) {
|
||||||
@@ -876,8 +830,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'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);
|
||||||
};
|
};
|
||||||
@@ -890,10 +842,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LineString',
|
|
||||||
'localName should be LineString');
|
|
||||||
var properties = ol.xml.pushParseAndPop({},
|
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);
|
||||||
@@ -917,10 +865,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LinearRing',
|
|
||||||
'localName should be LinearRing');
|
|
||||||
var properties = ol.xml.pushParseAndPop({},
|
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);
|
||||||
@@ -945,10 +889,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MultiGeometry',
|
|
||||||
'localName should be MultiGeometry');
|
|
||||||
var geometries = ol.xml.pushParseAndPop([],
|
var geometries = ol.xml.pushParseAndPop([],
|
||||||
ol.format.KML.MULTI_GEOMETRY_PARSERS_, node, objectStack);
|
ol.format.KML.MULTI_GEOMETRY_PARSERS_, node, objectStack);
|
||||||
if (!geometries) {
|
if (!geometries) {
|
||||||
@@ -978,8 +918,6 @@ 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];
|
||||||
ol.DEBUG && console.assert(geometry.getLayout() == layout,
|
|
||||||
'geometry layout should be consistent');
|
|
||||||
ol.array.extend(flatCoordinates, geometry.getFlatCoordinates());
|
ol.array.extend(flatCoordinates, geometry.getFlatCoordinates());
|
||||||
}
|
}
|
||||||
multiGeometry = new ol.geom.MultiPoint(null);
|
multiGeometry = new ol.geom.MultiPoint(null);
|
||||||
@@ -1012,9 +950,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Point', 'localName should be Point');
|
|
||||||
var properties = ol.xml.pushParseAndPop({},
|
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);
|
||||||
@@ -1022,8 +957,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length == 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);
|
||||||
return point;
|
return point;
|
||||||
@@ -1040,10 +973,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Polygon',
|
|
||||||
'localName should be Polygon');
|
|
||||||
var properties = ol.xml.pushParseAndPop(/** @type {Object<string,*>} */ ({}),
|
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,
|
||||||
objectStack);
|
objectStack);
|
||||||
@@ -1075,9 +1004,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
|
|
||||||
var styleObject = ol.xml.pushParseAndPop(
|
var styleObject = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.KML.STYLE_PARSERS_, node, objectStack);
|
{}, ol.format.KML.STYLE_PARSERS_, node, objectStack);
|
||||||
if (!styleObject) {
|
if (!styleObject) {
|
||||||
@@ -1154,9 +1080,6 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.DataParser_ = function(node, objectStack) {
|
ol.format.KML.DataParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Data', 'localName should be Data');
|
|
||||||
var name = node.getAttribute('name');
|
var name = node.getAttribute('name');
|
||||||
ol.xml.parseNode(ol.format.KML.DATA_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.DATA_PARSERS_, node, objectStack);
|
||||||
var featureObject =
|
var featureObject =
|
||||||
@@ -1175,10 +1098,6 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ExtendedData',
|
|
||||||
'localName should be ExtendedData');
|
|
||||||
ol.xml.parseNode(ol.format.KML.EXTENDED_DATA_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.EXTENDED_DATA_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1188,10 +1107,6 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.RegionParser_ = function(node, objectStack) {
|
ol.format.KML.RegionParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Region',
|
|
||||||
'localName should be Region');
|
|
||||||
ol.xml.parseNode(ol.format.KML.REGION_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.REGION_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1201,9 +1116,6 @@ ol.format.KML.RegionParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Pair', 'localName should be Pair');
|
|
||||||
var pairObject = ol.xml.pushParseAndPop(
|
var pairObject = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.KML.PAIR_PARSERS_, node, objectStack);
|
{}, ol.format.KML.PAIR_PARSERS_, node, objectStack);
|
||||||
if (!pairObject) {
|
if (!pairObject) {
|
||||||
@@ -1232,10 +1144,6 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'StyleMap',
|
|
||||||
'localName should be StyleMap');
|
|
||||||
var styleMapValue = ol.format.KML.readStyleMapValue_(node, objectStack);
|
var styleMapValue = ol.format.KML.readStyleMapValue_(node, objectStack);
|
||||||
if (!styleMapValue) {
|
if (!styleMapValue) {
|
||||||
return;
|
return;
|
||||||
@@ -1257,10 +1165,6 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'SchemaData',
|
|
||||||
'localName should be SchemaData');
|
|
||||||
ol.xml.parseNode(ol.format.KML.SCHEMA_DATA_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.SCHEMA_DATA_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1271,10 +1175,6 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'SimpleData',
|
|
||||||
'localName should be SimpleData');
|
|
||||||
var name = node.getAttribute('name');
|
var name = node.getAttribute('name');
|
||||||
if (name !== null) {
|
if (name !== null) {
|
||||||
var data = ol.format.XSD.readString(node);
|
var data = ol.format.XSD.readString(node);
|
||||||
@@ -1291,10 +1191,6 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LatLonAltBoxParser_ = function(node, objectStack) {
|
ol.format.KML.LatLonAltBoxParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'LatLonAltBox',
|
|
||||||
'localName should be LatLonAltBox');
|
|
||||||
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LAT_LON_ALT_BOX_PARSERS_, node, objectStack);
|
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LAT_LON_ALT_BOX_PARSERS_, node, objectStack);
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return;
|
return;
|
||||||
@@ -1319,10 +1215,6 @@ ol.format.KML.LatLonAltBoxParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LodParser_ = function(node, objectStack) {
|
ol.format.KML.LodParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Lod',
|
|
||||||
'localName should be Lod');
|
|
||||||
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LOD_PARSERS_, node, objectStack);
|
var object = ol.xml.pushParseAndPop({}, ol.format.KML.LOD_PARSERS_, node, objectStack);
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return;
|
return;
|
||||||
@@ -1341,20 +1233,12 @@ ol.format.KML.LodParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'innerBoundaryIs',
|
|
||||||
'localName should be innerBoundaryIs');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_, node, objectStack);
|
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_, 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]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings array should not be empty');
|
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1366,20 +1250,12 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'outerBoundaryIs',
|
|
||||||
'localName should be outerBoundaryIs');
|
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||||
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_, node, objectStack);
|
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_, 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]);
|
||||||
ol.DEBUG && console.assert(Array.isArray(flatLinearRings),
|
|
||||||
'flatLinearRings should be an array');
|
|
||||||
ol.DEBUG && console.assert(flatLinearRings.length > 0,
|
|
||||||
'flatLinearRings array should not be empty');
|
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1391,9 +1267,6 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.LinkParser_ = function(node, objectStack) {
|
ol.format.KML.LinkParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Link', 'localName should be Link');
|
|
||||||
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
|
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1404,9 +1277,6 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.KML.whenParser_ = function(node, objectStack) {
|
ol.format.KML.whenParser_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'when', 'localName should be when');
|
|
||||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
var whens = gxTrackObject.whens;
|
var whens = gxTrackObject.whens;
|
||||||
@@ -1791,11 +1661,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
var localName = node.localName;
|
|
||||||
ol.DEBUG && console.assert(localName == 'Document' || localName == 'Folder',
|
|
||||||
'localName should be Document or Folder');
|
|
||||||
// FIXME use scope somehow
|
// FIXME use scope somehow
|
||||||
var parsersNS = ol.xml.makeStructureNS(
|
var parsersNS = ol.xml.makeStructureNS(
|
||||||
ol.format.KML.NAMESPACE_URIS_, {
|
ol.format.KML.NAMESPACE_URIS_, {
|
||||||
@@ -1822,10 +1687,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Placemark',
|
|
||||||
'localName should be Placemark');
|
|
||||||
var object = ol.xml.pushParseAndPop({'geometry': null},
|
var object = ol.xml.pushParseAndPop({'geometry': null},
|
||||||
ol.format.KML.PLACEMARK_PARSERS_, node, objectStack);
|
ol.format.KML.PLACEMARK_PARSERS_, node, objectStack);
|
||||||
if (!object) {
|
if (!object) {
|
||||||
@@ -1869,9 +1730,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
|
|
||||||
var id = node.getAttribute('id');
|
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);
|
||||||
@@ -1895,10 +1753,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'StyleMap',
|
|
||||||
'localName should be StyleMap');
|
|
||||||
var id = node.getAttribute('id');
|
var id = node.getAttribute('id');
|
||||||
if (id === null) {
|
if (id === null) {
|
||||||
return;
|
return;
|
||||||
@@ -1936,13 +1790,9 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(node.localName == '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)]);
|
||||||
if (feature) {
|
if (feature) {
|
||||||
@@ -1971,8 +1821,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -2614,12 +2462,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
(geometry instanceof ol.geom.Point) ||
|
|
||||||
(geometry instanceof ol.geom.LineString) ||
|
|
||||||
(geometry instanceof ol.geom.LinearRing),
|
|
||||||
'geometry should be one of ol.geom.Point, ol.geom.LineString ' +
|
|
||||||
'or ol.geom.LinearRing');
|
|
||||||
var flatCoordinates = geometry.getFlatCoordinates();
|
var flatCoordinates = geometry.getFlatCoordinates();
|
||||||
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
|
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
|
||||||
context['layout'] = geometry.getLayout();
|
context['layout'] = geometry.getLayout();
|
||||||
@@ -2639,8 +2481,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(linearRings.length > 0,
|
|
||||||
'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};
|
||||||
// inner rings
|
// inner rings
|
||||||
@@ -3053,8 +2893,6 @@ ol.format.KML.GX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
|||||||
ol.format.KML.DOCUMENT_NODE_FACTORY_ = function(value, objectStack,
|
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;
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'parentNode should be an XML node');
|
|
||||||
return ol.xml.createElementNS(parentNode.namespaceURI, 'Placemark');
|
return ol.xml.createElementNS(parentNode.namespaceURI, 'Placemark');
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3071,8 +2909,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(ol.xml.isNode(parentNode),
|
|
||||||
'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()]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,6 @@ ol.format.OSMXML.prototype.getExtensions = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'node', 'localName should be node');
|
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var 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 +87,6 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'way', 'localName should be way');
|
|
||||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
var 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 +124,6 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'nd', 'localName should be nd');
|
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
values.ndrefs.push(node.getAttribute('ref'));
|
values.ndrefs.push(node.getAttribute('ref'));
|
||||||
};
|
};
|
||||||
@@ -144,9 +135,6 @@ ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.readTag_ = function(node, objectStack) {
|
ol.format.OSMXML.readTag_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'tag', 'localName should be tag');
|
|
||||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
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,8 +201,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'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') {
|
||||||
var state = ol.xml.pushParseAndPop({
|
var state = ol.xml.pushParseAndPop({
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'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) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
@@ -38,8 +36,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'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, []);
|
||||||
return owsObject ? owsObject : null;
|
return owsObject ? owsObject : null;
|
||||||
@@ -53,10 +49,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Address',
|
|
||||||
'localName should be Address');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.ADDRESS_PARSERS_, node, objectStack);
|
ol.format.OWS.ADDRESS_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -69,10 +61,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'AllowedValues',
|
|
||||||
'localName should be AllowedValues');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.ALLOWED_VALUES_PARSERS_, node, objectStack);
|
ol.format.OWS.ALLOWED_VALUES_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -85,10 +73,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Constraint',
|
|
||||||
'localName should be Constraint');
|
|
||||||
var name = node.getAttribute('name');
|
var name = node.getAttribute('name');
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -106,10 +90,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ContactInfo',
|
|
||||||
'localName should be ContactInfo');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.CONTACT_INFO_PARSERS_, node, objectStack);
|
ol.format.OWS.CONTACT_INFO_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -122,9 +102,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'DCP', 'localName should be DCP');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.DCP_PARSERS_, node, objectStack);
|
ol.format.OWS.DCP_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -137,9 +114,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Get', 'localName should be Get');
|
|
||||||
var href = ol.format.XLink.readHref(node);
|
var href = ol.format.XLink.readHref(node);
|
||||||
if (!href) {
|
if (!href) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -156,9 +130,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
|
||||||
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
|
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -171,10 +142,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Operation',
|
|
||||||
'localName should be Operation');
|
|
||||||
var name = node.getAttribute('name');
|
var name = node.getAttribute('name');
|
||||||
var value = ol.xml.pushParseAndPop({},
|
var value = ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.OPERATION_PARSERS_, node, objectStack);
|
ol.format.OWS.OPERATION_PARSERS_, node, objectStack);
|
||||||
@@ -184,7 +151,6 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
|
|||||||
var object = /** @type {Object} */
|
var object = /** @type {Object} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
object[name] = value;
|
object[name] = value;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -196,10 +162,6 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
ol.format.OWS.readOperationsMetadata_ = function(node,
|
ol.format.OWS.readOperationsMetadata_ = function(node,
|
||||||
objectStack) {
|
objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'OperationsMetadata',
|
|
||||||
'localName should be OperationsMetadata');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.OPERATIONS_METADATA_PARSERS_, node,
|
ol.format.OWS.OPERATIONS_METADATA_PARSERS_, node,
|
||||||
objectStack);
|
objectStack);
|
||||||
@@ -213,9 +175,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Phone', 'localName should be Phone');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.OWS.PHONE_PARSERS_, node, objectStack);
|
ol.format.OWS.PHONE_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
@@ -229,10 +188,6 @@ ol.format.OWS.readPhone_ = function(node, objectStack) {
|
|||||||
*/
|
*/
|
||||||
ol.format.OWS.readServiceIdentification_ = function(node,
|
ol.format.OWS.readServiceIdentification_ = function(node,
|
||||||
objectStack) {
|
objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ServiceIdentification',
|
|
||||||
'localName should be ServiceIdentification');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_, node,
|
{}, ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_, node,
|
||||||
objectStack);
|
objectStack);
|
||||||
@@ -246,10 +201,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ServiceContact',
|
|
||||||
'localName should be ServiceContact');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.OWS.SERVICE_CONTACT_PARSERS_, node,
|
{}, ol.format.OWS.SERVICE_CONTACT_PARSERS_, node,
|
||||||
objectStack);
|
objectStack);
|
||||||
@@ -263,10 +214,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ServiceProvider',
|
|
||||||
'localName should be ServiceProvider');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.OWS.SERVICE_PROVIDER_PARSERS_, node,
|
{}, ol.format.OWS.SERVICE_PROVIDER_PARSERS_, node,
|
||||||
objectStack);
|
objectStack);
|
||||||
@@ -280,9 +227,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Value', 'localName should be Value');
|
|
||||||
return ol.format.XSD.readString(node);
|
return ol.format.XSD.readString(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -367,8 +367,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(features.length == 1,
|
|
||||||
'features array should have 1 item');
|
|
||||||
return this.writeFeatureText(features[0], opt_options);
|
return this.writeFeatureText(features[0], opt_options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -184,8 +184,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'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) {
|
||||||
return this.readFeatureCollectionMetadataFromNode(n);
|
return this.readFeatureCollectionMetadataFromNode(n);
|
||||||
@@ -214,10 +212,6 @@ ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
|
|||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'FeatureCollection',
|
|
||||||
'localName should be FeatureCollection');
|
|
||||||
var result = {};
|
var result = {};
|
||||||
var value = ol.format.XSD.readNonNegativeIntegerString(
|
var value = ol.format.XSD.readNonNegativeIntegerString(
|
||||||
node.getAttribute('numberOfFeatures'));
|
node.getAttribute('numberOfFeatures'));
|
||||||
@@ -325,8 +319,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'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) {
|
||||||
return this.readTransactionResponseFromNode(n);
|
return this.readTransactionResponseFromNode(n);
|
||||||
@@ -341,10 +333,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'TransactionResponse',
|
|
||||||
'localName should be TransactionResponse');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
/** @type {ol.WFSTransactionResponse} */({}),
|
/** @type {ol.WFSTransactionResponse} */({}),
|
||||||
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
|
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
|
||||||
@@ -935,8 +923,6 @@ ol.format.WFS.prototype.readProjection;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'doc.nodeType should be a DOCUMENT');
|
|
||||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
return this.readProjectionFromNode(n);
|
return this.readProjectionFromNode(n);
|
||||||
@@ -950,11 +936,6 @@ ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readProjectionFromNode = function(node) {
|
ol.format.WFS.prototype.readProjectionFromNode = function(node) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'FeatureCollection',
|
|
||||||
'localName should be FeatureCollection');
|
|
||||||
|
|
||||||
if (node.firstElementChild &&
|
if (node.firstElementChild &&
|
||||||
node.firstElementChild.firstElementChild) {
|
node.firstElementChild.firstElementChild) {
|
||||||
node = node.firstElementChild.firstElementChild;
|
node = node.firstElementChild.firstElementChild;
|
||||||
|
|||||||
@@ -205,7 +205,6 @@ ol.format.WKT.encodeGeometryLayout_ = 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];
|
||||||
ol.DEBUG && console.assert(geometryEncoder, 'geometryEncoder should be defined');
|
|
||||||
var enc = geometryEncoder(geom);
|
var enc = geometryEncoder(geom);
|
||||||
type = type.toUpperCase();
|
type = type.toUpperCase();
|
||||||
if (geom instanceof ol.geom.SimpleGeometry) {
|
if (geom instanceof ol.geom.SimpleGeometry) {
|
||||||
@@ -629,8 +628,6 @@ ol.format.WKT.Parser.prototype.match = function(type) {
|
|||||||
ol.format.WKT.Parser.prototype.parse = function() {
|
ol.format.WKT.Parser.prototype.parse = function() {
|
||||||
this.consume_();
|
this.consume_();
|
||||||
var geometry = this.parseGeometry_();
|
var geometry = this.parseGeometry_();
|
||||||
ol.DEBUG && console.assert(this.token_.type == ol.format.WKT.TokenType_.EOF,
|
|
||||||
'token type should be end of file');
|
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'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) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
@@ -59,11 +57,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'WMS_Capabilities' ||
|
|
||||||
node.localName == 'WMT_MS_Capabilities',
|
|
||||||
'localName should be WMS_Capabilities or WMT_MS_Capabilities');
|
|
||||||
this.version = node.getAttribute('version').trim();
|
this.version = node.getAttribute('version').trim();
|
||||||
var wmsCapabilityObject = ol.xml.pushParseAndPop({
|
var wmsCapabilityObject = ol.xml.pushParseAndPop({
|
||||||
'version': this.version
|
'version': this.version
|
||||||
@@ -79,12 +72,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Attribution',
|
|
||||||
'localName should be Attribution');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -95,11 +84,6 @@ ol.format.WMSCapabilities.readAttribution_ = function(node, objectStack) {
|
|||||||
* @return {Object} Bounding box object.
|
* @return {Object} Bounding box object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'BoundingBox',
|
|
||||||
'localName should be BoundingBox');
|
|
||||||
|
|
||||||
var extent = [
|
var extent = [
|
||||||
ol.format.XSD.readDecimalString(node.getAttribute('minx')),
|
ol.format.XSD.readDecimalString(node.getAttribute('minx')),
|
||||||
ol.format.XSD.readDecimalString(node.getAttribute('miny')),
|
ol.format.XSD.readDecimalString(node.getAttribute('miny')),
|
||||||
@@ -127,27 +111,23 @@ ol.format.WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
|||||||
* @return {ol.Extent|undefined} Bounding box object.
|
* @return {ol.Extent|undefined} Bounding box object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'EX_GeographicBoundingBox',
|
|
||||||
'localName should be EX_GeographicBoundingBox');
|
|
||||||
var geographicBoundingBox = ol.xml.pushParseAndPop(
|
var geographicBoundingBox = ol.xml.pushParseAndPop(
|
||||||
{},
|
{},
|
||||||
ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
|
ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
if (!geographicBoundingBox) {
|
if (!geographicBoundingBox) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
var westBoundLongitude = /** @type {number|undefined} */
|
var westBoundLongitude = /** @type {number|undefined} */
|
||||||
(geographicBoundingBox['westBoundLongitude']);
|
(geographicBoundingBox['westBoundLongitude']);
|
||||||
var southBoundLatitude = /** @type {number|undefined} */
|
var southBoundLatitude = /** @type {number|undefined} */
|
||||||
(geographicBoundingBox['southBoundLatitude']);
|
(geographicBoundingBox['southBoundLatitude']);
|
||||||
var eastBoundLongitude = /** @type {number|undefined} */
|
var eastBoundLongitude = /** @type {number|undefined} */
|
||||||
(geographicBoundingBox['eastBoundLongitude']);
|
(geographicBoundingBox['eastBoundLongitude']);
|
||||||
var northBoundLatitude = /** @type {number|undefined} */
|
var northBoundLatitude = /** @type {number|undefined} */
|
||||||
(geographicBoundingBox['northBoundLatitude']);
|
(geographicBoundingBox['northBoundLatitude']);
|
||||||
if (westBoundLongitude === undefined || southBoundLatitude === undefined ||
|
if (westBoundLongitude === undefined || southBoundLatitude === undefined ||
|
||||||
eastBoundLongitude === undefined || northBoundLatitude === undefined) {
|
eastBoundLongitude === undefined || northBoundLatitude === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
@@ -164,12 +144,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Capability',
|
|
||||||
'localName should be Capability');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -180,12 +156,8 @@ ol.format.WMSCapabilities.readCapability_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Service object.
|
* @return {Object|undefined} Service object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Service',
|
|
||||||
'localName should be Service');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -196,13 +168,9 @@ ol.format.WMSCapabilities.readService_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Contact information object.
|
* @return {Object|undefined} Contact information object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readContactInformation_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType shpuld be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ContactInformation',
|
|
||||||
'localName should be ContactInformation');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
|
{}, ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -213,13 +181,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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ContactPersonPrimary',
|
|
||||||
'localName should be ContactPersonPrimary');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_,
|
{}, ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -230,13 +194,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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'ContactAddress',
|
|
||||||
'localName should be ContactAddress');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
|
{}, ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -247,12 +207,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Exception',
|
|
||||||
'localName should be Exception');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
[], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
|
[], ol.format.WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -263,11 +219,8 @@ ol.format.WMSCapabilities.readException_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -278,27 +231,24 @@ ol.format.WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
|
|
||||||
var parentLayerObject = /** @type {Object.<string,*>} */
|
var parentLayerObject = /** @type {Object.<string,*>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
|
|
||||||
var layerObject = ol.xml.pushParseAndPop(
|
var layerObject = ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||||
|
|
||||||
if (!layerObject) {
|
if (!layerObject) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
var queryable =
|
var queryable =
|
||||||
ol.format.XSD.readBooleanString(node.getAttribute('queryable'));
|
ol.format.XSD.readBooleanString(node.getAttribute('queryable'));
|
||||||
if (queryable === undefined) {
|
if (queryable === undefined) {
|
||||||
queryable = parentLayerObject['queryable'];
|
queryable = parentLayerObject['queryable'];
|
||||||
}
|
}
|
||||||
layerObject['queryable'] = queryable !== undefined ? queryable : false;
|
layerObject['queryable'] = queryable !== undefined ? queryable : false;
|
||||||
|
|
||||||
var cascaded = ol.format.XSD.readNonNegativeIntegerString(
|
var cascaded = ol.format.XSD.readNonNegativeIntegerString(
|
||||||
node.getAttribute('cascaded'));
|
node.getAttribute('cascaded'));
|
||||||
if (cascaded === undefined) {
|
if (cascaded === undefined) {
|
||||||
cascaded = parentLayerObject['cascaded'];
|
cascaded = parentLayerObject['cascaded'];
|
||||||
}
|
}
|
||||||
@@ -311,27 +261,27 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
|
|||||||
layerObject['opaque'] = opaque !== undefined ? opaque : false;
|
layerObject['opaque'] = opaque !== undefined ? opaque : false;
|
||||||
|
|
||||||
var noSubsets =
|
var noSubsets =
|
||||||
ol.format.XSD.readBooleanString(node.getAttribute('noSubsets'));
|
ol.format.XSD.readBooleanString(node.getAttribute('noSubsets'));
|
||||||
if (noSubsets === undefined) {
|
if (noSubsets === undefined) {
|
||||||
noSubsets = parentLayerObject['noSubsets'];
|
noSubsets = parentLayerObject['noSubsets'];
|
||||||
}
|
}
|
||||||
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
|
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
|
||||||
|
|
||||||
var fixedWidth =
|
var fixedWidth =
|
||||||
ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth'));
|
ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth'));
|
||||||
if (!fixedWidth) {
|
if (!fixedWidth) {
|
||||||
fixedWidth = parentLayerObject['fixedWidth'];
|
fixedWidth = parentLayerObject['fixedWidth'];
|
||||||
}
|
}
|
||||||
layerObject['fixedWidth'] = fixedWidth;
|
layerObject['fixedWidth'] = fixedWidth;
|
||||||
|
|
||||||
var fixedHeight =
|
var fixedHeight =
|
||||||
ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight'));
|
ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight'));
|
||||||
if (!fixedHeight) {
|
if (!fixedHeight) {
|
||||||
fixedHeight = parentLayerObject['fixedHeight'];
|
fixedHeight = parentLayerObject['fixedHeight'];
|
||||||
}
|
}
|
||||||
layerObject['fixedHeight'] = fixedHeight;
|
layerObject['fixedHeight'] = fixedHeight;
|
||||||
|
|
||||||
// See 7.2.4.8
|
// See 7.2.4.8
|
||||||
var addKeys = ['Style', 'CRS', 'AuthorityURL'];
|
var addKeys = ['Style', 'CRS', 'AuthorityURL'];
|
||||||
addKeys.forEach(function(key) {
|
addKeys.forEach(function(key) {
|
||||||
if (key in parentLayerObject) {
|
if (key in parentLayerObject) {
|
||||||
@@ -360,19 +310,15 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Dimension',
|
|
||||||
'localName should be Dimension');
|
|
||||||
var dimensionObject = {
|
var dimensionObject = {
|
||||||
'name': node.getAttribute('name'),
|
'name': node.getAttribute('name'),
|
||||||
'units': node.getAttribute('units'),
|
'units': node.getAttribute('units'),
|
||||||
'unitSymbol': node.getAttribute('unitSymbol'),
|
'unitSymbol': node.getAttribute('unitSymbol'),
|
||||||
'default': node.getAttribute('default'),
|
'default': node.getAttribute('default'),
|
||||||
'multipleValues': ol.format.XSD.readBooleanString(
|
'multipleValues': ol.format.XSD.readBooleanString(
|
||||||
node.getAttribute('multipleValues')),
|
node.getAttribute('multipleValues')),
|
||||||
'nearestValue': ol.format.XSD.readBooleanString(
|
'nearestValue': ol.format.XSD.readBooleanString(
|
||||||
node.getAttribute('nearestValue')),
|
node.getAttribute('nearestValue')),
|
||||||
'current': ol.format.XSD.readBooleanString(node.getAttribute('current')),
|
'current': ol.format.XSD.readBooleanString(node.getAttribute('current')),
|
||||||
'values': ol.format.XSD.readString(node)
|
'values': ol.format.XSD.readString(node)
|
||||||
};
|
};
|
||||||
@@ -387,11 +333,9 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'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_,
|
||||||
node, objectStack);
|
node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -402,12 +346,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Request',
|
|
||||||
'localName should be Request');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -418,12 +358,8 @@ ol.format.WMSCapabilities.readRequest_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} DCP type object.
|
* @return {Object|undefined} DCP type object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'DCPType',
|
|
||||||
'localName should be DCPType');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -434,11 +370,8 @@ ol.format.WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} HTTP object.
|
* @return {Object|undefined} HTTP object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.HTTP_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -449,10 +382,8 @@ ol.format.WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Operation type object.
|
* @return {Object|undefined} Operation type object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -463,10 +394,8 @@ ol.format.WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
var formatOnlineresource =
|
var formatOnlineresource =
|
||||||
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||||
if (formatOnlineresource) {
|
if (formatOnlineresource) {
|
||||||
var size = [
|
var size = [
|
||||||
ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('width')),
|
ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('width')),
|
||||||
@@ -486,12 +415,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'AuthorityURL',
|
|
||||||
'localName should be AuthorityURL');
|
|
||||||
var authorityObject =
|
var authorityObject =
|
||||||
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||||
if (authorityObject) {
|
if (authorityObject) {
|
||||||
authorityObject['name'] = node.getAttribute('name');
|
authorityObject['name'] = node.getAttribute('name');
|
||||||
return authorityObject;
|
return authorityObject;
|
||||||
@@ -507,12 +432,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'MetadataURL',
|
|
||||||
'localName should be MetadataURL');
|
|
||||||
var metadataObject =
|
var metadataObject =
|
||||||
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||||
if (metadataObject) {
|
if (metadataObject) {
|
||||||
metadataObject['type'] = node.getAttribute('type');
|
metadataObject['type'] = node.getAttribute('type');
|
||||||
return metadataObject;
|
return metadataObject;
|
||||||
@@ -528,11 +449,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Style', 'localName should be Style');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
{}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack);
|
{}, ol.format.WMSCapabilities.STYLE_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -543,12 +461,8 @@ ol.format.WMSCapabilities.readStyle_ = function(node, objectStack) {
|
|||||||
* @return {Array.<string>|undefined} Keyword list.
|
* @return {Array.<string>|undefined} Keyword list.
|
||||||
*/
|
*/
|
||||||
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
|
ol.format.WMSCapabilities.readKeywordList_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'KeywordList',
|
|
||||||
'localName should be KeywordList');
|
|
||||||
return ol.xml.pushParseAndPop(
|
return ol.xml.pushParseAndPop(
|
||||||
[], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);
|
[], ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -70,10 +70,7 @@ ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer';
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
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_);
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
var localName = node.localName;
|
var localName = node.localName;
|
||||||
/** @type {Array.<ol.Feature>} */
|
/** @type {Array.<ol.Feature>} */
|
||||||
var features = [];
|
var features = [];
|
||||||
@@ -88,10 +85,6 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
|
|||||||
}
|
}
|
||||||
var context = objectStack[0];
|
var context = objectStack[0];
|
||||||
|
|
||||||
ol.DEBUG && console.assert(layer.localName.indexOf(
|
|
||||||
ol.format.WMSGetFeatureInfo.layerIdentifier_) >= 0,
|
|
||||||
'localName of layer node should match layerIdentifier');
|
|
||||||
|
|
||||||
var toRemove = ol.format.WMSGetFeatureInfo.layerIdentifier_;
|
var toRemove = ol.format.WMSGetFeatureInfo.layerIdentifier_;
|
||||||
var layerName = layer.localName.replace(toRemove, '');
|
var layerName = layer.localName.replace(toRemove, '');
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
|
||||||
'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) {
|
||||||
return this.readFromNode(n);
|
return this.readFromNode(n);
|
||||||
@@ -61,10 +59,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Capabilities',
|
|
||||||
'localName should be Capabilities');
|
|
||||||
var version = node.getAttribute('version').trim();
|
var version = node.getAttribute('version').trim();
|
||||||
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
|
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
|
||||||
if (!WMTSCapabilityObject) {
|
if (!WMTSCapabilityObject) {
|
||||||
@@ -72,7 +66,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
}
|
}
|
||||||
WMTSCapabilityObject['version'] = version;
|
WMTSCapabilityObject['version'] = version;
|
||||||
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
|
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
|
||||||
ol.format.WMTSCapabilities.PARSERS_, node, []);
|
ol.format.WMTSCapabilities.PARSERS_, node, []);
|
||||||
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,13 +78,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Contents',
|
|
||||||
'localName should be Contents');
|
|
||||||
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
|
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -101,11 +90,8 @@ ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layers object.
|
* @return {Object|undefined} Layers object.
|
||||||
*/
|
*/
|
||||||
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
|
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
ol.DEBUG && console.assert(node.localName == 'Layer', 'localName should be Layer');
|
|
||||||
return ol.xml.pushParseAndPop({},
|
return ol.xml.pushParseAndPop({},
|
||||||
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
|
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -208,8 +208,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -229,8 +227,6 @@ ol.format.XMLFeature.prototype.writeFeatureNode = function(feature, opt_options)
|
|||||||
*/
|
*/
|
||||||
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||||
var node = this.writeFeaturesNode(features, opt_options);
|
var node = this.writeFeaturesNode(features, opt_options);
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -249,8 +245,6 @@ ol.format.XMLFeature.prototype.writeFeaturesNode = function(features, opt_option
|
|||||||
*/
|
*/
|
||||||
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||||
var node = this.writeGeometryNode(geometry, opt_options);
|
var node = this.writeGeometryNode(geometry, opt_options);
|
||||||
ol.DEBUG && console.assert(node.nodeType == Node.ELEMENT_NODE,
|
|
||||||
'node.nodeType should be ELEMENT');
|
|
||||||
return this.xmlSerializer_.serializeToString(node);
|
return this.xmlSerializer_.serializeToString(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -154,9 +154,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(nonNegativeInteger >= 0, 'value should be more than 0');
|
|
||||||
ol.DEBUG && console.assert(nonNegativeInteger == (nonNegativeInteger | 0),
|
|
||||||
'value should be an integer value');
|
|
||||||
var string = nonNegativeInteger.toString();
|
var string = nonNegativeInteger.toString();
|
||||||
node.appendChild(ol.xml.DOCUMENT.createTextNode(string));
|
node.appendChild(ol.xml.DOCUMENT.createTextNode(string));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -163,8 +163,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(center.length == 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();
|
||||||
flatCoordinates[stride] = flatCoordinates[0] + radius;
|
flatCoordinates[stride] = flatCoordinates[0] + radius;
|
||||||
|
|||||||
@@ -148,7 +148,6 @@ ol.geom.flat.closest.getClosestPoint = function(flatCoordinates, offset, end,
|
|||||||
return minSquaredDistance;
|
return minSquaredDistance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ 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) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -102,7 +101,6 @@ 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) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ goog.require('ol');
|
|||||||
* @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) {
|
||||||
ol.DEBUG && console.assert(coordinate.length == 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) {
|
||||||
flatCoordinates[offset++] = coordinate[i];
|
flatCoordinates[offset++] = coordinate[i];
|
||||||
@@ -32,8 +30,6 @@ 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];
|
||||||
ol.DEBUG && console.assert(coordinate.length == stride,
|
|
||||||
'length of coordinate array should match stride');
|
|
||||||
var j;
|
var j;
|
||||||
for (j = 0; j < stride; ++j) {
|
for (j = 0; j < stride; ++j) {
|
||||||
flatCoordinates[offset++] = coordinate[j];
|
flatCoordinates[offset++] = coordinate[j];
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(!(key in fractions),
|
|
||||||
'fractions object should contain key : ' + key);
|
|
||||||
fractions[key] = true;
|
fractions[key] = true;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we need to subdivide the current line segment. Split it
|
// Otherwise, we need to subdivide the current line segment. Split it
|
||||||
@@ -76,8 +74,6 @@ ol.geom.flat.geodesic.line_ = function(interpolate, transform, squaredTolerance)
|
|||||||
geoStack.push(geoB, geoM, geoM, geoA);
|
geoStack.push(geoB, geoM, geoM, geoA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(maxIterations > 0,
|
|
||||||
'maxIterations should be more than 0');
|
|
||||||
|
|
||||||
return flatCoordinates;
|
return flatCoordinates;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(2 * endss.length == flatCenters.length,
|
|
||||||
'endss.length times 2 should be flatCenters.length');
|
|
||||||
var interiorPoints = [];
|
var interiorPoints = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = endss.length; i < ii; ++i) {
|
for (i = 0, ii = endss.length; i < ii; ++i) {
|
||||||
|
|||||||
@@ -15,16 +15,10 @@ goog.require('ol.math');
|
|||||||
* @return {Array.<number>} Destination.
|
* @return {Array.<number>} Destination.
|
||||||
*/
|
*/
|
||||||
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 interpolate extra dimensions
|
|
||||||
ol.DEBUG && console.assert(0 <= fraction && fraction <= 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 === 1) {
|
||||||
ol.DEBUG && console.assert(false, 'n cannot be 0');
|
|
||||||
} else if (n == 1) {
|
|
||||||
pointX = flatCoordinates[offset];
|
pointX = flatCoordinates[offset];
|
||||||
pointY = flatCoordinates[offset + 1];
|
pointY = flatCoordinates[offset + 1];
|
||||||
} else if (n == 2) {
|
} else if (n == 2) {
|
||||||
@@ -32,7 +26,7 @@ ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, str
|
|||||||
fraction * flatCoordinates[offset + stride];
|
fraction * flatCoordinates[offset + stride];
|
||||||
pointY = (1 - fraction) * flatCoordinates[offset + 1] +
|
pointY = (1 - fraction) * flatCoordinates[offset + 1] +
|
||||||
fraction * flatCoordinates[offset + stride + 1];
|
fraction * flatCoordinates[offset + stride + 1];
|
||||||
} else {
|
} else if (n !== 0) {
|
||||||
var x1 = flatCoordinates[offset];
|
var x1 = flatCoordinates[offset];
|
||||||
var y1 = flatCoordinates[offset + 1];
|
var y1 = flatCoordinates[offset + 1];
|
||||||
var length = 0;
|
var length = 0;
|
||||||
@@ -121,8 +115,6 @@ ol.geom.flat.interpolate.lineStringCoordinateAtM = function(flatCoordinates, off
|
|||||||
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];
|
||||||
ol.DEBUG && console.assert(m0 < m, 'm0 should be less than m');
|
|
||||||
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;
|
||||||
@@ -131,8 +123,6 @@ ol.geom.flat.interpolate.lineStringCoordinateAtM = function(flatCoordinates, off
|
|||||||
flatCoordinates[lo * stride + i], t));
|
flatCoordinates[lo * stride + i], t));
|
||||||
}
|
}
|
||||||
coordinate.push(m);
|
coordinate.push(m);
|
||||||
ol.DEBUG && console.assert(coordinate.length == stride,
|
|
||||||
'length of coordinate array should match stride');
|
|
||||||
return coordinate;
|
return coordinate;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -186,7 +176,5 @@ ol.geom.flat.interpolate.lineStringsCoordinateAtM = function(
|
|||||||
}
|
}
|
||||||
offset = end;
|
offset = end;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(false,
|
|
||||||
'ol.geom.flat.interpolate.lineStringsCoordinateAtM should have returned');
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ 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) {
|
||||||
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;
|
||||||
@@ -135,7 +134,6 @@ 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) {
|
||||||
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];
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ goog.require('ol.Object');
|
|||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.functions');
|
goog.require('ol.functions');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.proj.Units');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,10 +243,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
ol.proj.get(source).getUnits() !== ol.proj.Units.TILE_PIXELS &&
|
|
||||||
ol.proj.get(destination).getUnits() !== ol.proj.Units.TILE_PIXELS,
|
|
||||||
'cannot transform geometries with TILE_PIXELS units');
|
|
||||||
this.applyTransform(ol.proj.getTransform(source, destination));
|
this.applyTransform(ol.proj.getTransform(source, destination));
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -66,8 +66,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(coordinate.length == this.stride,
|
|
||||||
'length of coordinate array should match stride');
|
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = coordinate.slice();
|
this.flatCoordinates = coordinate.slice();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(lineString.getLayout() == this.layout,
|
|
||||||
'layout of lineString should match the layout');
|
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = lineString.getFlatCoordinates().slice();
|
this.flatCoordinates = lineString.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
@@ -165,8 +163,6 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getLineString = function(index) {
|
ol.geom.MultiLineString.prototype.getLineString = function(index) {
|
||||||
ol.DEBUG && console.assert(0 <= index && index < this.ends_.length,
|
|
||||||
'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;
|
||||||
}
|
}
|
||||||
@@ -285,16 +281,6 @@ ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_lay
|
|||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array.<number>} ends Ends.
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
ol.geom.MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||||
if (!flatCoordinates) {
|
|
||||||
ol.DEBUG && console.assert(ends && ends.length === 0,
|
|
||||||
'ends must be truthy and ends.length should be 0');
|
|
||||||
} else if (ends.length === 0) {
|
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length === 0,
|
|
||||||
'flatCoordinates should be an empty array');
|
|
||||||
} else {
|
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
|
|
||||||
'length of flatCoordinates array should match the last value of ends');
|
|
||||||
}
|
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||||
this.ends_ = ends;
|
this.ends_ = ends;
|
||||||
this.changed();
|
this.changed();
|
||||||
@@ -313,10 +299,6 @@ ol.geom.MultiLineString.prototype.setLineStrings = function(lineStrings) {
|
|||||||
var lineString = lineStrings[i];
|
var lineString = lineStrings[i];
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
layout = lineString.getLayout();
|
layout = lineString.getLayout();
|
||||||
} else {
|
|
||||||
// FIXME better handle the case of non-matching layouts
|
|
||||||
ol.DEBUG && console.assert(lineString.getLayout() == layout,
|
|
||||||
'layout of lineString should match layout');
|
|
||||||
}
|
}
|
||||||
ol.array.extend(flatCoordinates, lineString.getFlatCoordinates());
|
ol.array.extend(flatCoordinates, lineString.getFlatCoordinates());
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(point.getLayout() == this.layout,
|
|
||||||
'the layout of point should match layout');
|
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = point.getFlatCoordinates().slice();
|
this.flatCoordinates = point.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
@@ -104,8 +102,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(0 <= index && index < n,
|
|
||||||
'index should be in between 0 and n');
|
|
||||||
if (index < 0 || n <= index) {
|
if (index < 0 || n <= index) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(polygon.getLayout() == this.layout,
|
|
||||||
'layout of polygon should match layout');
|
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
var ends;
|
var ends;
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -279,8 +277,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(0 <= index && index < this.endss_.length,
|
|
||||||
'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,15 +385,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(endss, 'endss must be truthy');
|
|
||||||
if (!flatCoordinates || flatCoordinates.length === 0) {
|
|
||||||
ol.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0');
|
|
||||||
} else {
|
|
||||||
ol.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array');
|
|
||||||
var ends = endss[endss.length - 1];
|
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
|
|
||||||
'the length of flatCoordinates should be the last value of ends');
|
|
||||||
}
|
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||||
this.endss_ = endss;
|
this.endss_ = endss;
|
||||||
this.changed();
|
this.changed();
|
||||||
@@ -416,10 +403,6 @@ ol.geom.MultiPolygon.prototype.setPolygons = function(polygons) {
|
|||||||
var polygon = polygons[i];
|
var polygon = polygons[i];
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
layout = polygon.getLayout();
|
layout = polygon.getLayout();
|
||||||
} else {
|
|
||||||
// FIXME better handle the case of non-matching layouts
|
|
||||||
ol.DEBUG && console.assert(polygon.getLayout() == layout,
|
|
||||||
'layout of polygon should be layout');
|
|
||||||
}
|
}
|
||||||
var offset = flatCoordinates.length;
|
var offset = flatCoordinates.length;
|
||||||
ends = polygon.getEnds();
|
ends = polygon.getEnds();
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(linearRing.getLayout() == this.layout,
|
|
||||||
'layout of linearRing should match layout');
|
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = linearRing.getFlatCoordinates().slice();
|
this.flatCoordinates = linearRing.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
@@ -236,8 +234,6 @@ ol.geom.Polygon.prototype.getLinearRingCount = function() {
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getLinearRing = function(index) {
|
ol.geom.Polygon.prototype.getLinearRing = function(index) {
|
||||||
ol.DEBUG && console.assert(0 <= index && index < this.ends_.length,
|
|
||||||
'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;
|
||||||
}
|
}
|
||||||
@@ -356,16 +352,6 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array.<number>} ends Ends.
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) {
|
||||||
if (!flatCoordinates) {
|
|
||||||
ol.DEBUG && console.assert(ends && ends.length === 0,
|
|
||||||
'ends must be an empty array');
|
|
||||||
} else if (ends.length === 0) {
|
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length === 0,
|
|
||||||
'flatCoordinates should be an empty array');
|
|
||||||
} else {
|
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
|
|
||||||
'the length of flatCoordinates should be the last entry of ends');
|
|
||||||
}
|
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||||
this.ends_ = ends;
|
this.ends_ = ends;
|
||||||
this.changed();
|
this.changed();
|
||||||
@@ -460,7 +446,6 @@ 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();
|
||||||
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;
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ ol.geom.SimpleGeometry.getLayoutForStride_ = function(stride) {
|
|||||||
} else if (stride == 4) {
|
} else if (stride == 4) {
|
||||||
layout = ol.geom.GeometryLayout.XYZM;
|
layout = ol.geom.GeometryLayout.XYZM;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(layout, 'unsupported stride: ' + stride);
|
|
||||||
return /** @type {ol.geom.GeometryLayout} */ (layout);
|
return /** @type {ol.geom.GeometryLayout} */ (layout);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -76,7 +75,6 @@ ol.geom.SimpleGeometry.getStrideForLayout = function(layout) {
|
|||||||
} else if (layout == ol.geom.GeometryLayout.XYZM) {
|
} else if (layout == ol.geom.GeometryLayout.XYZM) {
|
||||||
stride = 4;
|
stride = 4;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(stride, 'unsupported layout: ' + layout);
|
|
||||||
return /** @type {number} */ (stride);
|
return /** @type {number} */ (stride);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+82
-111
@@ -18,119 +18,116 @@ goog.require('ol.style.Stroke');
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.Graticule = function(opt_options) {
|
ol.Graticule = function(opt_options) {
|
||||||
|
|
||||||
var options = opt_options || {};
|
var options = opt_options || {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.Map}
|
* @type {ol.Map}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.map_ = null;
|
this.map_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.proj.Projection}
|
* @type {ol.proj.Projection}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.projection_ = null;
|
this.projection_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxLat_ = Infinity;
|
this.maxLat_ = Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxLon_ = Infinity;
|
this.maxLon_ = Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.minLat_ = -Infinity;
|
this.minLat_ = -Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.minLon_ = -Infinity;
|
this.minLon_ = -Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxLatP_ = Infinity;
|
this.maxLatP_ = Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxLonP_ = Infinity;
|
this.maxLonP_ = Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.minLatP_ = -Infinity;
|
this.minLatP_ = -Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.minLonP_ = -Infinity;
|
this.minLonP_ = -Infinity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.targetSize_ = options.targetSize !== undefined ?
|
this.targetSize_ = options.targetSize !== undefined ?
|
||||||
options.targetSize : 100;
|
options.targetSize : 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
||||||
ol.DEBUG && console.assert(this.maxLines_ > 0,
|
|
||||||
'this.maxLines_ should be more than 0');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<ol.geom.LineString>}
|
* @type {Array.<ol.geom.LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridians_ = [];
|
this.meridians_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<ol.geom.LineString>}
|
* @type {Array.<ol.geom.LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallels_ = [];
|
this.parallels_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.style.Stroke}
|
* @type {ol.style.Stroke}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.strokeStyle_ = options.strokeStyle !== undefined ?
|
this.strokeStyle_ = options.strokeStyle !== undefined ?
|
||||||
options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_;
|
options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.TransformFunction|undefined}
|
* @type {ol.TransformFunction|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.fromLonLatTransform_ = undefined;
|
this.fromLonLatTransform_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.TransformFunction|undefined}
|
* @type {ol.TransformFunction|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.toLonLatTransform_ = undefined;
|
this.toLonLatTransform_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.Coordinate}
|
* @type {ol.Coordinate}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.projectionCenterLonLat_ = null;
|
this.projectionCenterLonLat_ = null;
|
||||||
|
|
||||||
this.setMap(options.map !== undefined ? options.map : null);
|
this.setMap(options.map !== undefined ? options.map : null);
|
||||||
@@ -334,16 +331,10 @@ 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) {
|
||||||
ol.DEBUG && console.assert(lon >= this.minLon_,
|
|
||||||
'lon should be larger than or equal to this.minLon_');
|
|
||||||
ol.DEBUG && console.assert(lon <= 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);
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length > 0,
|
|
||||||
'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);
|
||||||
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
||||||
return lineString;
|
return lineString;
|
||||||
};
|
};
|
||||||
@@ -370,16 +361,10 @@ 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) {
|
||||||
ol.DEBUG && console.assert(lat >= this.minLat_,
|
|
||||||
'lat should be larger than or equal to this.minLat_');
|
|
||||||
ol.DEBUG && console.assert(lat <= 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);
|
||||||
ol.DEBUG && console.assert(flatCoordinates.length > 0,
|
|
||||||
'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);
|
||||||
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
||||||
return lineString;
|
return lineString;
|
||||||
};
|
};
|
||||||
@@ -461,7 +446,7 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) {
|
|||||||
var extent = projection.getExtent();
|
var extent = projection.getExtent();
|
||||||
var worldExtent = projection.getWorldExtent();
|
var worldExtent = projection.getWorldExtent();
|
||||||
var worldExtentP = ol.proj.transformExtent(worldExtent,
|
var worldExtentP = ol.proj.transformExtent(worldExtent,
|
||||||
epsg4326Projection, projection);
|
epsg4326Projection, projection);
|
||||||
|
|
||||||
var maxLat = worldExtent[3];
|
var maxLat = worldExtent[3];
|
||||||
var maxLon = worldExtent[2];
|
var maxLon = worldExtent[2];
|
||||||
@@ -473,20 +458,6 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) {
|
|||||||
var minLatP = worldExtentP[1];
|
var minLatP = worldExtentP[1];
|
||||||
var minLonP = worldExtentP[0];
|
var minLonP = worldExtentP[0];
|
||||||
|
|
||||||
ol.DEBUG && console.assert(maxLat !== undefined, 'maxLat should be defined');
|
|
||||||
ol.DEBUG && console.assert(maxLon !== undefined, 'maxLon should be defined');
|
|
||||||
ol.DEBUG && console.assert(minLat !== undefined, 'minLat should be defined');
|
|
||||||
ol.DEBUG && console.assert(minLon !== undefined, 'minLon should be defined');
|
|
||||||
|
|
||||||
ol.DEBUG && console.assert(maxLatP !== undefined,
|
|
||||||
'projected maxLat should be defined');
|
|
||||||
ol.DEBUG && console.assert(maxLonP !== undefined,
|
|
||||||
'projected maxLon should be defined');
|
|
||||||
ol.DEBUG && console.assert(minLatP !== undefined,
|
|
||||||
'projected minLat should be defined');
|
|
||||||
ol.DEBUG && console.assert(minLonP !== undefined,
|
|
||||||
'projected minLon should be defined');
|
|
||||||
|
|
||||||
this.maxLat_ = maxLat;
|
this.maxLat_ = maxLat;
|
||||||
this.maxLon_ = maxLon;
|
this.maxLon_ = maxLon;
|
||||||
this.minLat_ = minLat;
|
this.minLat_ = minLat;
|
||||||
@@ -499,13 +470,13 @@ ol.Graticule.prototype.updateProjectionInfo_ = function(projection) {
|
|||||||
|
|
||||||
|
|
||||||
this.fromLonLatTransform_ = ol.proj.getTransform(
|
this.fromLonLatTransform_ = ol.proj.getTransform(
|
||||||
epsg4326Projection, projection);
|
epsg4326Projection, projection);
|
||||||
|
|
||||||
this.toLonLatTransform_ = ol.proj.getTransform(
|
this.toLonLatTransform_ = ol.proj.getTransform(
|
||||||
projection, epsg4326Projection);
|
projection, epsg4326Projection);
|
||||||
|
|
||||||
this.projectionCenterLonLat_ = this.toLonLatTransform_(
|
this.projectionCenterLonLat_ = this.toLonLatTransform_(
|
||||||
ol.extent.getCenter(extent));
|
ol.extent.getCenter(extent));
|
||||||
|
|
||||||
this.projection_ = projection;
|
this.projection_ = projection;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -131,8 +131,6 @@ ol.Image.prototype.load = function() {
|
|||||||
if (this.state == ol.ImageState.IDLE || this.state == ol.ImageState.ERROR) {
|
if (this.state == ol.ImageState.IDLE || this.state == ol.ImageState.ERROR) {
|
||||||
this.state = ol.ImageState.LOADING;
|
this.state = ol.ImageState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
ol.DEBUG && console.assert(!this.imageListenerKeys_,
|
|
||||||
'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,
|
||||||
this.handleImageError_, this),
|
this.handleImageError_, this),
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ ol.ImageBase.prototype.getPixelRatio = function() {
|
|||||||
* @return {number} Resolution.
|
* @return {number} Resolution.
|
||||||
*/
|
*/
|
||||||
ol.ImageBase.prototype.getResolution = function() {
|
ol.ImageBase.prototype.getResolution = function() {
|
||||||
ol.DEBUG && console.assert(this.resolution !== undefined, 'resolution not yet set');
|
|
||||||
return /** @type {number} */ (this.resolution);
|
return /** @type {number} */ (this.resolution);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ ol.ImageCanvas.prototype.handleLoad_ = function(err) {
|
|||||||
*/
|
*/
|
||||||
ol.ImageCanvas.prototype.load = function() {
|
ol.ImageCanvas.prototype.load = function() {
|
||||||
if (this.state == ol.ImageState.IDLE) {
|
if (this.state == ol.ImageState.IDLE) {
|
||||||
ol.DEBUG && console.assert(this.loader_, 'this.loader_ must be set');
|
|
||||||
this.state = ol.ImageState.LOADING;
|
this.state = ol.ImageState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
this.loader_(this.handleLoad_.bind(this));
|
this.loader_(this.handleLoad_.bind(this));
|
||||||
|
|||||||
@@ -125,8 +125,6 @@ ol.ImageTile.prototype.load = function() {
|
|||||||
if (this.state == ol.TileState.IDLE || this.state == ol.TileState.ERROR) {
|
if (this.state == ol.TileState.IDLE || this.state == ol.TileState.ERROR) {
|
||||||
this.state = ol.TileState.LOADING;
|
this.state = ol.TileState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
ol.DEBUG && console.assert(!this.imageListenerKeys_,
|
|
||||||
'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,
|
||||||
this.handleImageError_, this),
|
this.handleImageError_, this),
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ 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`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -100,8 +100,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(projection !== undefined,
|
|
||||||
'projection should be defined');
|
|
||||||
}
|
}
|
||||||
var formatConstructors = this.formatConstructors_;
|
var formatConstructors = this.formatConstructors_;
|
||||||
var features = [];
|
var features = [];
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
||||||
ol.DEBUG && console.assert(this.targetPointers.length >= 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);
|
||||||
if (this.kinetic_) {
|
if (this.kinetic_) {
|
||||||
|
|||||||
@@ -476,7 +476,6 @@ 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_);
|
||||||
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_);
|
||||||
@@ -512,7 +511,6 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
|
|||||||
}
|
}
|
||||||
last[0] = coordinate[0];
|
last[0] = coordinate[0];
|
||||||
last[1] = coordinate[1];
|
last[1] = coordinate[1];
|
||||||
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);
|
||||||
@@ -680,10 +678,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(this.mode_ == ol.interaction.Draw.Mode_.LINE_STRING,
|
|
||||||
'interaction mode must be "line"');
|
|
||||||
ol.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.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;
|
||||||
this.sketchCoords_ = lineString.getCoordinates();
|
this.sketchCoords_ = lineString.getCoordinates();
|
||||||
|
|||||||
@@ -931,8 +931,6 @@ 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) {
|
||||||
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,
|
||||||
feature: segmentData.feature,
|
feature: segmentData.feature,
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ ol.inherits(ol.interaction.PinchRotate, ol.interaction.Pointer);
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||||
ol.DEBUG && console.assert(this.targetPointers.length >= 2,
|
|
||||||
'length of this.targetPointers should be greater than or equal to 2');
|
|
||||||
var rotationDelta = 0.0;
|
var rotationDelta = 0.0;
|
||||||
|
|
||||||
var touch0 = this.targetPointers[0];
|
var touch0 = this.targetPointers[0];
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ ol.inherits(ol.interaction.PinchZoom, ol.interaction.Pointer);
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
||||||
ol.DEBUG && console.assert(this.targetPointers.length >= 2,
|
|
||||||
'length of this.targetPointers should be 2 or more');
|
|
||||||
var scaleDelta = 1.0;
|
var scaleDelta = 1.0;
|
||||||
|
|
||||||
var touch0 = this.targetPointers[0];
|
var touch0 = this.targetPointers[0];
|
||||||
@@ -102,7 +100,6 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
map.render();
|
map.render();
|
||||||
ol.interaction.Interaction.zoomWithoutConstraints(
|
ol.interaction.Interaction.zoomWithoutConstraints(
|
||||||
map, view, resolution * scaleDelta, this.anchor_);
|
map, view, resolution * scaleDelta, this.anchor_);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,8 +123,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(!(key in this.listenerKeys_),
|
|
||||||
'listeners already registered');
|
|
||||||
this.listenerKeys_[key] = [
|
this.listenerKeys_[key] = [
|
||||||
ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE,
|
ol.events.listen(layer, ol.ObjectEventType.PROPERTYCHANGE,
|
||||||
this.handleLayerChange_, this),
|
this.handleLayerChange_, this),
|
||||||
@@ -142,7 +140,6 @@ 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();
|
||||||
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();
|
||||||
|
|||||||
@@ -90,13 +90,8 @@ ol.layer.Heatmap = function(opt_options) {
|
|||||||
} else {
|
} else {
|
||||||
weightFunction = weight;
|
weightFunction = weight;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(typeof weightFunction === 'function',
|
|
||||||
'weightFunction should be a function');
|
|
||||||
|
|
||||||
this.setStyle(function(feature, resolution) {
|
this.setStyle(function(feature, resolution) {
|
||||||
ol.DEBUG && console.assert(this.styleCache_, 'this.styleCache_ expected');
|
|
||||||
ol.DEBUG && console.assert(this.circleImage_ !== undefined,
|
|
||||||
'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;
|
||||||
// cast to 8 bits
|
// cast to 8 bits
|
||||||
@@ -121,7 +116,6 @@ ol.layer.Heatmap = function(opt_options) {
|
|||||||
this.setRenderOrder(null);
|
this.setRenderOrder(null);
|
||||||
|
|
||||||
ol.events.listen(this, ol.render.EventType.RENDER, this.handleRender_, this);
|
ol.events.listen(this, ol.render.EventType.RENDER, this.handleRender_, this);
|
||||||
|
|
||||||
};
|
};
|
||||||
ol.inherits(ol.layer.Heatmap, ol.layer.Vector);
|
ol.inherits(ol.layer.Heatmap, ol.layer.Vector);
|
||||||
|
|
||||||
@@ -163,8 +157,6 @@ 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();
|
||||||
ol.DEBUG && console.assert(radius !== undefined && blur !== undefined,
|
|
||||||
'radius and blur should be defined');
|
|
||||||
var halfSize = radius + blur + 1;
|
var halfSize = radius + blur + 1;
|
||||||
var size = 2 * halfSize;
|
var size = 2 * halfSize;
|
||||||
var context = ol.dom.createCanvasContext2D(size, size);
|
var context = ol.dom.createCanvasContext2D(size, size);
|
||||||
@@ -236,9 +228,6 @@ ol.layer.Heatmap.prototype.handleStyleChanged_ = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.layer.Heatmap.prototype.handleRender_ = function(event) {
|
ol.layer.Heatmap.prototype.handleRender_ = function(event) {
|
||||||
ol.DEBUG && console.assert(event.type == ol.render.EventType.RENDER,
|
|
||||||
'event.type should be RENDER');
|
|
||||||
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);
|
||||||
|
|||||||
+26
-37
@@ -23,14 +23,8 @@ goog.require('ol.style.Style');
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector = function(opt_options) {
|
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} */ ({});
|
||||||
|
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
options.renderOrder === undefined || !options.renderOrder ||
|
|
||||||
typeof options.renderOrder === 'function',
|
|
||||||
'renderOrder must be a comparator function');
|
|
||||||
|
|
||||||
var baseOptions = ol.obj.assign({}, options);
|
var baseOptions = ol.obj.assign({}, options);
|
||||||
|
|
||||||
@@ -40,43 +34,42 @@ ol.layer.Vector = function(opt_options) {
|
|||||||
delete baseOptions.updateWhileInteracting;
|
delete baseOptions.updateWhileInteracting;
|
||||||
ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.renderBuffer_ = options.renderBuffer !== undefined ?
|
this.renderBuffer_ = options.renderBuffer !== undefined ?
|
||||||
options.renderBuffer : 100;
|
options.renderBuffer : 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User provided style.
|
* User provided style.
|
||||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.style_ = null;
|
this.style_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style function for use within the library.
|
* Style function for use within the library.
|
||||||
* @type {ol.StyleFunction|undefined}
|
* @type {ol.StyleFunction|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.styleFunction_ = undefined;
|
this.styleFunction_ = undefined;
|
||||||
|
|
||||||
this.setStyle(options.style);
|
this.setStyle(options.style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ?
|
this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ?
|
||||||
options.updateWhileAnimating : false;
|
options.updateWhileAnimating : false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ?
|
this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ?
|
||||||
options.updateWhileInteracting : false;
|
options.updateWhileInteracting : false;
|
||||||
|
|
||||||
};
|
};
|
||||||
ol.inherits(ol.layer.Vector, ol.layer.Layer);
|
ol.inherits(ol.layer.Vector, ol.layer.Layer);
|
||||||
|
|
||||||
@@ -168,10 +161,6 @@ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() {
|
|||||||
* Render order.
|
* Render order.
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
|
ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
renderOrder === undefined || !renderOrder ||
|
|
||||||
typeof renderOrder === 'function',
|
|
||||||
'renderOrder must be a comparator function');
|
|
||||||
this.set(ol.layer.Vector.Property_.RENDER_ORDER, renderOrder);
|
this.set(ol.layer.Vector.Property_.RENDER_ORDER, renderOrder);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -529,7 +529,6 @@ ol.Map.prototype.addOverlayInternal_ = function(overlay) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.beforeRender = function(var_args) {
|
ol.Map.prototype.beforeRender = function(var_args) {
|
||||||
ol.DEBUG && console.warn('map.beforeRender() is deprecated. Use view.animate() instead.');
|
|
||||||
this.render();
|
this.render();
|
||||||
Array.prototype.push.apply(this.preRenderFunctions_, arguments);
|
Array.prototype.push.apply(this.preRenderFunctions_, arguments);
|
||||||
};
|
};
|
||||||
@@ -1025,8 +1024,6 @@ ol.Map.prototype.handleTargetChanged_ = function() {
|
|||||||
var targetElement;
|
var targetElement;
|
||||||
if (this.getTarget()) {
|
if (this.getTarget()) {
|
||||||
targetElement = this.getTargetElement();
|
targetElement = this.getTargetElement();
|
||||||
ol.DEBUG && console.assert(targetElement !== null,
|
|
||||||
'expects a non-null value for targetElement');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.keyHandlerKeys_) {
|
if (this.keyHandlerKeys_) {
|
||||||
@@ -1462,7 +1459,6 @@ ol.Map.createOptionsInternal = function(options) {
|
|||||||
ol.asserts.assert(false, 46); // Incorrect format for `renderer` option
|
ol.asserts.assert(false, 46); // Incorrect format for `renderer` option
|
||||||
}
|
}
|
||||||
if (rendererTypes.indexOf(/** @type {ol.renderer.Type} */ ('dom')) >= 0) {
|
if (rendererTypes.indexOf(/** @type {ol.renderer.Type} */ ('dom')) >= 0) {
|
||||||
ol.DEBUG && console.assert(false, 'The DOM render has been removed');
|
|
||||||
rendererTypes = rendererTypes.concat(ol.DEFAULT_RENDERER_TYPES);
|
rendererTypes = rendererTypes.concat(ol.DEFAULT_RENDERER_TYPES);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -156,20 +156,17 @@ ol.MapBrowserEventHandler.prototype.updateActivePointers_ = function(pointerEven
|
|||||||
ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
|
ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
|
||||||
this.updateActivePointers_(pointerEvent);
|
this.updateActivePointers_(pointerEvent);
|
||||||
var newEvent = new ol.MapBrowserPointerEvent(
|
var newEvent = new ol.MapBrowserPointerEvent(
|
||||||
ol.MapBrowserEventType.POINTERUP, this.map_, pointerEvent);
|
ol.MapBrowserEventType.POINTERUP, this.map_, pointerEvent);
|
||||||
this.dispatchEvent(newEvent);
|
this.dispatchEvent(newEvent);
|
||||||
|
|
||||||
// We emulate click events on left mouse button click, touch contact, and pen
|
// We emulate click events on left mouse button click, touch contact, and pen
|
||||||
// contact. isMouseActionButton returns true in these cases (evt.button is set
|
// contact. isMouseActionButton returns true in these cases (evt.button is set
|
||||||
// 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)) {
|
||||||
ol.DEBUG && console.assert(this.down_, 'this.down_ must be truthy');
|
|
||||||
this.emulateClick_(this.down_);
|
this.emulateClick_(this.down_);
|
||||||
}
|
}
|
||||||
|
|
||||||
ol.DEBUG && console.assert(this.activePointers_ >= 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);
|
||||||
this.dragListenerKeys_.length = 0;
|
this.dragListenerKeys_.length = 0;
|
||||||
|
|||||||
@@ -107,13 +107,6 @@ 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 (ol.DEBUG) {
|
|
||||||
for (var row = 0; row < n; row++) {
|
|
||||||
console.assert(mat[row].length == n + 1,
|
|
||||||
'every row should have correct number of columns');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < n; i++) {
|
for (var i = 0; i < n; i++) {
|
||||||
// Find max in the i-th column (ignoring i - 1 first rows)
|
// Find max in the i-th column (ignoring i - 1 first rows)
|
||||||
var maxRow = i;
|
var maxRow = i;
|
||||||
|
|||||||
@@ -463,8 +463,6 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
var offset = this.getOffset();
|
var offset = this.getOffset();
|
||||||
|
|
||||||
var positioning = this.getPositioning();
|
var positioning = this.getPositioning();
|
||||||
ol.DEBUG && console.assert(positioning !== undefined,
|
|
||||||
'positioning should be defined');
|
|
||||||
|
|
||||||
var offsetX = offset[0];
|
var offsetX = offset[0];
|
||||||
var offsetY = offset[1];
|
var offsetY = offset[1];
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ if (ol.ENABLE_PROJ4JS) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.proj.setProj4 = function(proj4) {
|
ol.proj.setProj4 = function(proj4) {
|
||||||
ol.DEBUG && console.assert(typeof proj4 == 'function',
|
|
||||||
'proj4 argument should be a function');
|
|
||||||
ol.proj.proj4.set(proj4);
|
ol.proj.proj4.set(proj4);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -376,7 +374,6 @@ ol.proj.getTransformFromProjections = function(sourceProjection, destinationProj
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!transform) {
|
if (!transform) {
|
||||||
ol.DEBUG && console.assert(transform, 'transform should be defined');
|
|
||||||
transform = ol.proj.identityTransform;
|
transform = ol.proj.identityTransform;
|
||||||
}
|
}
|
||||||
return transform;
|
return transform;
|
||||||
@@ -391,8 +388,6 @@ 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
|
|
||||||
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];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,8 +109,6 @@ ol.proj.EPSG3857.fromEPSG4326 = function(input, opt_output, opt_dimension) {
|
|||||||
output = new Array(length);
|
output = new Array(length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(output.length % dimension === 0,
|
|
||||||
'modulus of output.length with dimension should be 0');
|
|
||||||
var halfSize = ol.proj.EPSG3857.HALF_SIZE;
|
var halfSize = ol.proj.EPSG3857.HALF_SIZE;
|
||||||
for (var i = 0; i < length; i += dimension) {
|
for (var i = 0; i < length; i += dimension) {
|
||||||
output[i] = halfSize * input[i] / 180;
|
output[i] = halfSize * input[i] / 180;
|
||||||
@@ -147,8 +145,6 @@ ol.proj.EPSG3857.toEPSG4326 = function(input, opt_output, opt_dimension) {
|
|||||||
output = new Array(length);
|
output = new Array(length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(output.length % dimension === 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.HALF_SIZE;
|
output[i] = 180 * input[i] / ol.proj.EPSG3857.HALF_SIZE;
|
||||||
output[i + 1] = 360 * Math.atan(
|
output[i + 1] = 360 * Math.atan(
|
||||||
|
|||||||
+42
-46
@@ -36,72 +36,69 @@ goog.require('ol.proj.proj4');
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.proj.Projection = function(options) {
|
ol.proj.Projection = function(options) {
|
||||||
|
/**
|
||||||
/**
|
* @private
|
||||||
* @private
|
* @type {string}
|
||||||
* @type {string}
|
*/
|
||||||
*/
|
|
||||||
this.code_ = options.code;
|
this.code_ = options.code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.proj.Units}
|
* @type {ol.proj.Units}
|
||||||
*/
|
*/
|
||||||
this.units_ = /** @type {ol.proj.Units} */ (options.units);
|
this.units_ = /** @type {ol.proj.Units} */ (options.units);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.Extent}
|
* @type {ol.Extent}
|
||||||
*/
|
*/
|
||||||
this.extent_ = options.extent !== undefined ? options.extent : null;
|
this.extent_ = options.extent !== undefined ? options.extent : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.Extent}
|
* @type {ol.Extent}
|
||||||
*/
|
*/
|
||||||
this.worldExtent_ = options.worldExtent !== undefined ?
|
this.worldExtent_ = options.worldExtent !== undefined ?
|
||||||
options.worldExtent : null;
|
options.worldExtent : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.axisOrientation_ = options.axisOrientation !== undefined ?
|
this.axisOrientation_ = options.axisOrientation !== undefined ?
|
||||||
options.axisOrientation : 'enu';
|
options.axisOrientation : 'enu';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
this.global_ = options.global !== undefined ? options.global : false;
|
this.global_ = options.global !== undefined ? options.global : false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
this.canWrapX_ = !!(this.global_ && this.extent_);
|
this.canWrapX_ = !!(this.global_ && this.extent_);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function(number, ol.Coordinate):number|undefined}
|
* @type {function(number, ol.Coordinate):number|undefined}
|
||||||
*/
|
*/
|
||||||
this.getPointResolutionFunc_ = options.getPointResolution;
|
this.getPointResolutionFunc_ = options.getPointResolution;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.tilegrid.TileGrid}
|
* @type {ol.tilegrid.TileGrid}
|
||||||
*/
|
*/
|
||||||
this.defaultTileGrid_ = null;
|
this.defaultTileGrid_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
*/
|
*/
|
||||||
this.metersPerUnit_ = options.metersPerUnit;
|
this.metersPerUnit_ = options.metersPerUnit;
|
||||||
|
|
||||||
var code = options.code;
|
var code = options.code;
|
||||||
ol.DEBUG && console.assert(code !== undefined,
|
|
||||||
'Option "code" is required for constructing instance');
|
|
||||||
if (ol.ENABLE_PROJ4JS) {
|
if (ol.ENABLE_PROJ4JS) {
|
||||||
var proj4js = ol.proj.proj4.get();
|
var proj4js = ol.proj.proj4.get();
|
||||||
if (typeof proj4js == 'function') {
|
if (typeof proj4js == 'function') {
|
||||||
@@ -119,7 +116,6 @@ ol.proj.Projection = function(options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,6 @@ ol.proj.transforms.remove = function(source, destination) {
|
|||||||
var sourceCode = source.getCode();
|
var sourceCode = source.getCode();
|
||||||
var destinationCode = destination.getCode();
|
var destinationCode = destination.getCode();
|
||||||
var transforms = ol.proj.transforms.cache_;
|
var transforms = ol.proj.transforms.cache_;
|
||||||
ol.DEBUG && console.assert(sourceCode in transforms,
|
|
||||||
'sourceCode should be in transforms');
|
|
||||||
ol.DEBUG && console.assert(destinationCode in transforms[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];
|
||||||
if (ol.obj.isEmpty(transforms[sourceCode])) {
|
if (ol.obj.isEmpty(transforms[sourceCode])) {
|
||||||
|
|||||||
@@ -120,35 +120,15 @@ ol.render.canvas.ImageReplay.prototype.drawPoint = function(pointGeometry, featu
|
|||||||
if (!this.image_) {
|
if (!this.image_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(this.anchorX_ !== undefined,
|
|
||||||
'this.anchorX_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.anchorY_ !== undefined,
|
|
||||||
'this.anchorY_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.height_ !== undefined,
|
|
||||||
'this.height_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.opacity_ !== undefined,
|
|
||||||
'this.opacity_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.originX_ !== undefined,
|
|
||||||
'this.originX_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.originY_ !== undefined,
|
|
||||||
'this.originY_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
|
|
||||||
'this.rotateWithView_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotation_ !== undefined,
|
|
||||||
'this.rotation_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.scale_ !== undefined,
|
|
||||||
'this.scale_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.width_ !== undefined,
|
|
||||||
'this.width_ should be defined');
|
|
||||||
this.beginGeometry(pointGeometry, feature);
|
this.beginGeometry(pointGeometry, feature);
|
||||||
var flatCoordinates = pointGeometry.getFlatCoordinates();
|
var flatCoordinates = pointGeometry.getFlatCoordinates();
|
||||||
var stride = pointGeometry.getStride();
|
var stride = pointGeometry.getStride();
|
||||||
var myBegin = this.coordinates.length;
|
var myBegin = this.coordinates.length;
|
||||||
var myEnd = this.drawCoordinates_(
|
var myEnd = this.drawCoordinates_(
|
||||||
flatCoordinates, 0, flatCoordinates.length, stride);
|
flatCoordinates, 0, flatCoordinates.length, stride);
|
||||||
this.instructions.push([
|
this.instructions.push([
|
||||||
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_,
|
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_,
|
||||||
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
||||||
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
||||||
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
||||||
this.scale_, this.snapToPixel_, this.width_
|
this.scale_, this.snapToPixel_, this.width_
|
||||||
@@ -156,7 +136,7 @@ ol.render.canvas.ImageReplay.prototype.drawPoint = function(pointGeometry, featu
|
|||||||
this.hitDetectionInstructions.push([
|
this.hitDetectionInstructions.push([
|
||||||
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd,
|
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd,
|
||||||
this.hitDetectionImage_,
|
this.hitDetectionImage_,
|
||||||
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
||||||
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
||||||
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
||||||
this.scale_, this.snapToPixel_, this.width_
|
this.scale_, this.snapToPixel_, this.width_
|
||||||
@@ -172,35 +152,15 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPoint = function(multiPointGeome
|
|||||||
if (!this.image_) {
|
if (!this.image_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(this.anchorX_ !== undefined,
|
|
||||||
'this.anchorX_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.anchorY_ !== undefined,
|
|
||||||
'this.anchorY_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.height_ !== undefined,
|
|
||||||
'this.height_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.opacity_ !== undefined,
|
|
||||||
'this.opacity_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.originX_ !== undefined,
|
|
||||||
'this.originX_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.originY_ !== undefined,
|
|
||||||
'this.originY_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
|
|
||||||
'this.rotateWithView_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotation_ !== undefined,
|
|
||||||
'this.rotation_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.scale_ !== undefined,
|
|
||||||
'this.scale_ should be defined');
|
|
||||||
ol.DEBUG && console.assert(this.width_ !== undefined,
|
|
||||||
'this.width_ should be defined');
|
|
||||||
this.beginGeometry(multiPointGeometry, feature);
|
this.beginGeometry(multiPointGeometry, feature);
|
||||||
var flatCoordinates = multiPointGeometry.getFlatCoordinates();
|
var flatCoordinates = multiPointGeometry.getFlatCoordinates();
|
||||||
var stride = multiPointGeometry.getStride();
|
var stride = multiPointGeometry.getStride();
|
||||||
var myBegin = this.coordinates.length;
|
var myBegin = this.coordinates.length;
|
||||||
var myEnd = this.drawCoordinates_(
|
var myEnd = this.drawCoordinates_(
|
||||||
flatCoordinates, 0, flatCoordinates.length, stride);
|
flatCoordinates, 0, flatCoordinates.length, stride);
|
||||||
this.instructions.push([
|
this.instructions.push([
|
||||||
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_,
|
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd, this.image_,
|
||||||
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
||||||
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
||||||
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
||||||
this.scale_, this.snapToPixel_, this.width_
|
this.scale_, this.snapToPixel_, this.width_
|
||||||
@@ -208,7 +168,7 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPoint = function(multiPointGeome
|
|||||||
this.hitDetectionInstructions.push([
|
this.hitDetectionInstructions.push([
|
||||||
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd,
|
ol.render.canvas.Instruction.DRAW_IMAGE, myBegin, myEnd,
|
||||||
this.hitDetectionImage_,
|
this.hitDetectionImage_,
|
||||||
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
// Remaining arguments to DRAW_IMAGE are in alphabetical order
|
||||||
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
this.anchorX_, this.anchorY_, this.height_, this.opacity_,
|
||||||
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
this.originX_, this.originY_, this.rotateWithView_, this.rotation_,
|
||||||
this.scale_, this.snapToPixel_, this.width_
|
this.scale_, this.snapToPixel_, this.width_
|
||||||
@@ -243,18 +203,11 @@ 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) {
|
||||||
ol.DEBUG && console.assert(imageStyle, 'imageStyle should not be null');
|
|
||||||
var anchor = imageStyle.getAnchor();
|
var anchor = imageStyle.getAnchor();
|
||||||
ol.DEBUG && console.assert(anchor, 'anchor should not be null');
|
|
||||||
var size = imageStyle.getSize();
|
var size = imageStyle.getSize();
|
||||||
ol.DEBUG && console.assert(size, 'size should not be null');
|
|
||||||
var hitDetectionImage = imageStyle.getHitDetectionImage(1);
|
var hitDetectionImage = imageStyle.getHitDetectionImage(1);
|
||||||
ol.DEBUG && console.assert(hitDetectionImage,
|
|
||||||
'hitDetectionImage should not be null');
|
|
||||||
var image = imageStyle.getImage(1);
|
var image = imageStyle.getImage(1);
|
||||||
ol.DEBUG && console.assert(image, 'image should not be null');
|
|
||||||
var origin = imageStyle.getOrigin();
|
var origin = imageStyle.getOrigin();
|
||||||
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;
|
||||||
|
|||||||
@@ -251,9 +251,6 @@ ol.render.canvas.Immediate.prototype.drawImages_ = function(flatCoordinates, off
|
|||||||
if (!this.image_) {
|
if (!this.image_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(offset === 0, 'offset should be 0');
|
|
||||||
ol.DEBUG && console.assert(end == flatCoordinates.length,
|
|
||||||
'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_,
|
||||||
this.pixelCoordinates_);
|
this.pixelCoordinates_);
|
||||||
@@ -316,9 +313,6 @@ 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_);
|
||||||
ol.DEBUG && console.assert(offset === 0, 'offset should be 0');
|
|
||||||
ol.DEBUG && console.assert(end == flatCoordinates.length,
|
|
||||||
'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_,
|
||||||
this.pixelCoordinates_);
|
this.pixelCoordinates_);
|
||||||
@@ -487,7 +481,6 @@ 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:
|
||||||
ol.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -862,7 +855,6 @@ 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();
|
||||||
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];
|
||||||
|
|||||||
@@ -110,13 +110,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(strokeStyle !== undefined,
|
|
||||||
'strokeStyle should be defined');
|
|
||||||
ol.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined');
|
|
||||||
ol.DEBUG && console.assert(lineDash, 'lineDash should not be null');
|
|
||||||
ol.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined');
|
|
||||||
ol.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth 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) ||
|
||||||
@@ -148,7 +141,6 @@ 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_;
|
||||||
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) {
|
||||||
@@ -176,7 +168,6 @@ 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_;
|
||||||
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) {
|
||||||
@@ -210,7 +201,6 @@ 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_;
|
||||||
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]);
|
||||||
}
|
}
|
||||||
@@ -223,9 +213,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
|
|
||||||
ol.DEBUG && console.assert(!fillStyle, 'fillStyle should be null');
|
|
||||||
ol.DEBUG && console.assert(strokeStyle, 'strokeStyle should not be null');
|
|
||||||
var strokeStyleColor = strokeStyle.getColor();
|
var strokeStyleColor = strokeStyle.getColor();
|
||||||
this.state_.strokeStyle = ol.colorlike.asColorLike(strokeStyleColor ?
|
this.state_.strokeStyle = ol.colorlike.asColorLike(strokeStyleColor ?
|
||||||
strokeStyleColor : ol.render.canvas.defaultStrokeStyle);
|
strokeStyleColor : ol.render.canvas.defaultStrokeStyle);
|
||||||
|
|||||||
@@ -108,8 +108,6 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo
|
|||||||
this.instructions.push(fillInstruction);
|
this.instructions.push(fillInstruction);
|
||||||
}
|
}
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
|
||||||
'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);
|
||||||
this.hitDetectionInstructions.push(strokeInstruction);
|
this.hitDetectionInstructions.push(strokeInstruction);
|
||||||
@@ -123,16 +121,11 @@ 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_;
|
||||||
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) {
|
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
|
||||||
'state.lineWidth should be defined');
|
|
||||||
}
|
|
||||||
this.setFillStrokeStyles_(circleGeometry);
|
this.setFillStrokeStyles_(circleGeometry);
|
||||||
this.beginGeometry(circleGeometry, feature);
|
this.beginGeometry(circleGeometry, feature);
|
||||||
// always fill the circle for hit detection
|
// always fill the circle for hit detection
|
||||||
@@ -162,8 +155,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
|
||||||
'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);
|
||||||
this.hitDetectionInstructions.push(strokeInstruction);
|
this.hitDetectionInstructions.push(strokeInstruction);
|
||||||
@@ -177,14 +168,6 @@ 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_;
|
||||||
ol.DEBUG && console.assert(state, 'state should not be null');
|
|
||||||
var strokeStyle = state.strokeStyle;
|
|
||||||
ol.DEBUG && console.assert(state.fillStyle !== undefined || strokeStyle !== undefined,
|
|
||||||
'fillStyle or strokeStyle should be defined');
|
|
||||||
if (strokeStyle !== undefined) {
|
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
|
||||||
'state.lineWidth should be defined');
|
|
||||||
}
|
|
||||||
this.setFillStrokeStyles_(polygonGeometry);
|
this.setFillStrokeStyles_(polygonGeometry);
|
||||||
this.beginGeometry(polygonGeometry, feature);
|
this.beginGeometry(polygonGeometry, feature);
|
||||||
// always fill the polygon for hit detection
|
// always fill the polygon for hit detection
|
||||||
@@ -212,16 +195,11 @@ 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_;
|
||||||
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) {
|
|
||||||
ol.DEBUG && console.assert(state.lineWidth !== undefined,
|
|
||||||
'state.lineWidth should be defined');
|
|
||||||
}
|
|
||||||
this.setFillStrokeStyles_(multiPolygonGeometry);
|
this.setFillStrokeStyles_(multiPolygonGeometry);
|
||||||
this.beginGeometry(multiPolygonGeometry, feature);
|
this.beginGeometry(multiPolygonGeometry, feature);
|
||||||
// always fill the multi-polygon for hit detection
|
// always fill the multi-polygon for hit detection
|
||||||
@@ -253,7 +231,6 @@ ol.render.canvas.PolygonReplay.prototype.drawMultiPolygon = function(multiPolygo
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.PolygonReplay.prototype.finish = function() {
|
ol.render.canvas.PolygonReplay.prototype.finish = function() {
|
||||||
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
|
||||||
@@ -290,9 +267,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
|
|
||||||
ol.DEBUG && console.assert(fillStyle || strokeStyle,
|
|
||||||
'fillStyle or strokeStyle should not be null');
|
|
||||||
var state = this.state_;
|
var state = this.state_;
|
||||||
if (fillStyle) {
|
if (fillStyle) {
|
||||||
var fillStyleColor = fillStyle.getColor();
|
var fillStyleColor = fillStyle.getColor();
|
||||||
@@ -360,12 +334,6 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_ = function(geometr
|
|||||||
state.currentFillStyle = state.fillStyle;
|
state.currentFillStyle = state.fillStyle;
|
||||||
}
|
}
|
||||||
if (strokeStyle !== undefined) {
|
if (strokeStyle !== undefined) {
|
||||||
ol.DEBUG && console.assert(lineCap !== undefined, 'lineCap should be defined');
|
|
||||||
ol.DEBUG && console.assert(lineDash, 'lineDash should not be null');
|
|
||||||
ol.DEBUG && console.assert(lineJoin !== undefined, 'lineJoin should be defined');
|
|
||||||
ol.DEBUG && console.assert(lineWidth !== undefined, 'lineWidth 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) ||
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ goog.provide('ol.render.canvas.Replay');
|
|||||||
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.colorlike');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.extent.Relationship');
|
goog.require('ol.extent.Relationship');
|
||||||
goog.require('ol.geom.flat.transform');
|
goog.require('ol.geom.flat.transform');
|
||||||
@@ -237,8 +236,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(pixelCoordinates === this.pixelCoordinates_,
|
|
||||||
'pixelCoordinates should be the same as this.pixelCoordinates_');
|
|
||||||
}
|
}
|
||||||
var skipFeatures = !ol.obj.isEmpty(skippedFeaturesHash);
|
var skipFeatures = !ol.obj.isEmpty(skippedFeaturesHash);
|
||||||
var i = 0; // instruction index
|
var i = 0; // instruction index
|
||||||
@@ -287,8 +284,6 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
case ol.render.canvas.Instruction.CIRCLE:
|
case ol.render.canvas.Instruction.CIRCLE:
|
||||||
ol.DEBUG && console.assert(typeof instruction[1] === '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];
|
||||||
var y1 = pixelCoordinates[d + 1];
|
var y1 = pixelCoordinates[d + 1];
|
||||||
@@ -306,11 +301,7 @@ 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:
|
||||||
ol.DEBUG && console.assert(typeof instruction[1] === 'number',
|
|
||||||
'second instruction should be a number');
|
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[2] === '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} */
|
||||||
(instruction[3]);
|
(instruction[3]);
|
||||||
@@ -364,32 +355,14 @@ 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:
|
||||||
ol.DEBUG && console.assert(typeof instruction[1] === 'number',
|
|
||||||
'2nd instruction should be a number');
|
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[2] === 'number',
|
|
||||||
'3rd instruction should be a number');
|
|
||||||
dd = /** @type {number} */ (instruction[2]);
|
dd = /** @type {number} */ (instruction[2]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[3] === 'string',
|
|
||||||
'4th instruction should be a string');
|
|
||||||
text = /** @type {string} */ (instruction[3]);
|
text = /** @type {string} */ (instruction[3]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[4] === 'number',
|
|
||||||
'5th instruction should be a number');
|
|
||||||
var offsetX = /** @type {number} */ (instruction[4]) * pixelRatio;
|
var offsetX = /** @type {number} */ (instruction[4]) * pixelRatio;
|
||||||
ol.DEBUG && console.assert(typeof instruction[5] === 'number',
|
|
||||||
'6th instruction should be a number');
|
|
||||||
var offsetY = /** @type {number} */ (instruction[5]) * pixelRatio;
|
var offsetY = /** @type {number} */ (instruction[5]) * pixelRatio;
|
||||||
ol.DEBUG && console.assert(typeof instruction[6] === 'number',
|
|
||||||
'7th instruction should be a number');
|
|
||||||
rotation = /** @type {number} */ (instruction[6]);
|
rotation = /** @type {number} */ (instruction[6]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[7] === 'number',
|
|
||||||
'8th instruction should be a number');
|
|
||||||
scale = /** @type {number} */ (instruction[7]) * pixelRatio;
|
scale = /** @type {number} */ (instruction[7]) * pixelRatio;
|
||||||
ol.DEBUG && console.assert(typeof instruction[8] === 'boolean',
|
|
||||||
'9th instruction should be a boolean');
|
|
||||||
fill = /** @type {boolean} */ (instruction[8]);
|
fill = /** @type {boolean} */ (instruction[8]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[9] === '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]);
|
||||||
if (rotateWithView) {
|
if (rotateWithView) {
|
||||||
@@ -456,11 +429,7 @@ 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:
|
||||||
ol.DEBUG && console.assert(typeof instruction[1] === 'number',
|
|
||||||
'2nd instruction should be a number');
|
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
ol.DEBUG && console.assert(typeof instruction[2] === 'number',
|
|
||||||
'3rd instruction should be a number');
|
|
||||||
dd = /** @type {number} */ (instruction[2]);
|
dd = /** @type {number} */ (instruction[2]);
|
||||||
x = pixelCoordinates[d];
|
x = pixelCoordinates[d];
|
||||||
y = pixelCoordinates[d + 1];
|
y = pixelCoordinates[d + 1];
|
||||||
@@ -485,10 +454,6 @@ 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:
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
ol.colorlike.isColorLike(instruction[1]),
|
|
||||||
'2nd instruction should be a string, ' +
|
|
||||||
'CanvasPattern, or CanvasGradient');
|
|
||||||
this.fillOrigin_ = instruction[2];
|
this.fillOrigin_ = instruction[2];
|
||||||
|
|
||||||
if (pendingFill) {
|
if (pendingFill) {
|
||||||
@@ -500,20 +465,6 @@ 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:
|
||||||
ol.DEBUG && console.assert(ol.colorlike.isColorLike(instruction[1]),
|
|
||||||
'2nd instruction should be a string, CanvasPattern, or CanvasGradient');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[2] === 'number',
|
|
||||||
'3rd instruction should be a number');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[3] === 'string',
|
|
||||||
'4rd instruction should be a string');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[4] === 'string',
|
|
||||||
'5th instruction should be a string');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[5] === 'number',
|
|
||||||
'6th instruction should be a number');
|
|
||||||
ol.DEBUG && console.assert(instruction[6],
|
|
||||||
'7th instruction should not be null');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[8] === 'number',
|
|
||||||
'9th instruction should be a number');
|
|
||||||
var usePixelRatio = instruction[7] !== undefined ?
|
var usePixelRatio = instruction[7] !== undefined ?
|
||||||
instruction[7] : true;
|
instruction[7] : true;
|
||||||
var renderedPixelRatio = instruction[8];
|
var renderedPixelRatio = instruction[8];
|
||||||
@@ -544,12 +495,6 @@ 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:
|
||||||
ol.DEBUG && console.assert(typeof instruction[1] === 'string',
|
|
||||||
'2nd instruction should be a string');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[2] === 'string',
|
|
||||||
'3rd instruction should be a string');
|
|
||||||
ol.DEBUG && console.assert(typeof instruction[3] === '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]);
|
||||||
context.textBaseline = /** @type {string} */ (instruction[3]);
|
context.textBaseline = /** @type {string} */ (instruction[3]);
|
||||||
@@ -564,7 +509,6 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -575,9 +519,6 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
if (pendingStroke) {
|
if (pendingStroke) {
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
// assert that all instructions were consumed
|
|
||||||
ol.DEBUG && console.assert(i == instructions.length,
|
|
||||||
'all instructions should be consumed');
|
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -637,12 +578,9 @@ 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) {
|
||||||
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;
|
||||||
ol.DEBUG && console.assert(begin >= 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;
|
||||||
}
|
}
|
||||||
@@ -655,12 +593,8 @@ 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) {
|
||||||
ol.DEBUG && console.assert(this.beginGeometryInstruction1_,
|
|
||||||
'this.beginGeometryInstruction1_ should not be null');
|
|
||||||
this.beginGeometryInstruction1_[2] = this.instructions.length;
|
this.beginGeometryInstruction1_[2] = this.instructions.length;
|
||||||
this.beginGeometryInstruction1_ = null;
|
this.beginGeometryInstruction1_ = null;
|
||||||
ol.DEBUG && console.assert(this.beginGeometryInstruction2_,
|
|
||||||
'this.beginGeometryInstruction2_ should not be null');
|
|
||||||
this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;
|
this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;
|
||||||
this.beginGeometryInstruction2_ = null;
|
this.beginGeometryInstruction2_ = null;
|
||||||
var endGeometryInstruction =
|
var endGeometryInstruction =
|
||||||
|
|||||||
@@ -276,9 +276,6 @@ 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.ReplayGroup.BATCH_CONSTRUCTORS_[replayType];
|
var Constructor = ol.render.canvas.ReplayGroup.BATCH_CONSTRUCTORS_[replayType];
|
||||||
ol.DEBUG && console.assert(Constructor !== undefined,
|
|
||||||
replayType +
|
|
||||||
' constructor missing from ol.render.canvas.ReplayGroup.BATCH_CONSTRUCTORS_');
|
|
||||||
replay = new Constructor(this.tolerance_, this.maxExtent_,
|
replay = new Constructor(this.tolerance_, this.maxExtent_,
|
||||||
this.resolution_, this.overlaps_);
|
this.resolution_, this.overlaps_);
|
||||||
replays[replayType] = replay;
|
replays[replayType] = replay;
|
||||||
|
|||||||
@@ -18,20 +18,12 @@ goog.require('ol.geom.GeometryType');
|
|||||||
* @param {Object.<string, *>} properties Properties.
|
* @param {Object.<string, *>} properties Properties.
|
||||||
*/
|
*/
|
||||||
ol.render.Feature = function(type, flatCoordinates, ends, properties) {
|
ol.render.Feature = function(type, flatCoordinates, ends, properties) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.Extent|undefined}
|
* @type {ol.Extent|undefined}
|
||||||
*/
|
*/
|
||||||
this.extent_;
|
this.extent_;
|
||||||
|
|
||||||
ol.DEBUG && console.assert(type === ol.geom.GeometryType.POINT ||
|
|
||||||
type === ol.geom.GeometryType.MULTI_POINT ||
|
|
||||||
type === ol.geom.GeometryType.LINE_STRING ||
|
|
||||||
type === ol.geom.GeometryType.MULTI_LINE_STRING ||
|
|
||||||
type === ol.geom.GeometryType.POLYGON,
|
|
||||||
'Need a Point, MultiPoint, LineString, MultiLineString or Polygon type');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.geom.GeometryType}
|
* @type {ol.geom.GeometryType}
|
||||||
@@ -55,7 +47,6 @@ ol.render.Feature = function(type, flatCoordinates, ends, properties) {
|
|||||||
* @type {Object.<string, *>}
|
* @type {Object.<string, *>}
|
||||||
*/
|
*/
|
||||||
this.properties_ = properties;
|
this.properties_ = properties;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -178,10 +178,6 @@ ol.render.webgl.CircleReplay.prototype.getDeleteResourcesFunction = function(con
|
|||||||
// be used by other CircleReplay instances (for other layers). And
|
// be used by other CircleReplay 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.
|
||||||
ol.DEBUG && console.assert(this.verticesBuffer,
|
|
||||||
'verticesBuffer must not be null');
|
|
||||||
ol.DEBUG && console.assert(this.indicesBuffer,
|
|
||||||
'indicesBuffer must not be null');
|
|
||||||
var verticesBuffer = this.verticesBuffer;
|
var verticesBuffer = this.verticesBuffer;
|
||||||
var indicesBuffer = this.indicesBuffer;
|
var indicesBuffer = this.indicesBuffer;
|
||||||
return function() {
|
return function() {
|
||||||
@@ -251,9 +247,6 @@ ol.render.webgl.CircleReplay.prototype.drawReplay = function(gl, context, skippe
|
|||||||
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
||||||
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
||||||
} else {
|
} else {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
|
|
||||||
//Draw by style groups to minimize drawElements() calls.
|
//Draw by style groups to minimize drawElements() calls.
|
||||||
var i, start, end, nextStyle;
|
var i, start, end, nextStyle;
|
||||||
end = this.startIndices[this.startIndices.length - 1];
|
end = this.startIndices[this.startIndices.length - 1];
|
||||||
@@ -275,11 +268,6 @@ ol.render.webgl.CircleReplay.prototype.drawReplay = function(gl, context, skippe
|
|||||||
*/
|
*/
|
||||||
ol.render.webgl.CircleReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
ol.render.webgl.CircleReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
||||||
featureCallback, opt_hitExtent) {
|
featureCallback, opt_hitExtent) {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = this.startIndices[featureIndex + 1];
|
end = this.startIndices[featureIndex + 1];
|
||||||
@@ -326,9 +314,6 @@ ol.render.webgl.CircleReplay.prototype.drawHitDetectionReplayOneByOne = function
|
|||||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.CircleReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
ol.render.webgl.CircleReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = start = this.startIndices[featureIndex + 1];
|
end = start = this.startIndices[featureIndex + 1];
|
||||||
@@ -388,7 +373,6 @@ ol.render.webgl.CircleReplay.prototype.setStrokeStyle_ = function(gl, color, lin
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.CircleReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
ol.render.webgl.CircleReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||||
ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
|
|
||||||
var strokeStyleColor, strokeStyleWidth;
|
var strokeStyleColor, strokeStyleWidth;
|
||||||
if (strokeStyle) {
|
if (strokeStyle) {
|
||||||
var strokeStyleLineDash = strokeStyle.getLineDash();
|
var strokeStyleLineDash = strokeStyle.getLineDash();
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE = 'precisio
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.circlereplay.defaultshader.Fragment.SOURCE = ol.DEBUG ?
|
ol.render.webgl.circlereplay.defaultshader.Fragment.SOURCE = ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.circlereplay.defaultshader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.circlereplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.circlereplay.defaultshader.fragment = new ol.render.webgl.circlereplay.defaultshader.Fragment();
|
ol.render.webgl.circlereplay.defaultshader.fragment = new ol.render.webgl.circlereplay.defaultshader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE = 'varying ve
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.circlereplay.defaultshader.Vertex.SOURCE = ol.DEBUG ?
|
ol.render.webgl.circlereplay.defaultshader.Vertex.SOURCE = ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.circlereplay.defaultshader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.circlereplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.circlereplay.defaultshader.vertex = new ol.render.webgl.circlereplay.defaultshader.Vertex();
|
ol.render.webgl.circlereplay.defaultshader.vertex = new ol.render.webgl.circlereplay.defaultshader.Vertex();
|
||||||
@@ -91,72 +87,60 @@ ol.render.webgl.circlereplay.defaultshader.Locations = function(gl, program) {
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_fillColor = gl.getUniformLocation(
|
this.u_fillColor = gl.getUniformLocation(program, 'n');
|
||||||
program, ol.DEBUG ? 'u_fillColor' : 'n');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_lineWidth = gl.getUniformLocation(
|
this.u_lineWidth = gl.getUniformLocation(program, 'k');
|
||||||
program, ol.DEBUG ? 'u_lineWidth' : 'k');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetRotateMatrix = gl.getUniformLocation(
|
this.u_offsetRotateMatrix = gl.getUniformLocation(program, 'j');
|
||||||
program, ol.DEBUG ? 'u_offsetRotateMatrix' : 'j');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetScaleMatrix = gl.getUniformLocation(
|
this.u_offsetScaleMatrix = gl.getUniformLocation(program, 'i');
|
||||||
program, ol.DEBUG ? 'u_offsetScaleMatrix' : 'i');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_opacity = gl.getUniformLocation(
|
this.u_opacity = gl.getUniformLocation(program, 'm');
|
||||||
program, ol.DEBUG ? 'u_opacity' : 'm');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_pixelRatio = gl.getUniformLocation(
|
this.u_pixelRatio = gl.getUniformLocation(program, 'l');
|
||||||
program, ol.DEBUG ? 'u_pixelRatio' : 'l');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_projectionMatrix = gl.getUniformLocation(
|
this.u_projectionMatrix = gl.getUniformLocation(program, 'h');
|
||||||
program, ol.DEBUG ? 'u_projectionMatrix' : 'h');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_size = gl.getUniformLocation(
|
this.u_size = gl.getUniformLocation(program, 'p');
|
||||||
program, ol.DEBUG ? 'u_size' : 'p');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_strokeColor = gl.getUniformLocation(
|
this.u_strokeColor = gl.getUniformLocation(program, 'o');
|
||||||
program, ol.DEBUG ? 'u_strokeColor' : 'o');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_instruction = gl.getAttribLocation(
|
this.a_instruction = gl.getAttribLocation(program, 'f');
|
||||||
program, ol.DEBUG ? 'a_instruction' : 'f');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'a_position' : 'e');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_radius = gl.getAttribLocation(
|
this.a_radius = gl.getAttribLocation(program, 'g');
|
||||||
program, ol.DEBUG ? 'a_radius' : 'g');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -142,14 +142,6 @@ ol.inherits(ol.render.webgl.ImageReplay, ol.render.webgl.Replay);
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = function(context) {
|
ol.render.webgl.ImageReplay.prototype.getDeleteResourcesFunction = function(context) {
|
||||||
// We only delete our stuff here. The shaders and the program may
|
|
||||||
// be used by other ImageReplay instances (for other layers). And
|
|
||||||
// they will be deleted when disposing of the ol.webgl.Context
|
|
||||||
// object.
|
|
||||||
ol.DEBUG && console.assert(this.verticesBuffer,
|
|
||||||
'verticesBuffer must not be null');
|
|
||||||
ol.DEBUG && console.assert(this.indicesBuffer,
|
|
||||||
'indicesBuffer must not be null');
|
|
||||||
var verticesBuffer = this.verticesBuffer;
|
var verticesBuffer = this.verticesBuffer;
|
||||||
var indicesBuffer = this.indicesBuffer;
|
var indicesBuffer = this.indicesBuffer;
|
||||||
var textures = this.textures_;
|
var textures = this.textures_;
|
||||||
@@ -180,20 +172,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(this.anchorX_ !== undefined, 'anchorX is defined');
|
|
||||||
ol.DEBUG && console.assert(this.anchorY_ !== undefined, 'anchorY is defined');
|
|
||||||
ol.DEBUG && console.assert(this.height_ !== undefined, 'height is defined');
|
|
||||||
ol.DEBUG && console.assert(this.imageHeight_ !== undefined,
|
|
||||||
'imageHeight is defined');
|
|
||||||
ol.DEBUG && console.assert(this.imageWidth_ !== undefined, 'imageWidth is defined');
|
|
||||||
ol.DEBUG && console.assert(this.opacity_ !== undefined, 'opacity is defined');
|
|
||||||
ol.DEBUG && console.assert(this.originX_ !== undefined, 'originX is defined');
|
|
||||||
ol.DEBUG && console.assert(this.originY_ !== undefined, 'originY is defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotateWithView_ !== undefined,
|
|
||||||
'rotateWithView is defined');
|
|
||||||
ol.DEBUG && console.assert(this.rotation_ !== undefined, 'rotation is defined');
|
|
||||||
ol.DEBUG && console.assert(this.scale_ !== undefined, 'scale 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_);
|
||||||
@@ -321,21 +299,12 @@ 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);
|
||||||
ol.DEBUG && console.assert(this.images_.length === this.groupIndices_.length,
|
|
||||||
'number of images and groupIndices match');
|
|
||||||
this.hitDetectionGroupIndices_.push(this.indices.length);
|
this.hitDetectionGroupIndices_.push(this.indices.length);
|
||||||
ol.DEBUG && console.assert(this.hitDetectionImages_.length ===
|
|
||||||
this.hitDetectionGroupIndices_.length,
|
|
||||||
'number of hitDetectionImages and hitDetectionGroupIndices match');
|
|
||||||
|
|
||||||
// create, bind, and populate the vertices buffer
|
// create, bind, and populate the vertices buffer
|
||||||
this.verticesBuffer = new ol.webgl.Buffer(this.vertices);
|
this.verticesBuffer = new ol.webgl.Buffer(this.vertices);
|
||||||
|
|
||||||
var indices = this.indices;
|
var indices = this.indices;
|
||||||
var bits = context.hasOESElementIndexUint ? 32 : 16;
|
|
||||||
ol.DEBUG && console.assert(indices[indices.length - 1] < Math.pow(2, bits),
|
|
||||||
'Too large element index detected [%s] (OES_element_index_uint "%s")',
|
|
||||||
indices[indices.length - 1], context.hasOESElementIndexUint);
|
|
||||||
|
|
||||||
// create, bind, and populate the indices buffer
|
// create, bind, and populate the indices buffer
|
||||||
this.indicesBuffer = new ol.webgl.Buffer(indices);
|
this.indicesBuffer = new ol.webgl.Buffer(indices);
|
||||||
@@ -345,14 +314,9 @@ 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);
|
||||||
ol.DEBUG && console.assert(this.textures_.length === this.groupIndices_.length,
|
|
||||||
'number of textures and groupIndices match');
|
|
||||||
|
|
||||||
this.createTextures_(this.hitDetectionTextures_, this.hitDetectionImages_,
|
this.createTextures_(this.hitDetectionTextures_, this.hitDetectionImages_,
|
||||||
texturePerImage, gl);
|
texturePerImage, gl);
|
||||||
ol.DEBUG && console.assert(this.hitDetectionTextures_.length ===
|
|
||||||
this.hitDetectionGroupIndices_.length,
|
|
||||||
'number of hitDetectionTextures and hitDetectionGroupIndices match');
|
|
||||||
|
|
||||||
this.anchorX_ = undefined;
|
this.anchorX_ = undefined;
|
||||||
this.anchorY_ = undefined;
|
this.anchorY_ = undefined;
|
||||||
@@ -382,9 +346,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(textures.length === 0,
|
|
||||||
'upon creation, textures is empty');
|
|
||||||
|
|
||||||
var texture, image, uid, i;
|
var texture, image, uid, i;
|
||||||
var ii = images.length;
|
var ii = images.length;
|
||||||
for (i = 0; i < ii; ++i) {
|
for (i = 0; i < ii; ++i) {
|
||||||
@@ -468,8 +429,6 @@ ol.render.webgl.ImageReplay.prototype.shutDownProgram = function(gl, locations)
|
|||||||
ol.render.webgl.ImageReplay.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hitDetection) {
|
ol.render.webgl.ImageReplay.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hitDetection) {
|
||||||
var textures = hitDetection ? this.hitDetectionTextures_ : this.textures_;
|
var textures = hitDetection ? this.hitDetectionTextures_ : this.textures_;
|
||||||
var groupIndices = hitDetection ? this.hitDetectionGroupIndices_ : this.groupIndices_;
|
var groupIndices = hitDetection ? this.hitDetectionGroupIndices_ : this.groupIndices_;
|
||||||
ol.DEBUG && console.assert(textures.length === groupIndices.length,
|
|
||||||
'number of textures and groupIndeces match');
|
|
||||||
|
|
||||||
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
||||||
this.drawReplaySkipping_(
|
this.drawReplaySkipping_(
|
||||||
@@ -561,10 +520,6 @@ ol.render.webgl.ImageReplay.prototype.drawReplaySkipping_ = function(gl, context
|
|||||||
*/
|
*/
|
||||||
ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
||||||
featureCallback, opt_hitExtent) {
|
featureCallback, opt_hitExtent) {
|
||||||
ol.DEBUG && console.assert(this.hitDetectionTextures_.length ===
|
|
||||||
this.hitDetectionGroupIndices_.length,
|
|
||||||
'number of hitDetectionTextures and hitDetectionGroupIndices match');
|
|
||||||
|
|
||||||
var i, groupStart, start, end, feature, featureUid;
|
var i, groupStart, start, end, feature, featureUid;
|
||||||
var featureIndex = this.startIndices.length - 1;
|
var featureIndex = this.startIndices.length - 1;
|
||||||
for (i = this.hitDetectionTextures_.length - 1; i >= 0; --i) {
|
for (i = this.hitDetectionTextures_.length - 1; i >= 0; --i) {
|
||||||
@@ -609,28 +564,12 @@ ol.render.webgl.ImageReplay.prototype.setImageStyle = function(imageStyle) {
|
|||||||
var image = imageStyle.getImage(1);
|
var image = imageStyle.getImage(1);
|
||||||
var imageSize = imageStyle.getImageSize();
|
var imageSize = imageStyle.getImageSize();
|
||||||
var hitDetectionImage = imageStyle.getHitDetectionImage(1);
|
var hitDetectionImage = imageStyle.getHitDetectionImage(1);
|
||||||
var hitDetectionImageSize = imageStyle.getHitDetectionImageSize();
|
|
||||||
var opacity = imageStyle.getOpacity();
|
var opacity = imageStyle.getOpacity();
|
||||||
var origin = imageStyle.getOrigin();
|
var origin = imageStyle.getOrigin();
|
||||||
var rotateWithView = imageStyle.getRotateWithView();
|
var rotateWithView = imageStyle.getRotateWithView();
|
||||||
var rotation = imageStyle.getRotation();
|
var rotation = imageStyle.getRotation();
|
||||||
var size = imageStyle.getSize();
|
var size = imageStyle.getSize();
|
||||||
var scale = imageStyle.getScale();
|
var scale = imageStyle.getScale();
|
||||||
ol.DEBUG && console.assert(anchor, 'imageStyle anchor is not null');
|
|
||||||
ol.DEBUG && console.assert(image, 'imageStyle image is not null');
|
|
||||||
ol.DEBUG && console.assert(imageSize,
|
|
||||||
'imageStyle imageSize is not null');
|
|
||||||
ol.DEBUG && console.assert(hitDetectionImage,
|
|
||||||
'imageStyle hitDetectionImage is not null');
|
|
||||||
ol.DEBUG && console.assert(hitDetectionImageSize,
|
|
||||||
'imageStyle hitDetectionImageSize is not null');
|
|
||||||
ol.DEBUG && console.assert(opacity !== undefined, 'imageStyle opacity is defined');
|
|
||||||
ol.DEBUG && console.assert(origin, 'imageStyle origin is not null');
|
|
||||||
ol.DEBUG && console.assert(rotateWithView !== undefined,
|
|
||||||
'imageStyle rotateWithView is defined');
|
|
||||||
ol.DEBUG && console.assert(rotation !== undefined, 'imageStyle rotation is defined');
|
|
||||||
ol.DEBUG && console.assert(size, 'imageStyle size is not null');
|
|
||||||
ol.DEBUG && console.assert(scale !== undefined, 'imageStyle scale is defined');
|
|
||||||
|
|
||||||
var currentImage;
|
var currentImage;
|
||||||
if (this.images_.length === 0) {
|
if (this.images_.length === 0) {
|
||||||
@@ -639,8 +578,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(this.groupIndices_.length === this.images_.length,
|
|
||||||
'number of groupIndices and images match');
|
|
||||||
this.images_.push(image);
|
this.images_.push(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -652,9 +589,6 @@ 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);
|
||||||
ol.DEBUG && console.assert(this.hitDetectionGroupIndices_.length ===
|
|
||||||
this.hitDetectionImages_.length,
|
|
||||||
'number of hitDetectionGroupIndices and hitDetectionImages match');
|
|
||||||
this.hitDetectionImages_.push(hitDetectionImage);
|
this.hitDetectionImages_.push(hitDetectionImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE = 'precision
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.DEBUG ?
|
ol.render.webgl.imagereplay.defaultshader.Fragment.SOURCE = ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.imagereplay.defaultshader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.imagereplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.imagereplay.defaultshader.fragment = new ol.render.webgl.imagereplay.defaultshader.Fragment();
|
ol.render.webgl.imagereplay.defaultshader.fragment = new ol.render.webgl.imagereplay.defaultshader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE = 'varying vec
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.DEBUG ?
|
ol.render.webgl.imagereplay.defaultshader.Vertex.SOURCE = ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.imagereplay.defaultshader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.imagereplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.imagereplay.defaultshader.vertex = new ol.render.webgl.imagereplay.defaultshader.Vertex();
|
ol.render.webgl.imagereplay.defaultshader.vertex = new ol.render.webgl.imagereplay.defaultshader.Vertex();
|
||||||
@@ -91,60 +87,50 @@ ol.render.webgl.imagereplay.defaultshader.Locations = function(gl, program) {
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_image = gl.getUniformLocation(
|
this.u_image = gl.getUniformLocation(program, 'l');
|
||||||
program, ol.DEBUG ? 'u_image' : 'l');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetRotateMatrix = gl.getUniformLocation(
|
this.u_offsetRotateMatrix = gl.getUniformLocation(program, 'j');
|
||||||
program, ol.DEBUG ? 'u_offsetRotateMatrix' : 'j');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetScaleMatrix = gl.getUniformLocation(
|
this.u_offsetScaleMatrix = gl.getUniformLocation(program, 'i');
|
||||||
program, ol.DEBUG ? 'u_offsetScaleMatrix' : 'i');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_opacity = gl.getUniformLocation(
|
this.u_opacity = gl.getUniformLocation(program, 'k');
|
||||||
program, ol.DEBUG ? 'u_opacity' : 'k');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_projectionMatrix = gl.getUniformLocation(
|
this.u_projectionMatrix = gl.getUniformLocation(program, 'h');
|
||||||
program, ol.DEBUG ? 'u_projectionMatrix' : 'h');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_offsets = gl.getAttribLocation(
|
this.a_offsets = gl.getAttribLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'a_offsets' : 'e');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_opacity = gl.getAttribLocation(
|
this.a_opacity = gl.getAttribLocation(program, 'f');
|
||||||
program, ol.DEBUG ? 'a_opacity' : 'f');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'c');
|
||||||
program, ol.DEBUG ? 'a_position' : 'c');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_rotateWithView = gl.getAttribLocation(
|
this.a_rotateWithView = gl.getAttribLocation(program, 'g');
|
||||||
program, ol.DEBUG ? 'a_rotateWithView' : 'g');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_texCoord = gl.getAttribLocation(
|
this.a_texCoord = gl.getAttribLocation(program, 'd');
|
||||||
program, ol.DEBUG ? 'a_texCoord' : 'd');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ ol.render.webgl.Immediate.prototype.drawGeometry = function(geometry) {
|
|||||||
this.drawCircle(/** @type {ol.geom.Circle} */ (geometry), null);
|
this.drawCircle(/** @type {ol.geom.Circle} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ol.DEBUG && console.assert(false, 'Unsupported geometry type: ' + type);
|
// pass
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -145,7 +145,6 @@ ol.render.webgl.Immediate.prototype.drawFeature = function(feature, style) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setStyle(style);
|
this.setStyle(style);
|
||||||
ol.DEBUG && console.assert(geometry, 'geometry must be truthy');
|
|
||||||
this.drawGeometry(geometry);
|
this.drawGeometry(geometry);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -149,8 +149,6 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
|||||||
p2 = startCoords;
|
p2 = startCoords;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//For the compiler not to complain. This will never be [0, 0].
|
|
||||||
ol.DEBUG && console.assert(p0, 'p0 should be defined');
|
|
||||||
p0 = p0 || [0, 0];
|
p0 = p0 || [0, 0];
|
||||||
|
|
||||||
numVertices = this.addVertices_(p0, p1, [0, 0],
|
numVertices = this.addVertices_(p0, p1, [0, 0],
|
||||||
@@ -232,9 +230,6 @@ ol.render.webgl.LineStringReplay.prototype.drawCoordinates_ = function(flatCoord
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (closed) {
|
if (closed) {
|
||||||
//Link the last triangle/rhombus to the first one.
|
|
||||||
//n will never be numVertices / 7 here. However, the compiler complains otherwise.
|
|
||||||
ol.DEBUG && console.assert(n, 'n should be defined');
|
|
||||||
n = n || numVertices / 7;
|
n = n || numVertices / 7;
|
||||||
sign = ol.geom.flat.orient.linearRingIsClockwise([p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]], 0, 6, 2)
|
sign = ol.geom.flat.orient.linearRingIsClockwise([p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]], 0, 6, 2)
|
||||||
? 1 : -1;
|
? 1 : -1;
|
||||||
@@ -425,11 +420,6 @@ ol.render.webgl.LineStringReplay.prototype.finish = function(context) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.LineStringReplay.prototype.getDeleteResourcesFunction = function(context) {
|
ol.render.webgl.LineStringReplay.prototype.getDeleteResourcesFunction = function(context) {
|
||||||
// We only delete our stuff here. The shaders and the program may
|
|
||||||
// be used by other LineStringReplay instances (for other layers). And
|
|
||||||
// they will be deleted when disposing of the ol.webgl.Context
|
|
||||||
// object.
|
|
||||||
ol.DEBUG && console.assert(this.verticesBuffer, 'verticesBuffer must not be null');
|
|
||||||
var verticesBuffer = this.verticesBuffer;
|
var verticesBuffer = this.verticesBuffer;
|
||||||
var indicesBuffer = this.indicesBuffer;
|
var indicesBuffer = this.indicesBuffer;
|
||||||
return function() {
|
return function() {
|
||||||
@@ -514,9 +504,6 @@ ol.render.webgl.LineStringReplay.prototype.drawReplay = function(gl, context, sk
|
|||||||
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
||||||
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
||||||
} else {
|
} else {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
|
|
||||||
//Draw by style groups to minimize drawElements() calls.
|
//Draw by style groups to minimize drawElements() calls.
|
||||||
var i, start, end, nextStyle;
|
var i, start, end, nextStyle;
|
||||||
end = this.startIndices[this.startIndices.length - 1];
|
end = this.startIndices[this.startIndices.length - 1];
|
||||||
@@ -546,9 +533,6 @@ ol.render.webgl.LineStringReplay.prototype.drawReplay = function(gl, context, sk
|
|||||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.LineStringReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
ol.render.webgl.LineStringReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = start = this.startIndices[featureIndex + 1];
|
end = start = this.startIndices[featureIndex + 1];
|
||||||
@@ -587,11 +571,6 @@ ol.render.webgl.LineStringReplay.prototype.drawReplaySkipping_ = function(gl, co
|
|||||||
*/
|
*/
|
||||||
ol.render.webgl.LineStringReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
ol.render.webgl.LineStringReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
||||||
featureCallback, opt_hitExtent) {
|
featureCallback, opt_hitExtent) {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = this.startIndices[featureIndex + 1];
|
end = this.startIndices[featureIndex + 1];
|
||||||
@@ -647,7 +626,6 @@ ol.render.webgl.LineStringReplay.prototype.setStrokeStyle_ = function(gl, color,
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
ol.render.webgl.LineStringReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||||
ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
|
|
||||||
var strokeStyleLineCap = strokeStyle.getLineCap();
|
var strokeStyleLineCap = strokeStyle.getLineCap();
|
||||||
this.state_.lineCap = strokeStyleLineCap !== undefined ?
|
this.state_.lineCap = strokeStyleLineCap !== undefined ?
|
||||||
strokeStyleLineCap : ol.render.webgl.defaultLineCap;
|
strokeStyleLineCap : ol.render.webgl.defaultLineCap;
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE = 'prec
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Fragment.SOURCE = ol.DEBUG ?
|
ol.render.webgl.linestringreplay.defaultshader.Fragment.SOURCE = ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.linestringreplay.defaultshader.fragment = new ol.render.webgl.linestringreplay.defaultshader.Fragment();
|
ol.render.webgl.linestringreplay.defaultshader.fragment = new ol.render.webgl.linestringreplay.defaultshader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE = 'varyin
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Vertex.SOURCE = ol.DEBUG ?
|
ol.render.webgl.linestringreplay.defaultshader.Vertex.SOURCE = ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.linestringreplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.linestringreplay.defaultshader.vertex = new ol.render.webgl.linestringreplay.defaultshader.Vertex();
|
ol.render.webgl.linestringreplay.defaultshader.vertex = new ol.render.webgl.linestringreplay.defaultshader.Vertex();
|
||||||
@@ -91,78 +87,65 @@ ol.render.webgl.linestringreplay.defaultshader.Locations = function(gl, program)
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_color = gl.getUniformLocation(
|
this.u_color = gl.getUniformLocation(program, 'n');
|
||||||
program, ol.DEBUG ? 'u_color' : 'n');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_lineWidth = gl.getUniformLocation(
|
this.u_lineWidth = gl.getUniformLocation(program, 'k');
|
||||||
program, ol.DEBUG ? 'u_lineWidth' : 'k');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_miterLimit = gl.getUniformLocation(
|
this.u_miterLimit = gl.getUniformLocation(program, 'l');
|
||||||
program, ol.DEBUG ? 'u_miterLimit' : 'l');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetRotateMatrix = gl.getUniformLocation(
|
this.u_offsetRotateMatrix = gl.getUniformLocation(program, 'j');
|
||||||
program, ol.DEBUG ? 'u_offsetRotateMatrix' : 'j');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetScaleMatrix = gl.getUniformLocation(
|
this.u_offsetScaleMatrix = gl.getUniformLocation(program, 'i');
|
||||||
program, ol.DEBUG ? 'u_offsetScaleMatrix' : 'i');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_opacity = gl.getUniformLocation(
|
this.u_opacity = gl.getUniformLocation(program, 'm');
|
||||||
program, ol.DEBUG ? 'u_opacity' : 'm');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_pixelRatio = gl.getUniformLocation(
|
this.u_pixelRatio = gl.getUniformLocation(program, 'p');
|
||||||
program, ol.DEBUG ? 'u_pixelRatio' : 'p');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_projectionMatrix = gl.getUniformLocation(
|
this.u_projectionMatrix = gl.getUniformLocation(program, 'h');
|
||||||
program, ol.DEBUG ? 'u_projectionMatrix' : 'h');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_size = gl.getUniformLocation(
|
this.u_size = gl.getUniformLocation(program, 'o');
|
||||||
program, ol.DEBUG ? 'u_size' : 'o');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_direction = gl.getAttribLocation(
|
this.a_direction = gl.getAttribLocation(program, 'g');
|
||||||
program, ol.DEBUG ? 'a_direction' : 'g');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_lastPos = gl.getAttribLocation(
|
this.a_lastPos = gl.getAttribLocation(program, 'd');
|
||||||
program, ol.DEBUG ? 'a_lastPos' : 'd');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_nextPos = gl.getAttribLocation(
|
this.a_nextPos = gl.getAttribLocation(program, 'f');
|
||||||
program, ol.DEBUG ? 'a_nextPos' : 'f');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'a_position' : 'e');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -296,8 +296,6 @@ ol.render.webgl.PolygonReplay.prototype.triangulate_ = function(list, rtree) {
|
|||||||
// Due to the behavior of OL's PIP algorithm, the ear clipping cannot
|
// Due to the behavior of OL's PIP algorithm, the ear clipping cannot
|
||||||
// introduce touching segments. However, the original data may have some.
|
// introduce touching segments. However, the original data may have some.
|
||||||
if (!this.resolveLocalSelfIntersections_(list, rtree, true)) {
|
if (!this.resolveLocalSelfIntersections_(list, rtree, true)) {
|
||||||
// Something went wrong.
|
|
||||||
ol.DEBUG && console.assert(false, 'Unexpected simple polygon geometry');
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -809,14 +807,6 @@ ol.render.webgl.PolygonReplay.prototype.finish = function(context) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.PolygonReplay.prototype.getDeleteResourcesFunction = function(context) {
|
ol.render.webgl.PolygonReplay.prototype.getDeleteResourcesFunction = function(context) {
|
||||||
// We only delete our stuff here. The shaders and the program may
|
|
||||||
// be used by other PolygonReplay instances (for other layers). And
|
|
||||||
// they will be deleted when disposing of the ol.webgl.Context
|
|
||||||
// object.
|
|
||||||
ol.DEBUG && console.assert(this.verticesBuffer,
|
|
||||||
'verticesBuffer must not be null');
|
|
||||||
ol.DEBUG && console.assert(this.indicesBuffer,
|
|
||||||
'indicesBuffer must not be null');
|
|
||||||
var verticesBuffer = this.verticesBuffer;
|
var verticesBuffer = this.verticesBuffer;
|
||||||
var indicesBuffer = this.indicesBuffer;
|
var indicesBuffer = this.indicesBuffer;
|
||||||
var lineDeleter = this.lineStringReplay.getDeleteResourcesFunction(context);
|
var lineDeleter = this.lineStringReplay.getDeleteResourcesFunction(context);
|
||||||
@@ -884,9 +874,6 @@ ol.render.webgl.PolygonReplay.prototype.drawReplay = function(gl, context, skipp
|
|||||||
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
if (!ol.obj.isEmpty(skippedFeaturesHash)) {
|
||||||
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
this.drawReplaySkipping_(gl, context, skippedFeaturesHash);
|
||||||
} else {
|
} else {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
|
|
||||||
//Draw by style groups to minimize drawElements() calls.
|
//Draw by style groups to minimize drawElements() calls.
|
||||||
var i, start, end, nextStyle;
|
var i, start, end, nextStyle;
|
||||||
end = this.startIndices[this.startIndices.length - 1];
|
end = this.startIndices[this.startIndices.length - 1];
|
||||||
@@ -913,11 +900,6 @@ ol.render.webgl.PolygonReplay.prototype.drawReplay = function(gl, context, skipp
|
|||||||
*/
|
*/
|
||||||
ol.render.webgl.PolygonReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
ol.render.webgl.PolygonReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, skippedFeaturesHash,
|
||||||
featureCallback, opt_hitExtent) {
|
featureCallback, opt_hitExtent) {
|
||||||
ol.DEBUG && console.assert(this.styles_.length === this.styleIndices_.length,
|
|
||||||
'number of styles and styleIndices match');
|
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = this.startIndices[featureIndex + 1];
|
end = this.startIndices[featureIndex + 1];
|
||||||
@@ -962,9 +944,6 @@ ol.render.webgl.PolygonReplay.prototype.drawHitDetectionReplayOneByOne = functio
|
|||||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.PolygonReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
ol.render.webgl.PolygonReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {
|
||||||
ol.DEBUG && console.assert(this.startIndices.length - 1 === this.startIndicesFeature.length,
|
|
||||||
'number of startIndices and startIndicesFeature match');
|
|
||||||
|
|
||||||
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
var i, start, end, nextStyle, groupStart, feature, featureUid, featureIndex, featureStart;
|
||||||
featureIndex = this.startIndices.length - 2;
|
featureIndex = this.startIndices.length - 2;
|
||||||
end = start = this.startIndices[featureIndex + 1];
|
end = start = this.startIndices[featureIndex + 1];
|
||||||
@@ -1012,7 +991,6 @@ ol.render.webgl.PolygonReplay.prototype.setFillStyle_ = function(gl, color) {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
ol.render.webgl.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||||
ol.DEBUG && console.assert(this.state_, 'this.state_ should not be null');
|
|
||||||
var fillStyleColor = fillStyle ? fillStyle.getColor() : [0, 0, 0, 0];
|
var fillStyleColor = fillStyle ? fillStyle.getColor() : [0, 0, 0, 0];
|
||||||
if (!(fillStyleColor instanceof CanvasGradient) &&
|
if (!(fillStyleColor instanceof CanvasGradient) &&
|
||||||
!(fillStyleColor instanceof CanvasPattern)) {
|
!(fillStyleColor instanceof CanvasPattern)) {
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE = 'precisi
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Fragment.SOURCE = ol.DEBUG ?
|
ol.render.webgl.polygonreplay.defaultshader.Fragment.SOURCE = ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.polygonreplay.defaultshader.fragment = new ol.render.webgl.polygonreplay.defaultshader.Fragment();
|
ol.render.webgl.polygonreplay.defaultshader.fragment = new ol.render.webgl.polygonreplay.defaultshader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE = 'attribute
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Vertex.SOURCE = ol.DEBUG ?
|
ol.render.webgl.polygonreplay.defaultshader.Vertex.SOURCE = ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.render.webgl.polygonreplay.defaultshader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.render.webgl.polygonreplay.defaultshader.vertex = new ol.render.webgl.polygonreplay.defaultshader.Vertex();
|
ol.render.webgl.polygonreplay.defaultshader.vertex = new ol.render.webgl.polygonreplay.defaultshader.Vertex();
|
||||||
@@ -91,36 +87,30 @@ ol.render.webgl.polygonreplay.defaultshader.Locations = function(gl, program) {
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_color = gl.getUniformLocation(
|
this.u_color = gl.getUniformLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'u_color' : 'e');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetRotateMatrix = gl.getUniformLocation(
|
this.u_offsetRotateMatrix = gl.getUniformLocation(program, 'd');
|
||||||
program, ol.DEBUG ? 'u_offsetRotateMatrix' : 'd');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_offsetScaleMatrix = gl.getUniformLocation(
|
this.u_offsetScaleMatrix = gl.getUniformLocation(program, 'c');
|
||||||
program, ol.DEBUG ? 'u_offsetScaleMatrix' : 'c');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_opacity = gl.getUniformLocation(
|
this.u_opacity = gl.getUniformLocation(program, 'f');
|
||||||
program, ol.DEBUG ? 'u_opacity' : 'f');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_projectionMatrix = gl.getUniformLocation(
|
this.u_projectionMatrix = gl.getUniformLocation(program, 'b');
|
||||||
program, ol.DEBUG ? 'u_projectionMatrix' : 'b');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'a');
|
||||||
program, ol.DEBUG ? 'a_position' : 'a');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -284,14 +284,8 @@ ol.render.webgl.Replay.prototype.replay = function(context,
|
|||||||
gl.stencilFunc(gl.NOTEQUAL, 1, 255);
|
gl.stencilFunc(gl.NOTEQUAL, 1, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bind the vertices buffer
|
|
||||||
ol.DEBUG && console.assert(this.verticesBuffer,
|
|
||||||
'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
|
|
||||||
ol.DEBUG && console.assert(this.indicesBuffer,
|
|
||||||
'indicesBuffer must not be null');
|
|
||||||
context.bindBuffer(ol.webgl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);
|
context.bindBuffer(ol.webgl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);
|
||||||
|
|
||||||
var locations = this.setUpProgram(gl, context, size, pixelRatio);
|
var locations = this.setUpProgram(gl, context, size, pixelRatio);
|
||||||
@@ -311,11 +305,11 @@ ol.render.webgl.Replay.prototype.replay = function(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gl.uniformMatrix4fv(locations.u_projectionMatrix, false,
|
gl.uniformMatrix4fv(locations.u_projectionMatrix, false,
|
||||||
ol.vec.Mat4.fromTransform(this.tmpMat4_, projectionMatrix));
|
ol.vec.Mat4.fromTransform(this.tmpMat4_, projectionMatrix));
|
||||||
gl.uniformMatrix4fv(locations.u_offsetScaleMatrix, false,
|
gl.uniformMatrix4fv(locations.u_offsetScaleMatrix, false,
|
||||||
ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetScaleMatrix));
|
ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetScaleMatrix));
|
||||||
gl.uniformMatrix4fv(locations.u_offsetRotateMatrix, false,
|
gl.uniformMatrix4fv(locations.u_offsetRotateMatrix, false,
|
||||||
ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetRotateMatrix));
|
ol.vec.Mat4.fromTransform(this.tmpMat4_, offsetRotateMatrix));
|
||||||
gl.uniform1f(locations.u_opacity, opacity);
|
gl.uniform1f(locations.u_opacity, opacity);
|
||||||
|
|
||||||
// draw!
|
// draw!
|
||||||
@@ -337,10 +331,10 @@ ol.render.webgl.Replay.prototype.replay = function(context,
|
|||||||
}
|
}
|
||||||
gl.clear(gl.STENCIL_BUFFER_BIT);
|
gl.clear(gl.STENCIL_BUFFER_BIT);
|
||||||
gl.stencilFunc(/** @type {number} */ (tmpStencilFunc),
|
gl.stencilFunc(/** @type {number} */ (tmpStencilFunc),
|
||||||
/** @type {number} */ (tmpStencilRef), /** @type {number} */ (tmpStencilMaskVal));
|
/** @type {number} */ (tmpStencilRef), /** @type {number} */ (tmpStencilMaskVal));
|
||||||
gl.stencilMask(/** @type {number} */ (tmpStencilMask));
|
gl.stencilMask(/** @type {number} */ (tmpStencilMask));
|
||||||
gl.stencilOp(/** @type {number} */ (tmpStencilOpFail),
|
gl.stencilOp(/** @type {number} */ (tmpStencilOpFail),
|
||||||
/** @type {number} */ (tmpStencilOpZFail), /** @type {number} */ (tmpStencilOpPass));
|
/** @type {number} */ (tmpStencilOpZFail), /** @type {number} */ (tmpStencilOpPass));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -107,9 +107,6 @@ ol.render.webgl.ReplayGroup.prototype.getReplay = function(zIndex, replayType) {
|
|||||||
var replay = replays[replayType];
|
var replay = replays[replayType];
|
||||||
if (replay === undefined) {
|
if (replay === undefined) {
|
||||||
var Constructor = ol.render.webgl.ReplayGroup.BATCH_CONSTRUCTORS_[replayType];
|
var Constructor = ol.render.webgl.ReplayGroup.BATCH_CONSTRUCTORS_[replayType];
|
||||||
ol.DEBUG && console.assert(Constructor !== undefined,
|
|
||||||
replayType +
|
|
||||||
' constructor missing from ol.render.webgl.ReplayGroup.BATCH_CONSTRUCTORS_');
|
|
||||||
replay = new Constructor(this.tolerance_, this.maxExtent_);
|
replay = new Constructor(this.tolerance_, this.maxExtent_);
|
||||||
replays[replayType] = replay;
|
replays[replayType] = replay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ goog.provide('ol.renderer.canvas.ImageLayer');
|
|||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.proj');
|
|
||||||
goog.require('ol.renderer.canvas.IntermediateCanvas');
|
goog.require('ol.renderer.canvas.IntermediateCanvas');
|
||||||
goog.require('ol.transform');
|
goog.require('ol.transform');
|
||||||
|
|
||||||
@@ -78,8 +77,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection),
|
|
||||||
'projection and sourceProjection are equivalent');
|
|
||||||
projection = sourceProjection;
|
projection = sourceProjection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,20 +116,12 @@ ol.renderer.Layer.prototype.loadImage = function(image) {
|
|||||||
var imageState = image.getState();
|
var imageState = image.getState();
|
||||||
if (imageState != ol.ImageState.LOADED &&
|
if (imageState != ol.ImageState.LOADED &&
|
||||||
imageState != ol.ImageState.ERROR) {
|
imageState != ol.ImageState.ERROR) {
|
||||||
// the image is either "idle" or "loading", register the change
|
|
||||||
// listener (a noop if the listener was already registered)
|
|
||||||
ol.DEBUG && console.assert(imageState == ol.ImageState.IDLE ||
|
|
||||||
imageState == ol.ImageState.LOADING,
|
|
||||||
'imageState is "idle" or "loading"');
|
|
||||||
ol.events.listen(image, ol.events.EventType.CHANGE,
|
ol.events.listen(image, ol.events.EventType.CHANGE,
|
||||||
this.handleImageChange_, this);
|
this.handleImageChange_, this);
|
||||||
}
|
}
|
||||||
if (imageState == ol.ImageState.IDLE) {
|
if (imageState == ol.ImageState.IDLE) {
|
||||||
image.load();
|
image.load();
|
||||||
imageState = image.getState();
|
imageState = image.getState();
|
||||||
ol.DEBUG && console.assert(imageState == ol.ImageState.LOADING ||
|
|
||||||
imageState == ol.ImageState.LOADED,
|
|
||||||
'imageState is "loading" or "loaded"');
|
|
||||||
}
|
}
|
||||||
return imageState == ol.ImageState.LOADED;
|
return imageState == ol.ImageState.LOADED;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ 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;
|
||||||
ol.DEBUG && console.assert(coordinateToPixelTransform,
|
|
||||||
'frameState has a coordinateToPixelTransform');
|
|
||||||
|
|
||||||
ol.transform.compose(coordinateToPixelTransform,
|
ol.transform.compose(coordinateToPixelTransform,
|
||||||
frameState.size[0] / 2, frameState.size[1] / 2,
|
frameState.size[0] / 2, frameState.size[1] / 2,
|
||||||
@@ -223,8 +221,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(layerKey in this.layerRenderers_,
|
|
||||||
'given layerKey (%s) exists in layerRenderers', layerKey);
|
|
||||||
return this.layerRenderers_[layerKey];
|
return this.layerRenderers_[layerKey];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -268,13 +264,9 @@ ol.renderer.Map.prototype.handleLayerRendererChange_ = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
ol.renderer.Map.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
||||||
ol.DEBUG && console.assert(layerKey in this.layerRenderers_,
|
|
||||||
'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];
|
||||||
|
|
||||||
ol.DEBUG && console.assert(layerKey in this.layerRendererListeners_,
|
|
||||||
'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];
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,6 @@ ol.renderer.vector.renderFeature = function(
|
|||||||
imageStyle.load();
|
imageStyle.load();
|
||||||
}
|
}
|
||||||
imageState = imageStyle.getImageState();
|
imageState = imageStyle.getImageState();
|
||||||
ol.DEBUG && console.assert(imageState == ol.ImageState.LOADING,
|
|
||||||
'imageState should be LOADING');
|
|
||||||
imageStyle.listenImageChange(listener, thisArg);
|
imageStyle.listenImageChange(listener, thisArg);
|
||||||
loading = true;
|
loading = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE = 'precision medium
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.DEBUG ?
|
ol.renderer.webgl.defaultmapshader.Fragment.SOURCE = ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.renderer.webgl.defaultmapshader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.renderer.webgl.defaultmapshader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.renderer.webgl.defaultmapshader.fragment = new ol.renderer.webgl.defaultmapshader.Fragment();
|
ol.renderer.webgl.defaultmapshader.fragment = new ol.renderer.webgl.defaultmapshader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE = 'varying vec2 a;att
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.DEBUG ?
|
ol.renderer.webgl.defaultmapshader.Vertex.SOURCE = ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.renderer.webgl.defaultmapshader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.renderer.webgl.defaultmapshader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.renderer.webgl.defaultmapshader.vertex = new ol.renderer.webgl.defaultmapshader.Vertex();
|
ol.renderer.webgl.defaultmapshader.vertex = new ol.renderer.webgl.defaultmapshader.Vertex();
|
||||||
@@ -91,36 +87,30 @@ ol.renderer.webgl.defaultmapshader.Locations = function(gl, program) {
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_opacity = gl.getUniformLocation(
|
this.u_opacity = gl.getUniformLocation(program, 'f');
|
||||||
program, ol.DEBUG ? 'u_opacity' : 'f');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_projectionMatrix = gl.getUniformLocation(
|
this.u_projectionMatrix = gl.getUniformLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'u_projectionMatrix' : 'e');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_texCoordMatrix = gl.getUniformLocation(
|
this.u_texCoordMatrix = gl.getUniformLocation(program, 'd');
|
||||||
program, ol.DEBUG ? 'u_texCoordMatrix' : 'd');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_texture = gl.getUniformLocation(
|
this.u_texture = gl.getUniformLocation(program, 'g');
|
||||||
program, ol.DEBUG ? 'u_texture' : 'g');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'b');
|
||||||
program, ol.DEBUG ? 'a_position' : 'b');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_texCoord = gl.getAttribLocation(
|
this.a_texCoord = gl.getAttribLocation(program, 'c');
|
||||||
program, ol.DEBUG ? 'a_texCoord' : 'c');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ goog.require('ol.ViewHint');
|
|||||||
goog.require('ol.dom');
|
goog.require('ol.dom');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.functions');
|
goog.require('ol.functions');
|
||||||
goog.require('ol.proj');
|
|
||||||
goog.require('ol.renderer.webgl.Layer');
|
goog.require('ol.renderer.webgl.Layer');
|
||||||
goog.require('ol.source.ImageVector');
|
goog.require('ol.source.ImageVector');
|
||||||
goog.require('ol.transform');
|
goog.require('ol.transform');
|
||||||
@@ -118,8 +117,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(ol.proj.equivalent(projection, sourceProjection),
|
|
||||||
'projection and sourceProjection are equivalent');
|
|
||||||
projection = sourceProjection;
|
projection = sourceProjection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,8 +146,6 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (image) {
|
if (image) {
|
||||||
ol.DEBUG && console.assert(texture, 'texture is truthy');
|
|
||||||
|
|
||||||
var canvas = this.mapRenderer.getContext().getCanvas();
|
var canvas = this.mapRenderer.getContext().getCanvas();
|
||||||
|
|
||||||
this.updateProjectionMatrix_(canvas.width, canvas.height,
|
this.updateProjectionMatrix_(canvas.width, canvas.height,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ goog.require('ol.webgl.ContextEventType');
|
|||||||
* @param {ol.Map} map Map.
|
* @param {ol.Map} map Map.
|
||||||
*/
|
*/
|
||||||
ol.renderer.webgl.Map = function(container, map) {
|
ol.renderer.webgl.Map = function(container, map) {
|
||||||
|
|
||||||
ol.renderer.Map.call(this, container, map);
|
ol.renderer.Map.call(this, container, map);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +76,6 @@ ol.renderer.webgl.Map = function(container, map) {
|
|||||||
preserveDrawingBuffer: false,
|
preserveDrawingBuffer: false,
|
||||||
stencil: true
|
stencil: true
|
||||||
});
|
});
|
||||||
ol.DEBUG && console.assert(this.gl_, 'got a WebGLRenderingContext');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -129,12 +127,12 @@ ol.renderer.webgl.Map = function(container, map) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Map} map Map.
|
* @param {ol.Map} map Map.
|
||||||
* @param {?olx.FrameState} frameState Frame state.
|
* @param {?olx.FrameState} frameState Frame state.
|
||||||
* @return {boolean} false.
|
* @return {boolean} false.
|
||||||
* @this {ol.renderer.webgl.Map}
|
* @this {ol.renderer.webgl.Map}
|
||||||
*/
|
*/
|
||||||
this.loadNextTileTexture_ =
|
this.loadNextTileTexture_ =
|
||||||
function(map, frameState) {
|
function(map, frameState) {
|
||||||
if (!this.tileTextureQueue_.isEmpty()) {
|
if (!this.tileTextureQueue_.isEmpty()) {
|
||||||
@@ -157,7 +155,6 @@ ol.renderer.webgl.Map = function(container, map) {
|
|||||||
this.textureCacheFrameMarkerCount_ = 0;
|
this.textureCacheFrameMarkerCount_ = 0;
|
||||||
|
|
||||||
this.initializeGL_();
|
this.initializeGL_();
|
||||||
|
|
||||||
};
|
};
|
||||||
ol.inherits(ol.renderer.webgl.Map, ol.renderer.Map);
|
ol.inherits(ol.renderer.webgl.Map, ol.renderer.Map);
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE = 'precision mediump
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.DEBUG ?
|
ol.renderer.webgl.tilelayershader.Fragment.SOURCE = ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE;
|
||||||
ol.renderer.webgl.tilelayershader.Fragment.DEBUG_SOURCE :
|
|
||||||
ol.renderer.webgl.tilelayershader.Fragment.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.renderer.webgl.tilelayershader.fragment = new ol.renderer.webgl.tilelayershader.Fragment();
|
ol.renderer.webgl.tilelayershader.fragment = new ol.renderer.webgl.tilelayershader.Fragment();
|
||||||
@@ -72,9 +70,7 @@ ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE = 'varying vec2 a;attr
|
|||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.DEBUG ?
|
ol.renderer.webgl.tilelayershader.Vertex.SOURCE = ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE;
|
||||||
ol.renderer.webgl.tilelayershader.Vertex.DEBUG_SOURCE :
|
|
||||||
ol.renderer.webgl.tilelayershader.Vertex.OPTIMIZED_SOURCE;
|
|
||||||
|
|
||||||
|
|
||||||
ol.renderer.webgl.tilelayershader.vertex = new ol.renderer.webgl.tilelayershader.Vertex();
|
ol.renderer.webgl.tilelayershader.vertex = new ol.renderer.webgl.tilelayershader.Vertex();
|
||||||
@@ -91,24 +87,20 @@ ol.renderer.webgl.tilelayershader.Locations = function(gl, program) {
|
|||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_texture = gl.getUniformLocation(
|
this.u_texture = gl.getUniformLocation(program, 'e');
|
||||||
program, ol.DEBUG ? 'u_texture' : 'e');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {WebGLUniformLocation}
|
* @type {WebGLUniformLocation}
|
||||||
*/
|
*/
|
||||||
this.u_tileOffset = gl.getUniformLocation(
|
this.u_tileOffset = gl.getUniformLocation(program, 'd');
|
||||||
program, ol.DEBUG ? 'u_tileOffset' : 'd');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_position = gl.getAttribLocation(
|
this.a_position = gl.getAttribLocation(program, 'b');
|
||||||
program, ol.DEBUG ? 'a_position' : 'b');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.a_texCoord = gl.getAttribLocation(
|
this.a_texCoord = gl.getAttribLocation(program, 'c');
|
||||||
program, ol.DEBUG ? 'a_texCoord' : 'c');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -194,8 +194,6 @@ ol.reproj.Image.prototype.load = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.reproj.Image.prototype.unlistenSource_ = function() {
|
ol.reproj.Image.prototype.unlistenSource_ = function() {
|
||||||
ol.DEBUG && console.assert(this.sourceListenerKey_,
|
|
||||||
'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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,12 +173,6 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
|
|||||||
var sourceRange = sourceTileGrid.getTileRangeForExtentAndZ(
|
var sourceRange = sourceTileGrid.getTileRangeForExtentAndZ(
|
||||||
sourceExtent, this.sourceZ_);
|
sourceExtent, this.sourceZ_);
|
||||||
|
|
||||||
var tilesRequired = sourceRange.getWidth() * sourceRange.getHeight();
|
|
||||||
if (ol.DEBUG && !(tilesRequired < ol.RASTER_REPROJECTION_MAX_SOURCE_TILES)) {
|
|
||||||
console.assert(false, 'reasonable number of tiles is required');
|
|
||||||
this.state = ol.TileState.ERROR;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (var srcX = sourceRange.minX; srcX <= sourceRange.maxX; srcX++) {
|
for (var srcX = sourceRange.minX; srcX <= sourceRange.maxX; srcX++) {
|
||||||
for (var srcY = sourceRange.minY; srcY <= sourceRange.maxY; srcY++) {
|
for (var srcY = sourceRange.minY; srcY <= sourceRange.maxY; srcY++) {
|
||||||
var tile = getTileFunction(this.sourceZ_, srcX, srcY, pixelRatio);
|
var tile = getTileFunction(this.sourceZ_, srcX, srcY, pixelRatio);
|
||||||
@@ -263,9 +257,6 @@ ol.reproj.Tile.prototype.load = function() {
|
|||||||
|
|
||||||
var leftToLoad = 0;
|
var leftToLoad = 0;
|
||||||
|
|
||||||
ol.DEBUG && console.assert(!this.sourcesListenerKeys_,
|
|
||||||
'this.sourcesListenerKeys_ should be null');
|
|
||||||
|
|
||||||
this.sourcesListenerKeys_ = [];
|
this.sourcesListenerKeys_ = [];
|
||||||
this.sourceTiles_.forEach(function(tile, i, arr) {
|
this.sourceTiles_.forEach(function(tile, i, arr) {
|
||||||
var state = tile.getState();
|
var state = tile.getState();
|
||||||
@@ -281,8 +272,6 @@ ol.reproj.Tile.prototype.load = function() {
|
|||||||
state == ol.TileState.EMPTY) {
|
state == ol.TileState.EMPTY) {
|
||||||
ol.events.unlistenByKey(sourceListenKey);
|
ol.events.unlistenByKey(sourceListenKey);
|
||||||
leftToLoad--;
|
leftToLoad--;
|
||||||
ol.DEBUG && console.assert(leftToLoad >= 0,
|
|
||||||
'leftToLoad should not be negative');
|
|
||||||
if (leftToLoad === 0) {
|
if (leftToLoad === 0) {
|
||||||
this.unlistenSources_();
|
this.unlistenSources_();
|
||||||
this.reproject_();
|
this.reproject_();
|
||||||
|
|||||||
@@ -115,10 +115,6 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent,
|
|||||||
ol.RASTER_REPROJECTION_MAX_SUBDIVISION);
|
ol.RASTER_REPROJECTION_MAX_SUBDIVISION);
|
||||||
|
|
||||||
if (this.wrapsXInSource_) {
|
if (this.wrapsXInSource_) {
|
||||||
// Fix coordinates (ol.proj returns wrapped coordinates, "unwrap" here).
|
|
||||||
// This significantly simplifies the rest of the reprojection process.
|
|
||||||
|
|
||||||
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,
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ ol.source.BingMaps.prototype.getImagerySet = function() {
|
|||||||
* @param {BingMapsImageryMetadataResponse} response Response.
|
* @param {BingMapsImageryMetadataResponse} response Response.
|
||||||
*/
|
*/
|
||||||
ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) {
|
ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response) {
|
||||||
|
|
||||||
if (response.statusCode != 200 ||
|
if (response.statusCode != 200 ||
|
||||||
response.statusDescription != 'OK' ||
|
response.statusDescription != 'OK' ||
|
||||||
response.authenticationResultCode != 'ValidCredentials' ||
|
response.authenticationResultCode != 'ValidCredentials' ||
|
||||||
@@ -132,8 +131,6 @@ 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];
|
||||||
ol.DEBUG && console.assert(resource.imageWidth == resource.imageHeight,
|
|
||||||
'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_;
|
||||||
|
|
||||||
var sourceProjection = this.getProjection();
|
var sourceProjection = this.getProjection();
|
||||||
@@ -164,9 +161,6 @@ 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) {
|
||||||
ol.DEBUG && console.assert(ol.proj.equivalent(
|
|
||||||
projection, sourceProjection),
|
|
||||||
'projections are equivalent');
|
|
||||||
if (!tileCoord) {
|
if (!tileCoord) {
|
||||||
return undefined;
|
return undefined;
|
||||||
} else {
|
} else {
|
||||||
@@ -216,5 +210,4 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = function(response)
|
|||||||
this.setLogo(brandLogoUri);
|
this.setLogo(brandLogoUri);
|
||||||
|
|
||||||
this.setState(ol.source.State.READY);
|
this.setState(ol.source.State.READY);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ 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);
|
||||||
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,9 +162,6 @@ ol.source.Cluster.prototype.cluster_ = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(
|
|
||||||
Object.keys(clustered).length == this.source_.getFeatures().length,
|
|
||||||
'number of clustered equals number of features in the source');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ goog.require('ol.source.Source');
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.source.Image = function(options) {
|
ol.source.Image = function(options) {
|
||||||
|
|
||||||
ol.source.Source.call(this, {
|
ol.source.Source.call(this, {
|
||||||
attributions: options.attributions,
|
attributions: options.attributions,
|
||||||
extent: options.extent,
|
extent: options.extent,
|
||||||
@@ -37,11 +36,6 @@ ol.source.Image = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.resolutions_ = options.resolutions !== undefined ?
|
this.resolutions_ = options.resolutions !== undefined ?
|
||||||
options.resolutions : null;
|
options.resolutions : null;
|
||||||
ol.DEBUG && console.assert(!this.resolutions_ ||
|
|
||||||
ol.array.isSorted(this.resolutions_,
|
|
||||||
function(a, b) {
|
|
||||||
return b - a;
|
|
||||||
}, true), 'resolutions must be null or sorted in descending order');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +50,6 @@ ol.source.Image = function(options) {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.reprojectedRevision_ = 0;
|
this.reprojectedRevision_ = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
ol.inherits(ol.source.Image, ol.source.Source);
|
ol.inherits(ol.source.Image, ol.source.Source);
|
||||||
|
|
||||||
|
|||||||
@@ -194,9 +194,6 @@ ol.source.ImageArcGISRest.prototype.getImageLoadFunction = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) {
|
ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) {
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
@@ -209,8 +206,8 @@ ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixe
|
|||||||
var url = this.url_;
|
var url = this.url_;
|
||||||
|
|
||||||
var modifiedUrl = url
|
var modifiedUrl = url
|
||||||
.replace(/MapServer\/?$/, 'MapServer/export')
|
.replace(/MapServer\/?$/, 'MapServer/export')
|
||||||
.replace(/ImageServer\/?$/, 'ImageServer/exportImage');
|
.replace(/ImageServer\/?$/, 'ImageServer/exportImage');
|
||||||
if (modifiedUrl == url) {
|
if (modifiedUrl == url) {
|
||||||
ol.asserts.assert(false, 50); // `options.featureTypes` should be an Array
|
ol.asserts.assert(false, 50); // `options.featureTypes` should be an Array
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,10 +134,6 @@ ol.source.ImageWMS.GETFEATUREINFO_IMAGE_SIZE_ = [101, 101];
|
|||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) {
|
ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resolution, projection, params) {
|
||||||
|
|
||||||
ol.DEBUG && console.assert(!('VERSION' in params),
|
|
||||||
'key VERSION is not allowed in params');
|
|
||||||
|
|
||||||
if (this.url_ === undefined) {
|
if (this.url_ === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user