Merge pull request #7620 from tschaub/rename
Rename variables in format modules
This commit is contained in:
@@ -5,8 +5,8 @@ import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import {containsExtent} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import JSONFeature from '../format/JSONFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
@@ -30,11 +30,11 @@ import {get as getProjection} from '../proj.js';
|
||||
* @param {olx.format.EsriJSONOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_EsriJSON_ = function(opt_options) {
|
||||
var EsriJSON = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_JSONFeature_.call(this);
|
||||
JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* Name of the geometry attribute for features.
|
||||
@@ -45,7 +45,7 @@ var _ol_format_EsriJSON_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_);
|
||||
inherits(EsriJSON, JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,7 @@ inherits(_ol_format_EsriJSON_, _ol_format_JSONFeature_);
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
|
||||
EsriJSON.readGeometry_ = function(object, opt_options) {
|
||||
if (!object) {
|
||||
return null;
|
||||
}
|
||||
@@ -71,8 +71,8 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
|
||||
type = GeometryType.MULTI_LINE_STRING;
|
||||
}
|
||||
} else if (object.rings) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
var rings = _ol_format_EsriJSON_.convertRings_(object.rings, layout);
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
var rings = EsriJSON.convertRings_(object.rings, layout);
|
||||
object = /** @type {EsriJSONGeometry} */(_ol_obj_.assign({}, object));
|
||||
if (rings.length === 1) {
|
||||
type = GeometryType.POLYGON;
|
||||
@@ -82,9 +82,9 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
|
||||
object.rings = rings;
|
||||
}
|
||||
}
|
||||
var geometryReader = _ol_format_EsriJSON_.GEOMETRY_READERS_[type];
|
||||
var geometryReader = EsriJSON.GEOMETRY_READERS_[type];
|
||||
return (
|
||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
||||
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||
geometryReader(object), false, opt_options)
|
||||
);
|
||||
};
|
||||
@@ -100,7 +100,7 @@ _ol_format_EsriJSON_.readGeometry_ = function(object, opt_options) {
|
||||
* @private
|
||||
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
||||
*/
|
||||
_ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
|
||||
EsriJSON.convertRings_ = function(rings, layout) {
|
||||
var flatRing = [];
|
||||
var outerRings = [];
|
||||
var holes = [];
|
||||
@@ -149,7 +149,7 @@ _ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} Point.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readPointGeometry_ = function(object) {
|
||||
EsriJSON.readPointGeometry_ = function(object) {
|
||||
var point;
|
||||
if (object.m !== undefined && object.z !== undefined) {
|
||||
point = new Point([object.x, object.y, object.z, object.m],
|
||||
@@ -172,8 +172,8 @@ _ol_format_EsriJSON_.readPointGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} LineString.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readLineStringGeometry_ = function(object) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
EsriJSON.readLineStringGeometry_ = function(object) {
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
return new LineString(object.paths[0], layout);
|
||||
};
|
||||
|
||||
@@ -183,8 +183,8 @@ _ol_format_EsriJSON_.readLineStringGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} MultiLineString.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readMultiLineStringGeometry_ = function(object) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
EsriJSON.readMultiLineStringGeometry_ = function(object) {
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
return new MultiLineString(object.paths, layout);
|
||||
};
|
||||
|
||||
@@ -194,7 +194,7 @@ _ol_format_EsriJSON_.readMultiLineStringGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.GeometryLayout} The geometry layout to use.
|
||||
*/
|
||||
_ol_format_EsriJSON_.getGeometryLayout_ = function(object) {
|
||||
EsriJSON.getGeometryLayout_ = function(object) {
|
||||
var layout = GeometryLayout.XY;
|
||||
if (object.hasZ === true && object.hasM === true) {
|
||||
layout = GeometryLayout.XYZM;
|
||||
@@ -212,8 +212,8 @@ _ol_format_EsriJSON_.getGeometryLayout_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} MultiPoint.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readMultiPointGeometry_ = function(object) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
EsriJSON.readMultiPointGeometry_ = function(object) {
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
return new MultiPoint(object.points, layout);
|
||||
};
|
||||
|
||||
@@ -223,8 +223,8 @@ _ol_format_EsriJSON_.readMultiPointGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} MultiPolygon.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
EsriJSON.readMultiPolygonGeometry_ = function(object) {
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
return new MultiPolygon(
|
||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
||||
layout);
|
||||
@@ -236,8 +236,8 @@ _ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} Polygon.
|
||||
*/
|
||||
_ol_format_EsriJSON_.readPolygonGeometry_ = function(object) {
|
||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||
EsriJSON.readPolygonGeometry_ = function(object) {
|
||||
var layout = EsriJSON.getGeometryLayout_(object);
|
||||
return new Polygon(object.rings, layout);
|
||||
};
|
||||
|
||||
@@ -248,7 +248,7 @@ _ol_format_EsriJSON_.readPolygonGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
EsriJSON.writePointGeometry_ = function(geometry, opt_options) {
|
||||
var coordinates = /** @type {ol.geom.Point} */ (geometry).getCoordinates();
|
||||
var esriJSON;
|
||||
var layout = /** @type {ol.geom.Point} */ (geometry).getLayout();
|
||||
@@ -288,7 +288,7 @@ _ol_format_EsriJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {Object} Object with boolean hasZ and hasM keys.
|
||||
*/
|
||||
_ol_format_EsriJSON_.getHasZM_ = function(geometry) {
|
||||
EsriJSON.getHasZM_ = function(geometry) {
|
||||
var layout = geometry.getLayout();
|
||||
return {
|
||||
hasZ: (layout === GeometryLayout.XYZ ||
|
||||
@@ -305,8 +305,8 @@ _ol_format_EsriJSON_.getHasZM_ = function(geometry) {
|
||||
* @private
|
||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.LineString} */(geometry));
|
||||
EsriJSON.writeLineStringGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.LineString} */(geometry));
|
||||
return /** @type {EsriJSONPolyline} */ ({
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
@@ -323,9 +323,9 @@ _ol_format_EsriJSON_.writeLineStringGeometry_ = function(geometry, opt_options)
|
||||
* @private
|
||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
EsriJSON.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
// Esri geometries use the left-hand rule
|
||||
var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.Polygon} */(geometry));
|
||||
var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.Polygon} */(geometry));
|
||||
return /** @type {EsriJSONPolygon} */ ({
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
@@ -340,8 +340,8 @@ _ol_format_EsriJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiLineString} */(geometry));
|
||||
EsriJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiLineString} */(geometry));
|
||||
return /** @type {EsriJSONPolyline} */ ({
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
@@ -356,8 +356,8 @@ _ol_format_EsriJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_opti
|
||||
* @private
|
||||
* @return {EsriJSONMultipoint} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiPoint} */(geometry));
|
||||
EsriJSON.writeMultiPointGeometry_ = function(geometry, opt_options) {
|
||||
var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiPoint} */(geometry));
|
||||
return /** @type {EsriJSONMultipoint} */ ({
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
@@ -372,9 +372,9 @@ _ol_format_EsriJSON_.writeMultiPointGeometry_ = function(geometry, opt_options)
|
||||
* @private
|
||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writeMultiPolygonGeometry_ = function(geometry,
|
||||
EsriJSON.writeMultiPolygonGeometry_ = function(geometry,
|
||||
opt_options) {
|
||||
var hasZM = _ol_format_EsriJSON_.getHasZM_(/** @type {ol.geom.MultiPolygon} */(geometry));
|
||||
var hasZM = EsriJSON.getHasZM_(/** @type {ol.geom.MultiPolygon} */(geometry));
|
||||
var coordinates = /** @type {ol.geom.MultiPolygon} */ (geometry).getCoordinates(false);
|
||||
var output = [];
|
||||
for (var i = 0; i < coordinates.length; i++) {
|
||||
@@ -395,19 +395,19 @@ _ol_format_EsriJSON_.writeMultiPolygonGeometry_ = function(geometry,
|
||||
* @private
|
||||
* @type {Object.<ol.geom.GeometryType, function(EsriJSONGeometry): ol.geom.Geometry>}
|
||||
*/
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_ = {};
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.POINT] =
|
||||
_ol_format_EsriJSON_.readPointGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.LINE_STRING] =
|
||||
_ol_format_EsriJSON_.readLineStringGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.POLYGON] =
|
||||
_ol_format_EsriJSON_.readPolygonGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POINT] =
|
||||
_ol_format_EsriJSON_.readMultiPointGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_LINE_STRING] =
|
||||
_ol_format_EsriJSON_.readMultiLineStringGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
|
||||
_ol_format_EsriJSON_.readMultiPolygonGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_ = {};
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.POINT] =
|
||||
EsriJSON.readPointGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.LINE_STRING] =
|
||||
EsriJSON.readLineStringGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.POLYGON] =
|
||||
EsriJSON.readPolygonGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_POINT] =
|
||||
EsriJSON.readMultiPointGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_LINE_STRING] =
|
||||
EsriJSON.readMultiLineStringGeometry_;
|
||||
EsriJSON.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
|
||||
EsriJSON.readMultiPolygonGeometry_;
|
||||
|
||||
|
||||
/**
|
||||
@@ -415,19 +415,19 @@ _ol_format_EsriJSON_.GEOMETRY_READERS_[GeometryType.MULTI_POLYGON] =
|
||||
* @private
|
||||
* @type {Object.<string, function(ol.geom.Geometry, olx.format.WriteOptions=): (EsriJSONGeometry)>}
|
||||
*/
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_ = {};
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.POINT] =
|
||||
_ol_format_EsriJSON_.writePointGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.LINE_STRING] =
|
||||
_ol_format_EsriJSON_.writeLineStringGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.POLYGON] =
|
||||
_ol_format_EsriJSON_.writePolygonGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POINT] =
|
||||
_ol_format_EsriJSON_.writeMultiPointGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_LINE_STRING] =
|
||||
_ol_format_EsriJSON_.writeMultiLineStringGeometry_;
|
||||
_ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
|
||||
_ol_format_EsriJSON_.writeMultiPolygonGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_ = {};
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.POINT] =
|
||||
EsriJSON.writePointGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.LINE_STRING] =
|
||||
EsriJSON.writeLineStringGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.POLYGON] =
|
||||
EsriJSON.writePolygonGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_POINT] =
|
||||
EsriJSON.writeMultiPointGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_LINE_STRING] =
|
||||
EsriJSON.writeMultiLineStringGeometry_;
|
||||
EsriJSON.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
|
||||
EsriJSON.writeMultiPolygonGeometry_;
|
||||
|
||||
|
||||
/**
|
||||
@@ -440,7 +440,7 @@ _ol_format_EsriJSON_.GEOMETRY_WRITERS_[GeometryType.MULTI_POLYGON] =
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readFeature;
|
||||
EsriJSON.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
@@ -453,16 +453,16 @@ _ol_format_EsriJSON_.prototype.readFeature;
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readFeatures;
|
||||
EsriJSON.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readFeatureFromObject = function(
|
||||
EsriJSON.prototype.readFeatureFromObject = function(
|
||||
object, opt_options) {
|
||||
var esriJSONFeature = /** @type {EsriJSONFeature} */ (object);
|
||||
var geometry = _ol_format_EsriJSON_.readGeometry_(esriJSONFeature.geometry,
|
||||
var geometry = EsriJSON.readGeometry_(esriJSONFeature.geometry,
|
||||
opt_options);
|
||||
var feature = new _ol_Feature_();
|
||||
if (this.geometryName_) {
|
||||
@@ -484,7 +484,7 @@ _ol_format_EsriJSON_.prototype.readFeatureFromObject = function(
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readFeaturesFromObject = function(
|
||||
EsriJSON.prototype.readFeaturesFromObject = function(
|
||||
object, opt_options) {
|
||||
var esriJSONObject = /** @type {EsriJSONObject} */ (object);
|
||||
var options = opt_options ? opt_options : {};
|
||||
@@ -516,15 +516,15 @@ _ol_format_EsriJSON_.prototype.readFeaturesFromObject = function(
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readGeometry;
|
||||
EsriJSON.prototype.readGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readGeometryFromObject = function(
|
||||
EsriJSON.prototype.readGeometryFromObject = function(
|
||||
object, opt_options) {
|
||||
return _ol_format_EsriJSON_.readGeometry_(
|
||||
return EsriJSON.readGeometry_(
|
||||
/** @type {EsriJSONGeometry} */(object), opt_options);
|
||||
};
|
||||
|
||||
@@ -537,13 +537,13 @@ _ol_format_EsriJSON_.prototype.readGeometryFromObject = function(
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readProjection;
|
||||
EsriJSON.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
EsriJSON.prototype.readProjectionFromObject = function(object) {
|
||||
var esriJSONObject = /** @type {EsriJSONObject} */ (object);
|
||||
if (esriJSONObject.spatialReference && esriJSONObject.spatialReference.wkid) {
|
||||
var crs = esriJSONObject.spatialReference.wkid;
|
||||
@@ -560,10 +560,10 @@ _ol_format_EsriJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
* @private
|
||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||
*/
|
||||
_ol_format_EsriJSON_.writeGeometry_ = function(geometry, opt_options) {
|
||||
var geometryWriter = _ol_format_EsriJSON_.GEOMETRY_WRITERS_[geometry.getType()];
|
||||
EsriJSON.writeGeometry_ = function(geometry, opt_options) {
|
||||
var geometryWriter = EsriJSON.GEOMETRY_WRITERS_[geometry.getType()];
|
||||
return geometryWriter(/** @type {ol.geom.Geometry} */(
|
||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
|
||||
FeatureFormat.transformWithOptions(geometry, true, opt_options)),
|
||||
opt_options);
|
||||
};
|
||||
|
||||
@@ -577,7 +577,7 @@ _ol_format_EsriJSON_.writeGeometry_ = function(geometry, opt_options) {
|
||||
* @return {string} EsriJSON.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeGeometry;
|
||||
EsriJSON.prototype.writeGeometry;
|
||||
|
||||
|
||||
/**
|
||||
@@ -589,9 +589,9 @@ _ol_format_EsriJSON_.prototype.writeGeometry;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeGeometryObject = function(geometry,
|
||||
EsriJSON.prototype.writeGeometryObject = function(geometry,
|
||||
opt_options) {
|
||||
return _ol_format_EsriJSON_.writeGeometry_(geometry,
|
||||
return EsriJSON.writeGeometry_(geometry,
|
||||
this.adaptOptions(opt_options));
|
||||
};
|
||||
|
||||
@@ -605,7 +605,7 @@ _ol_format_EsriJSON_.prototype.writeGeometryObject = function(geometry,
|
||||
* @return {string} EsriJSON.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeFeature;
|
||||
EsriJSON.prototype.writeFeature;
|
||||
|
||||
|
||||
/**
|
||||
@@ -617,14 +617,14 @@ _ol_format_EsriJSON_.prototype.writeFeature;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeFeatureObject = function(
|
||||
EsriJSON.prototype.writeFeatureObject = function(
|
||||
feature, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
var object = {};
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
object['geometry'] =
|
||||
_ol_format_EsriJSON_.writeGeometry_(geometry, opt_options);
|
||||
EsriJSON.writeGeometry_(geometry, opt_options);
|
||||
if (opt_options && opt_options.featureProjection) {
|
||||
object['geometry']['spatialReference'] = /** @type {EsriJSONCRS} */({
|
||||
wkid: getProjection(opt_options.featureProjection).getCode().split(':').pop()
|
||||
@@ -651,7 +651,7 @@ _ol_format_EsriJSON_.prototype.writeFeatureObject = function(
|
||||
* @return {string} EsriJSON.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeFeatures;
|
||||
EsriJSON.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
@@ -663,7 +663,7 @@ _ol_format_EsriJSON_.prototype.writeFeatures;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_EsriJSON_.prototype.writeFeaturesObject = function(features, opt_options) {
|
||||
EsriJSON.prototype.writeFeaturesObject = function(features, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
var objects = [];
|
||||
var i, ii;
|
||||
@@ -674,4 +674,4 @@ _ol_format_EsriJSON_.prototype.writeFeaturesObject = function(features, opt_opti
|
||||
'features': objects
|
||||
});
|
||||
};
|
||||
export default _ol_format_EsriJSON_;
|
||||
export default EsriJSON;
|
||||
|
||||
@@ -18,7 +18,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
||||
* @abstract
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_Feature_ = function() {
|
||||
var FeatureFormat = function() {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -42,7 +42,7 @@ var _ol_format_Feature_ = function() {
|
||||
* @return {olx.format.ReadOptions|undefined} Options.
|
||||
* @protected
|
||||
*/
|
||||
_ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
|
||||
FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
|
||||
var options;
|
||||
if (opt_options) {
|
||||
options = {
|
||||
@@ -64,7 +64,7 @@ _ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
|
||||
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
|
||||
* Updated options.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.adaptOptions = function(options) {
|
||||
FeatureFormat.prototype.adaptOptions = function(options) {
|
||||
return _ol_obj_.assign({
|
||||
dataProjection: this.defaultDataProjection,
|
||||
featureProjection: this.defaultFeatureProjection
|
||||
@@ -76,7 +76,7 @@ _ol_format_Feature_.prototype.adaptOptions = function(options) {
|
||||
* Get the extent from the source of the last {@link readFeatures} call.
|
||||
* @return {ol.Extent} Tile extent.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.getLastExtent = function() {
|
||||
FeatureFormat.prototype.getLastExtent = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ _ol_format_Feature_.prototype.getLastExtent = function() {
|
||||
* @abstract
|
||||
* @return {ol.format.FormatType} Format.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.getType = function() {};
|
||||
FeatureFormat.prototype.getType = function() {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ _ol_format_Feature_.prototype.getType = function() {};
|
||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
|
||||
FeatureFormat.prototype.readFeature = function(source, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ _ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
|
||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
|
||||
FeatureFormat.prototype.readFeatures = function(source, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,7 @@ _ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
|
||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
|
||||
FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ _ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.readProjection = function(source) {};
|
||||
FeatureFormat.prototype.readProjection = function(source) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ _ol_format_Feature_.prototype.readProjection = function(source) {};
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
|
||||
FeatureFormat.prototype.writeFeature = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,7 @@ _ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {};
|
||||
FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -161,7 +161,7 @@ _ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {}
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
_ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {};
|
||||
FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ _ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {}
|
||||
* @return {ol.geom.Geometry|ol.Extent} Transformed geometry.
|
||||
* @protected
|
||||
*/
|
||||
_ol_format_Feature_.transformWithOptions = function(
|
||||
FeatureFormat.transformWithOptions = function(
|
||||
geometry, write, opt_options) {
|
||||
var featureProjection = opt_options ?
|
||||
getProjection(opt_options.featureProjection) : null;
|
||||
@@ -219,4 +219,4 @@ _ol_format_Feature_.transformWithOptions = function(
|
||||
}
|
||||
return transformed;
|
||||
};
|
||||
export default _ol_format_Feature_;
|
||||
export default FeatureFormat;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/format/GML
|
||||
*/
|
||||
import _ol_format_GML3_ from '../format/GML3.js';
|
||||
import GML3 from '../format/GML3.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -15,7 +15,7 @@ import _ol_format_GML3_ from '../format/GML3.js';
|
||||
* @extends {ol.format.GMLBase}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_GML_ = _ol_format_GML3_;
|
||||
var _ol_format_GML_ = GML3;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import {createOrUpdate} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import GMLBase from '../format/GMLBase.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import {get as getProjection, transformExtent} from '../proj.js';
|
||||
@@ -21,25 +21,25 @@ import _ol_xml_ from '../xml.js';
|
||||
* @extends {ol.format.GMLBase}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_GML2_ = function(opt_options) {
|
||||
var GML2 = function(opt_options) {
|
||||
var options = /** @type {olx.format.GMLOptions} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
_ol_format_GMLBase_.call(this, options);
|
||||
GMLBase.call(this, options);
|
||||
|
||||
this.FEATURE_COLLECTION_PARSERS[_ol_format_GMLBase_.GMLNS][
|
||||
this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS][
|
||||
'featureMember'] =
|
||||
_ol_xml_.makeArrayPusher(_ol_format_GMLBase_.prototype.readFeaturesInternal);
|
||||
_ol_xml_.makeArrayPusher(GMLBase.prototype.readFeaturesInternal);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
this.schemaLocation = options.schemaLocation ?
|
||||
options.schemaLocation : _ol_format_GML2_.schemaLocation_;
|
||||
options.schemaLocation : GML2.schemaLocation_;
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_GML2_, _ol_format_GMLBase_);
|
||||
inherits(GML2, GMLBase);
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ inherits(_ol_format_GML2_, _ol_format_GMLBase_);
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
|
||||
GML2.schemaLocation_ = GMLBase.GMLNS +
|
||||
' http://schemas.opengis.net/gml/2.1.2/feature.xsd';
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ _ol_format_GML2_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
_ol_format_GML2_.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
||||
GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
|
||||
var containerSrs = context['srsName'];
|
||||
@@ -92,7 +92,7 @@ _ol_format_GML2_.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.Extent|undefined} Envelope.
|
||||
*/
|
||||
_ol_format_GML2_.prototype.readBox_ = function(node, objectStack) {
|
||||
GML2.prototype.readBox_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
|
||||
this.BOX_PARSERS_, node, objectStack, this);
|
||||
@@ -107,7 +107,7 @@ _ol_format_GML2_.prototype.readBox_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
@@ -124,7 +124,7 @@ _ol_format_GML2_.prototype.innerBoundaryIsParser_ = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
@@ -141,10 +141,10 @@ _ol_format_GML2_.prototype.outerBoundaryIsParser_ = function(node, objectStack)
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'coordinates': _ol_xml_.makeReplacer(
|
||||
_ol_format_GML2_.prototype.readFlatCoordinates_)
|
||||
GML2.prototype.readFlatCoordinates_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,10 +154,10 @@ _ol_format_GML2_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'innerBoundaryIs': _ol_format_GML2_.prototype.innerBoundaryIsParser_,
|
||||
'outerBoundaryIs': _ol_format_GML2_.prototype.outerBoundaryIsParser_
|
||||
'innerBoundaryIs': GML2.prototype.innerBoundaryIsParser_,
|
||||
'outerBoundaryIs': GML2.prototype.outerBoundaryIsParser_
|
||||
}
|
||||
};
|
||||
|
||||
@@ -167,10 +167,10 @@ _ol_format_GML2_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.BOX_PARSERS_ = {
|
||||
GML2.prototype.BOX_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'coordinates': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML2_.prototype.readFlatCoordinates_)
|
||||
GML2.prototype.readFlatCoordinates_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -180,21 +180,21 @@ _ol_format_GML2_.prototype.BOX_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.GEOMETRY_PARSERS_ = {
|
||||
GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Point': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPoint),
|
||||
'Point': _ol_xml_.makeReplacer(GMLBase.prototype.readPoint),
|
||||
'MultiPoint': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiPoint),
|
||||
GMLBase.prototype.readMultiPoint),
|
||||
'LineString': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readLineString),
|
||||
GMLBase.prototype.readLineString),
|
||||
'MultiLineString': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiLineString),
|
||||
GMLBase.prototype.readMultiLineString),
|
||||
'LinearRing': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readLinearRing),
|
||||
'Polygon': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPolygon),
|
||||
GMLBase.prototype.readLinearRing),
|
||||
'Polygon': _ol_xml_.makeReplacer(GMLBase.prototype.readPolygon),
|
||||
'MultiPolygon': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiPolygon),
|
||||
'Box': _ol_xml_.makeReplacer(_ol_format_GML2_.prototype.readBox_)
|
||||
GMLBase.prototype.readMultiPolygon),
|
||||
'Box': _ol_xml_.makeReplacer(GML2.prototype.readBox_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -207,7 +207,7 @@ _ol_format_GML2_.prototype.GEOMETRY_PARSERS_ = {
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML2.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var multiSurface = context['multiSurface'];
|
||||
var surface = context['surface'];
|
||||
@@ -235,7 +235,7 @@ _ol_format_GML2_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectStack) {
|
||||
GML2.prototype.writeFeatureElement = function(node, feature, objectStack) {
|
||||
var fid = feature.getId();
|
||||
if (fid) {
|
||||
node.setAttribute('fid', fid);
|
||||
@@ -262,7 +262,7 @@ _ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
} else {
|
||||
if (!(key in context.serializers[featureNS])) {
|
||||
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeStringTextNode);
|
||||
XSD.writeStringTextNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ _ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||
var context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
var item = _ol_obj_.assign({}, context);
|
||||
item.node = node;
|
||||
@@ -296,10 +296,10 @@ _ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objec
|
||||
}
|
||||
} else {
|
||||
value =
|
||||
_ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||
FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||
}
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
(item), _ol_format_GML2_.GEOMETRY_SERIALIZERS_,
|
||||
(item), GML2.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -311,7 +311,7 @@ _ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objec
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (node.nodeName !== 'LineStringSegment' && srsName) {
|
||||
@@ -336,7 +336,7 @@ _ol_format_GML2_.prototype.writeCurveOrLineString_ = function(node, geometry, ob
|
||||
* @returns {Node} coordinates node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.createCoordinatesNode_ = function(namespaceURI) {
|
||||
GML2.prototype.createCoordinatesNode_ = function(namespaceURI) {
|
||||
var coordinates = _ol_xml_.createElementNS(namespaceURI, 'coordinates');
|
||||
coordinates.setAttribute('decimal', '.');
|
||||
coordinates.setAttribute('cs', ',');
|
||||
@@ -352,7 +352,7 @@ _ol_format_GML2_.prototype.createCoordinatesNode_ = function(namespaceURI) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack) {
|
||||
GML2.prototype.writeCoordinates_ = function(node, value, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -365,7 +365,7 @@ _ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack
|
||||
point = points[i];
|
||||
parts[i] = this.getCoords_(point, srsName, hasZ);
|
||||
}
|
||||
_ol_format_XSD_.writeStringTextNode(node, parts.join(' '));
|
||||
XSD.writeStringTextNode(node, parts.join(' '));
|
||||
};
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ _ol_format_GML2_.prototype.writeCoordinates_ = function(node, value, objectStack
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
||||
GML2.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI,
|
||||
'LineStringSegment');
|
||||
node.appendChild(child);
|
||||
@@ -389,7 +389,7 @@ _ol_format_GML2_.prototype.writeCurveSegments_ = function(node, line, objectStac
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -400,7 +400,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
|
||||
var rings = geometry.getLinearRings();
|
||||
_ol_xml_.pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
_ol_format_GML2_.RING_SERIALIZERS_,
|
||||
GML2.RING_SERIALIZERS_,
|
||||
this.RING_NODE_FACTORY_,
|
||||
rings, objectStack, undefined, this);
|
||||
} else if (node.nodeName === 'Surface') {
|
||||
@@ -419,7 +419,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML2.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var parentNode = context.node;
|
||||
var exteriorWritten = context['exteriorWritten'];
|
||||
@@ -437,7 +437,7 @@ _ol_format_GML2_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
||||
GML2.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI, 'PolygonPatch');
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
@@ -450,7 +450,7 @@ _ol_format_GML2_.prototype.writeSurfacePatches_ = function(node, polygon, object
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
GML2.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
var linearRing = _ol_xml_.createElementNS(node.namespaceURI, 'LinearRing');
|
||||
node.appendChild(linearRing);
|
||||
this.writeLinearRing_(linearRing, ring, objectStack);
|
||||
@@ -464,7 +464,7 @@ _ol_format_GML2_.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
* @return {string} The coords string.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
GML2.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
var axisOrientation = 'enu';
|
||||
if (opt_srsName) {
|
||||
axisOrientation = getProjection(opt_srsName).getAxisOrientation();
|
||||
@@ -488,7 +488,7 @@ _ol_format_GML2_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -498,7 +498,7 @@ _ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
|
||||
}
|
||||
var lines = geometry.getLineStrings();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, curve: curve},
|
||||
_ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
GML2.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -510,7 +510,7 @@ _ol_format_GML2_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -521,7 +521,7 @@ _ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
node.appendChild(coordinates);
|
||||
var point = geometry.getCoordinates();
|
||||
var coord = this.getCoords_(point, srsName, hasZ);
|
||||
_ol_format_XSD_.writeStringTextNode(coordinates, coord);
|
||||
XSD.writeStringTextNode(coordinates, coord);
|
||||
};
|
||||
|
||||
|
||||
@@ -531,7 +531,7 @@ _ol_format_GML2_.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
GML2.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
@@ -541,7 +541,7 @@ _ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
}
|
||||
var points = geometry.getPoints();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName},
|
||||
_ol_format_GML2_.POINTMEMBER_SERIALIZERS_,
|
||||
GML2.POINTMEMBER_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('pointMember'), points,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -553,7 +553,7 @@ _ol_format_GML2_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writePointMember_ = function(node, point, objectStack) {
|
||||
GML2.prototype.writePointMember_ = function(node, point, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI, 'Point');
|
||||
node.appendChild(child);
|
||||
this.writePoint_(child, point, objectStack);
|
||||
@@ -566,7 +566,7 @@ _ol_format_GML2_.prototype.writePointMember_ = function(node, point, objectStack
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
|
||||
GML2.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
|
||||
var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
@@ -581,7 +581,7 @@ _ol_format_GML2_.prototype.writeLineStringOrCurveMember_ = function(node, line,
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -599,7 +599,7 @@ _ol_format_GML2_.prototype.writeLinearRing_ = function(node, geometry, objectSta
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -609,7 +609,7 @@ _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
|
||||
}
|
||||
var polygons = geometry.getPolygons();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, surface: surface},
|
||||
_ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
GML2.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -621,7 +621,7 @@ _ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
|
||||
GML2.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
|
||||
var child = this.GEOMETRY_NODE_FACTORY_(
|
||||
polygon, objectStack);
|
||||
if (child) {
|
||||
@@ -637,7 +637,7 @@ _ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
GML2.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -646,7 +646,7 @@ _ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
var keys = ['lowerCorner', 'upperCorner'];
|
||||
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
({node: node}), _ol_format_GML2_.ENVELOPE_SERIALIZERS_,
|
||||
({node: node}), GML2.ENVELOPE_SERIALIZERS_,
|
||||
_ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
objectStack, keys, this);
|
||||
@@ -658,31 +658,31 @@ _ol_format_GML2_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.GEOMETRY_SERIALIZERS_ = {
|
||||
GML2.GEOMETRY_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Curve': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeCurveOrLineString_),
|
||||
GML2.prototype.writeCurveOrLineString_),
|
||||
'MultiCurve': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeMultiCurveOrLineString_),
|
||||
'Point': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writePoint_),
|
||||
GML2.prototype.writeMultiCurveOrLineString_),
|
||||
'Point': _ol_xml_.makeChildAppender(GML2.prototype.writePoint_),
|
||||
'MultiPoint': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeMultiPoint_),
|
||||
GML2.prototype.writeMultiPoint_),
|
||||
'LineString': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeCurveOrLineString_),
|
||||
GML2.prototype.writeCurveOrLineString_),
|
||||
'MultiLineString': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeMultiCurveOrLineString_),
|
||||
GML2.prototype.writeMultiCurveOrLineString_),
|
||||
'LinearRing': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeLinearRing_),
|
||||
GML2.prototype.writeLinearRing_),
|
||||
'Polygon': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygon_),
|
||||
GML2.prototype.writeSurfaceOrPolygon_),
|
||||
'MultiPolygon': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_),
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon_),
|
||||
'Surface': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygon_),
|
||||
GML2.prototype.writeSurfaceOrPolygon_),
|
||||
'MultiSurface': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeMultiSurfaceOrPolygon_),
|
||||
GML2.prototype.writeMultiSurfaceOrPolygon_),
|
||||
'Envelope': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeEnvelope)
|
||||
GML2.prototype.writeEnvelope)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -691,10 +691,10 @@ _ol_format_GML2_.GEOMETRY_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.RING_SERIALIZERS_ = {
|
||||
GML2.RING_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'outerBoundaryIs': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writeRing_),
|
||||
'innerBoundaryIs': _ol_xml_.makeChildAppender(_ol_format_GML2_.prototype.writeRing_)
|
||||
'outerBoundaryIs': _ol_xml_.makeChildAppender(GML2.prototype.writeRing_),
|
||||
'innerBoundaryIs': _ol_xml_.makeChildAppender(GML2.prototype.writeRing_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -703,10 +703,10 @@ _ol_format_GML2_.RING_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.POINTMEMBER_SERIALIZERS_ = {
|
||||
GML2.POINTMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writePointMember_)
|
||||
GML2.prototype.writePointMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -715,12 +715,12 @@ _ol_format_GML2_.POINTMEMBER_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
GML2.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeLineStringOrCurveMember_),
|
||||
GML2.prototype.writeLineStringOrCurveMember_),
|
||||
'curveMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeLineStringOrCurveMember_)
|
||||
GML2.prototype.writeLineStringOrCurveMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -733,10 +733,10 @@ _ol_format_GML2_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML2.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
return _ol_xml_.createElementNS('http://www.opengis.net/gml',
|
||||
_ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
|
||||
GML2.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -744,7 +744,7 @@ _ol_format_GML2_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value,
|
||||
* @type {Object.<string, string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
GML2.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
'MultiLineString': 'lineStringMember',
|
||||
'MultiCurve': 'curveMember',
|
||||
'MultiPolygon': 'polygonMember',
|
||||
@@ -757,12 +757,12 @@ _ol_format_GML2_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
GML2.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_),
|
||||
GML2.prototype.writeSurfaceOrPolygonMember_),
|
||||
'polygonMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML2_.prototype.writeSurfaceOrPolygonMember_)
|
||||
GML2.prototype.writeSurfaceOrPolygonMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -771,10 +771,10 @@ _ol_format_GML2_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML2_.ENVELOPE_SERIALIZERS_ = {
|
||||
GML2.ENVELOPE_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
|
||||
'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
|
||||
}
|
||||
};
|
||||
export default _ol_format_GML2_;
|
||||
export default GML2;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {createOrUpdate} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import GMLBase from '../format/GMLBase.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
@@ -29,11 +29,11 @@ import _ol_xml_ from '../xml.js';
|
||||
* @extends {ol.format.GMLBase}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_GML3_ = function(opt_options) {
|
||||
var GML3 = function(opt_options) {
|
||||
var options = /** @type {olx.format.GMLOptions} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
_ol_format_GMLBase_.call(this, options);
|
||||
GMLBase.call(this, options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -65,7 +65,7 @@ var _ol_format_GML3_ = function(opt_options) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
this.schemaLocation = options.schemaLocation ?
|
||||
options.schemaLocation : _ol_format_GML3_.schemaLocation_;
|
||||
options.schemaLocation : GML3.schemaLocation_;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -76,7 +76,7 @@ var _ol_format_GML3_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_GML3_, _ol_format_GMLBase_);
|
||||
inherits(GML3, GMLBase);
|
||||
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ inherits(_ol_format_GML3_, _ol_format_GMLBase_);
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
|
||||
GML3.schemaLocation_ = GMLBase.GMLNS +
|
||||
' http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' +
|
||||
'1.0.0/gmlsf.xsd';
|
||||
|
||||
@@ -95,7 +95,7 @@ _ol_format_GML3_.schemaLocation_ = _ol_format_GMLBase_.GMLNS +
|
||||
* @private
|
||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||
GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||
/** @type {Array.<ol.geom.LineString>} */
|
||||
var lineStrings = _ol_xml_.pushParseAndPop([],
|
||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||
@@ -115,7 +115,7 @@ _ol_format_GML3_.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||
GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||
/** @type {Array.<ol.geom.Polygon>} */
|
||||
var polygons = _ol_xml_.pushParseAndPop([],
|
||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||
@@ -134,7 +134,7 @@ _ol_format_GML3_.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||
GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(this.CURVEMEMBER_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
|
||||
@@ -144,7 +144,7 @@ _ol_format_GML3_.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
||||
GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(this.SURFACEMEMBER_PARSERS_,
|
||||
node, objectStack, this);
|
||||
};
|
||||
@@ -156,7 +156,7 @@ _ol_format_GML3_.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readPatch_ = function(node, objectStack) {
|
||||
GML3.prototype.readPatch_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop([null],
|
||||
this.PATCHES_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
@@ -168,7 +168,7 @@ _ol_format_GML3_.prototype.readPatch_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readSegment_ = function(node, objectStack) {
|
||||
GML3.prototype.readSegment_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop([null],
|
||||
this.SEGMENTS_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
@@ -180,7 +180,7 @@ _ol_format_GML3_.prototype.readSegment_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||
GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
@@ -192,7 +192,7 @@ _ol_format_GML3_.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||
GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop([null],
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
|
||||
node, objectStack, this);
|
||||
@@ -204,7 +204,7 @@ _ol_format_GML3_.prototype.readLineStringSegment_ = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.interiorParser_ = function(node, objectStack) {
|
||||
GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
@@ -221,7 +221,7 @@ _ol_format_GML3_.prototype.interiorParser_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = _ol_xml_.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
@@ -239,7 +239,7 @@ _ol_format_GML3_.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) {
|
||||
GML3.prototype.readSurface_ = function(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var flatLinearRings = _ol_xml_.pushParseAndPop([null],
|
||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||
@@ -267,7 +267,7 @@ _ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.geom.LineString|undefined} LineString.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
|
||||
GML3.prototype.readCurve_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
|
||||
this.CURVE_PARSERS_, node, objectStack, this);
|
||||
@@ -287,7 +287,7 @@ _ol_format_GML3_.prototype.readCurve_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.Extent|undefined} Envelope.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readEnvelope_ = function(node, objectStack) {
|
||||
GML3.prototype.readEnvelope_ = function(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = _ol_xml_.pushParseAndPop([null],
|
||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||
@@ -303,7 +303,7 @@ _ol_format_GML3_.prototype.readEnvelope_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readFlatPos_ = function(node, objectStack) {
|
||||
GML3.prototype.readFlatPos_ = function(node, objectStack) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false);
|
||||
var re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||
/** @type {Array.<number>} */
|
||||
@@ -349,7 +349,7 @@ _ol_format_GML3_.prototype.readFlatPos_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
GML3.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
var context = objectStack[0];
|
||||
var containerSrs = context['srsName'];
|
||||
@@ -363,16 +363,16 @@ _ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
// The "dimension" attribute is from the GML 3.0.1 spec.
|
||||
var dim = 2;
|
||||
if (node.getAttribute('srsDimension')) {
|
||||
dim = _ol_format_XSD_.readNonNegativeIntegerString(
|
||||
dim = XSD.readNonNegativeIntegerString(
|
||||
node.getAttribute('srsDimension'));
|
||||
} else if (node.getAttribute('dimension')) {
|
||||
dim = _ol_format_XSD_.readNonNegativeIntegerString(
|
||||
dim = XSD.readNonNegativeIntegerString(
|
||||
node.getAttribute('dimension'));
|
||||
} else if (node.parentNode.getAttribute('srsDimension')) {
|
||||
dim = _ol_format_XSD_.readNonNegativeIntegerString(
|
||||
dim = XSD.readNonNegativeIntegerString(
|
||||
node.parentNode.getAttribute('srsDimension'));
|
||||
} else if (contextDimension) {
|
||||
dim = _ol_format_XSD_.readNonNegativeIntegerString(contextDimension);
|
||||
dim = XSD.readNonNegativeIntegerString(contextDimension);
|
||||
}
|
||||
var x, y, z;
|
||||
var flatCoordinates = [];
|
||||
@@ -395,10 +395,10 @@ _ol_format_GML3_.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pos': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readFlatPos_),
|
||||
'posList': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readFlatPosList_)
|
||||
'pos': _ol_xml_.makeReplacer(GML3.prototype.readFlatPos_),
|
||||
'posList': _ol_xml_.makeReplacer(GML3.prototype.readFlatPosList_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -408,10 +408,10 @@ _ol_format_GML3_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'interior': _ol_format_GML3_.prototype.interiorParser_,
|
||||
'exterior': _ol_format_GML3_.prototype.exteriorParser_
|
||||
'interior': GML3.prototype.interiorParser_,
|
||||
'exterior': GML3.prototype.exteriorParser_
|
||||
}
|
||||
};
|
||||
|
||||
@@ -421,27 +421,27 @@ _ol_format_GML3_.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.GEOMETRY_PARSERS_ = {
|
||||
GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Point': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPoint),
|
||||
'Point': _ol_xml_.makeReplacer(GMLBase.prototype.readPoint),
|
||||
'MultiPoint': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiPoint),
|
||||
GMLBase.prototype.readMultiPoint),
|
||||
'LineString': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readLineString),
|
||||
GMLBase.prototype.readLineString),
|
||||
'MultiLineString': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiLineString),
|
||||
GMLBase.prototype.readMultiLineString),
|
||||
'LinearRing': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readLinearRing),
|
||||
'Polygon': _ol_xml_.makeReplacer(_ol_format_GMLBase_.prototype.readPolygon),
|
||||
GMLBase.prototype.readLinearRing),
|
||||
'Polygon': _ol_xml_.makeReplacer(GMLBase.prototype.readPolygon),
|
||||
'MultiPolygon': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readMultiPolygon),
|
||||
'Surface': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readSurface_),
|
||||
GMLBase.prototype.readMultiPolygon),
|
||||
'Surface': _ol_xml_.makeReplacer(GML3.prototype.readSurface_),
|
||||
'MultiSurface': _ol_xml_.makeReplacer(
|
||||
_ol_format_GML3_.prototype.readMultiSurface_),
|
||||
'Curve': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readCurve_),
|
||||
GML3.prototype.readMultiSurface_),
|
||||
'Curve': _ol_xml_.makeReplacer(GML3.prototype.readCurve_),
|
||||
'MultiCurve': _ol_xml_.makeReplacer(
|
||||
_ol_format_GML3_.prototype.readMultiCurve_),
|
||||
'Envelope': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readEnvelope_)
|
||||
GML3.prototype.readMultiCurve_),
|
||||
'Envelope': _ol_xml_.makeReplacer(GML3.prototype.readEnvelope_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -451,12 +451,12 @@ _ol_format_GML3_.prototype.GEOMETRY_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.MULTICURVE_PARSERS_ = {
|
||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'curveMember': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.curveMemberParser_),
|
||||
GML3.prototype.curveMemberParser_),
|
||||
'curveMembers': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.curveMemberParser_)
|
||||
GML3.prototype.curveMemberParser_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -466,12 +466,12 @@ _ol_format_GML3_.prototype.MULTICURVE_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.MULTISURFACE_PARSERS_ = {
|
||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.surfaceMemberParser_),
|
||||
GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMembers': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.surfaceMemberParser_)
|
||||
GML3.prototype.surfaceMemberParser_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -481,11 +481,11 @@ _ol_format_GML3_.prototype.MULTISURFACE_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineString': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.readLineString),
|
||||
'Curve': _ol_xml_.makeArrayPusher(_ol_format_GML3_.prototype.readCurve_)
|
||||
GMLBase.prototype.readLineString),
|
||||
'Curve': _ol_xml_.makeArrayPusher(GML3.prototype.readCurve_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -495,10 +495,10 @@ _ol_format_GML3_.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Polygon': _ol_xml_.makeArrayPusher(_ol_format_GMLBase_.prototype.readPolygon),
|
||||
'Surface': _ol_xml_.makeArrayPusher(_ol_format_GML3_.prototype.readSurface_)
|
||||
'Polygon': _ol_xml_.makeArrayPusher(GMLBase.prototype.readPolygon),
|
||||
'Surface': _ol_xml_.makeArrayPusher(GML3.prototype.readSurface_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -508,9 +508,9 @@ _ol_format_GML3_.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.SURFACE_PARSERS_ = {
|
||||
GML3.prototype.SURFACE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'patches': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readPatch_)
|
||||
'patches': _ol_xml_.makeReplacer(GML3.prototype.readPatch_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -520,9 +520,9 @@ _ol_format_GML3_.prototype.SURFACE_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.CURVE_PARSERS_ = {
|
||||
GML3.prototype.CURVE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'segments': _ol_xml_.makeReplacer(_ol_format_GML3_.prototype.readSegment_)
|
||||
'segments': _ol_xml_.makeReplacer(GML3.prototype.readSegment_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -532,12 +532,12 @@ _ol_format_GML3_.prototype.CURVE_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.ENVELOPE_PARSERS_ = {
|
||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.readFlatPosList_),
|
||||
GML3.prototype.readFlatPosList_),
|
||||
'upperCorner': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GML3_.prototype.readFlatPosList_)
|
||||
GML3.prototype.readFlatPosList_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -547,10 +547,10 @@ _ol_format_GML3_.prototype.ENVELOPE_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.PATCHES_PARSERS_ = {
|
||||
GML3.prototype.PATCHES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'PolygonPatch': _ol_xml_.makeReplacer(
|
||||
_ol_format_GML3_.prototype.readPolygonPatch_)
|
||||
GML3.prototype.readPolygonPatch_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -560,10 +560,10 @@ _ol_format_GML3_.prototype.PATCHES_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.SEGMENTS_PARSERS_ = {
|
||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineStringSegment': _ol_xml_.makeReplacer(
|
||||
_ol_format_GML3_.prototype.readLineStringSegment_)
|
||||
GML3.prototype.readLineStringSegment_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -574,7 +574,7 @@ _ol_format_GML3_.prototype.SEGMENTS_PARSERS_ = {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
|
||||
GML3.prototype.writePos_ = function(node, value, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsDimension = hasZ ? 3 : 2;
|
||||
@@ -597,7 +597,7 @@ _ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
|
||||
var z = point[2] || 0;
|
||||
coords += ' ' + z;
|
||||
}
|
||||
_ol_format_XSD_.writeStringTextNode(node, coords);
|
||||
XSD.writeStringTextNode(node, coords);
|
||||
};
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ _ol_format_GML3_.prototype.writePos_ = function(node, value, objectStack) {
|
||||
* @return {string} The coords string.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
GML3.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
var axisOrientation = 'enu';
|
||||
if (opt_srsName) {
|
||||
axisOrientation = getProjection(opt_srsName).getAxisOrientation();
|
||||
@@ -632,7 +632,7 @@ _ol_format_GML3_.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
|
||||
GML3.prototype.writePosList_ = function(node, value, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsDimension = hasZ ? 3 : 2;
|
||||
@@ -647,7 +647,7 @@ _ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
|
||||
point = points[i];
|
||||
parts[i] = this.getCoords_(point, srsName, hasZ);
|
||||
}
|
||||
_ol_format_XSD_.writeStringTextNode(node, parts.join(' '));
|
||||
XSD.writeStringTextNode(node, parts.join(' '));
|
||||
};
|
||||
|
||||
|
||||
@@ -657,7 +657,7 @@ _ol_format_GML3_.prototype.writePosList_ = function(node, value, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -673,10 +673,10 @@ _ol_format_GML3_.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.ENVELOPE_SERIALIZERS_ = {
|
||||
GML3.ENVELOPE_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lowerCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'upperCorner': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
|
||||
'lowerCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'upperCorner': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -686,7 +686,7 @@ _ol_format_GML3_.ENVELOPE_SERIALIZERS_ = {
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -695,7 +695,7 @@ _ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
var keys = ['lowerCorner', 'upperCorner'];
|
||||
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
({node: node}), _ol_format_GML3_.ENVELOPE_SERIALIZERS_,
|
||||
({node: node}), GML3.ENVELOPE_SERIALIZERS_,
|
||||
_ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
objectStack, keys, this);
|
||||
@@ -708,7 +708,7 @@ _ol_format_GML3_.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (srsName) {
|
||||
@@ -727,7 +727,7 @@ _ol_format_GML3_.prototype.writeLinearRing_ = function(node, geometry, objectSta
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML3.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var parentNode = context.node;
|
||||
var exteriorWritten = context['exteriorWritten'];
|
||||
@@ -745,7 +745,7 @@ _ol_format_GML3_.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -756,7 +756,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
|
||||
var rings = geometry.getLinearRings();
|
||||
_ol_xml_.pushSerializeAndPop(
|
||||
{node: node, hasZ: hasZ, srsName: srsName},
|
||||
_ol_format_GML3_.RING_SERIALIZERS_,
|
||||
GML3.RING_SERIALIZERS_,
|
||||
this.RING_NODE_FACTORY_,
|
||||
rings, objectStack, undefined, this);
|
||||
} else if (node.nodeName === 'Surface') {
|
||||
@@ -774,7 +774,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygon_ = function(node, geometry, obj
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
if (node.nodeName !== 'LineStringSegment' && srsName) {
|
||||
@@ -800,7 +800,7 @@ _ol_format_GML3_.prototype.writeCurveOrLineString_ = function(node, geometry, ob
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -810,7 +810,7 @@ _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
|
||||
}
|
||||
var polygons = geometry.getPolygons();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, surface: surface},
|
||||
_ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, polygons,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -822,7 +822,7 @@ _ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
GML3.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var srsName = context['srsName'];
|
||||
@@ -832,7 +832,7 @@ _ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
}
|
||||
var points = geometry.getPoints();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName},
|
||||
_ol_format_GML3_.POINTMEMBER_SERIALIZERS_,
|
||||
GML3.POINTMEMBER_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('pointMember'), points,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -844,7 +844,7 @@ _ol_format_GML3_.prototype.writeMultiPoint_ = function(node, geometry,
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var hasZ = context['hasZ'];
|
||||
var srsName = context['srsName'];
|
||||
@@ -854,7 +854,7 @@ _ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
|
||||
}
|
||||
var lines = geometry.getLineStrings();
|
||||
_ol_xml_.pushSerializeAndPop({node: node, hasZ: hasZ, srsName: srsName, curve: curve},
|
||||
_ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_,
|
||||
this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, lines,
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -866,7 +866,7 @@ _ol_format_GML3_.prototype.writeMultiCurveOrLineString_ = function(node, geometr
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
GML3.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
var linearRing = _ol_xml_.createElementNS(node.namespaceURI, 'LinearRing');
|
||||
node.appendChild(linearRing);
|
||||
this.writeLinearRing_(linearRing, ring, objectStack);
|
||||
@@ -879,7 +879,7 @@ _ol_format_GML3_.prototype.writeRing_ = function(node, ring, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStack) {
|
||||
var child = this.GEOMETRY_NODE_FACTORY_(
|
||||
polygon, objectStack);
|
||||
if (child) {
|
||||
@@ -895,7 +895,7 @@ _ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writePointMember_ = function(node, point, objectStack) {
|
||||
GML3.prototype.writePointMember_ = function(node, point, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI, 'Point');
|
||||
node.appendChild(child);
|
||||
this.writePoint_(child, point, objectStack);
|
||||
@@ -908,7 +908,7 @@ _ol_format_GML3_.prototype.writePointMember_ = function(node, point, objectStack
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
|
||||
GML3.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack) {
|
||||
var child = this.GEOMETRY_NODE_FACTORY_(line, objectStack);
|
||||
if (child) {
|
||||
node.appendChild(child);
|
||||
@@ -923,7 +923,7 @@ _ol_format_GML3_.prototype.writeLineStringOrCurveMember_ = function(node, line,
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
||||
GML3.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI, 'PolygonPatch');
|
||||
node.appendChild(child);
|
||||
this.writeSurfaceOrPolygon_(child, polygon, objectStack);
|
||||
@@ -936,7 +936,7 @@ _ol_format_GML3_.prototype.writeSurfacePatches_ = function(node, polygon, object
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
||||
GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(node.namespaceURI,
|
||||
'LineStringSegment');
|
||||
node.appendChild(child);
|
||||
@@ -949,7 +949,7 @@ _ol_format_GML3_.prototype.writeCurveSegments_ = function(node, line, objectStac
|
||||
* @param {ol.geom.Geometry|ol.Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||
GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||
var context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
var item = _ol_obj_.assign({}, context);
|
||||
item.node = node;
|
||||
@@ -963,10 +963,10 @@ _ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objec
|
||||
}
|
||||
} else {
|
||||
value =
|
||||
_ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||
FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||
}
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
(item), _ol_format_GML3_.GEOMETRY_SERIALIZERS_,
|
||||
(item), GML3.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||
objectStack, undefined, this);
|
||||
};
|
||||
@@ -977,7 +977,7 @@ _ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objec
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectStack) {
|
||||
GML3.prototype.writeFeatureElement = function(node, feature, objectStack) {
|
||||
var fid = feature.getId();
|
||||
if (fid) {
|
||||
node.setAttribute('fid', fid);
|
||||
@@ -1004,7 +1004,7 @@ _ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
} else {
|
||||
if (!(key in context.serializers[featureNS])) {
|
||||
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeStringTextNode);
|
||||
XSD.writeStringTextNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1025,7 +1025,7 @@ _ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeFeatureMembers_ = function(node, features, objectStack) {
|
||||
GML3.prototype.writeFeatureMembers_ = function(node, features, objectStack) {
|
||||
var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var featureType = context['featureType'];
|
||||
var featureNS = context['featureNS'];
|
||||
@@ -1047,12 +1047,12 @@ _ol_format_GML3_.prototype.writeFeatureMembers_ = function(node, features, objec
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'surfaceMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_),
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_),
|
||||
'polygonMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygonMember_)
|
||||
GML3.prototype.writeSurfaceOrPolygonMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1061,10 +1061,10 @@ _ol_format_GML3_.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.POINTMEMBER_SERIALIZERS_ = {
|
||||
GML3.POINTMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writePointMember_)
|
||||
GML3.prototype.writePointMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1073,12 +1073,12 @@ _ol_format_GML3_.POINTMEMBER_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeLineStringOrCurveMember_),
|
||||
GML3.prototype.writeLineStringOrCurveMember_),
|
||||
'curveMember': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeLineStringOrCurveMember_)
|
||||
GML3.prototype.writeLineStringOrCurveMember_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1087,10 +1087,10 @@ _ol_format_GML3_.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.RING_SERIALIZERS_ = {
|
||||
GML3.RING_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'exterior': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writeRing_),
|
||||
'interior': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writeRing_)
|
||||
'exterior': _ol_xml_.makeChildAppender(GML3.prototype.writeRing_),
|
||||
'interior': _ol_xml_.makeChildAppender(GML3.prototype.writeRing_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1099,31 +1099,31 @@ _ol_format_GML3_.RING_SERIALIZERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.GEOMETRY_SERIALIZERS_ = {
|
||||
GML3.GEOMETRY_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Curve': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeCurveOrLineString_),
|
||||
GML3.prototype.writeCurveOrLineString_),
|
||||
'MultiCurve': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeMultiCurveOrLineString_),
|
||||
'Point': _ol_xml_.makeChildAppender(_ol_format_GML3_.prototype.writePoint_),
|
||||
GML3.prototype.writeMultiCurveOrLineString_),
|
||||
'Point': _ol_xml_.makeChildAppender(GML3.prototype.writePoint_),
|
||||
'MultiPoint': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeMultiPoint_),
|
||||
GML3.prototype.writeMultiPoint_),
|
||||
'LineString': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeCurveOrLineString_),
|
||||
GML3.prototype.writeCurveOrLineString_),
|
||||
'MultiLineString': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeMultiCurveOrLineString_),
|
||||
GML3.prototype.writeMultiCurveOrLineString_),
|
||||
'LinearRing': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeLinearRing_),
|
||||
GML3.prototype.writeLinearRing_),
|
||||
'Polygon': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygon_),
|
||||
GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'MultiPolygon': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_),
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_),
|
||||
'Surface': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeSurfaceOrPolygon_),
|
||||
GML3.prototype.writeSurfaceOrPolygon_),
|
||||
'MultiSurface': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeMultiSurfaceOrPolygon_),
|
||||
GML3.prototype.writeMultiSurfaceOrPolygon_),
|
||||
'Envelope': _ol_xml_.makeChildAppender(
|
||||
_ol_format_GML3_.prototype.writeEnvelope)
|
||||
GML3.prototype.writeEnvelope)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1133,7 +1133,7 @@ _ol_format_GML3_.GEOMETRY_SERIALIZERS_ = {
|
||||
* @type {Object.<string, string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
'MultiLineString': 'lineStringMember',
|
||||
'MultiCurve': 'curveMember',
|
||||
'MultiPolygon': 'polygonMember',
|
||||
@@ -1149,10 +1149,10 @@ _ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_ = {
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML3.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
return _ol_xml_.createElementNS('http://www.opengis.net/gml',
|
||||
_ol_format_GML3_.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
|
||||
GML3.MULTIGEOMETRY_TO_MEMBER_NODENAME_[parentNode.nodeName]);
|
||||
};
|
||||
|
||||
|
||||
@@ -1164,7 +1164,7 @@ _ol_format_GML3_.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function(value,
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GML3_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var multiSurface = context['multiSurface'];
|
||||
var surface = context['surface'];
|
||||
@@ -1199,7 +1199,7 @@ _ol_format_GML3_.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
var geom = _ol_xml_.createElementNS('http://www.opengis.net/gml', 'geom');
|
||||
var context = {node: geom, hasZ: this.hasZ, srsName: this.srsName,
|
||||
@@ -1222,7 +1222,7 @@ _ol_format_GML3_.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeFeatures;
|
||||
GML3.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1234,7 +1234,7 @@ _ol_format_GML3_.prototype.writeFeatures;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GML3_.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
GML3.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
var node = _ol_xml_.createElementNS('http://www.opengis.net/gml',
|
||||
'featureMembers');
|
||||
@@ -1256,4 +1256,4 @@ _ol_format_GML3_.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
this.writeFeatureMembers_(node, features, [context]);
|
||||
return node;
|
||||
};
|
||||
export default _ol_format_GML3_;
|
||||
export default GML3;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import XMLFeature from '../format/XMLFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import LinearRing from '../geom/LinearRing.js';
|
||||
@@ -36,7 +36,7 @@ import _ol_xml_ from '../xml.js';
|
||||
* Optional configuration object.
|
||||
* @extends {ol.format.XMLFeature}
|
||||
*/
|
||||
var _ol_format_GMLBase_ = function(opt_options) {
|
||||
var GMLBase = function(opt_options) {
|
||||
var options = /** @type {olx.format.GMLOptions} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
@@ -68,24 +68,24 @@ var _ol_format_GMLBase_ = function(opt_options) {
|
||||
* @type {Object.<string, Object.<string, Object>>}
|
||||
*/
|
||||
this.FEATURE_COLLECTION_PARSERS = {};
|
||||
this.FEATURE_COLLECTION_PARSERS[_ol_format_GMLBase_.GMLNS] = {
|
||||
this.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS] = {
|
||||
'featureMember': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readFeaturesInternal),
|
||||
GMLBase.prototype.readFeaturesInternal),
|
||||
'featureMembers': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readFeaturesInternal)
|
||||
GMLBase.prototype.readFeaturesInternal)
|
||||
};
|
||||
|
||||
_ol_format_XMLFeature_.call(this);
|
||||
XMLFeature.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_GMLBase_, _ol_format_XMLFeature_);
|
||||
inherits(GMLBase, XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_GMLBase_.GMLNS = 'http://www.opengis.net/gml';
|
||||
GMLBase.GMLNS = 'http://www.opengis.net/gml';
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,7 +100,7 @@ _ol_format_GMLBase_.GMLNS = 'http://www.opengis.net/gml';
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ _ol_format_GMLBase_.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<ol.Feature> | undefined} Features.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
var localName = node.localName;
|
||||
var features = null;
|
||||
if (localName == 'FeatureCollection') {
|
||||
@@ -196,7 +196,7 @@ _ol_format_GMLBase_.prototype.readFeaturesInternal = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.Geometry|undefined} Geometry.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack) {
|
||||
GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
||||
var context = /** @type {Object} */ (objectStack[0]);
|
||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
|
||||
@@ -205,7 +205,7 @@ _ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack)
|
||||
this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||
if (geometry) {
|
||||
return (
|
||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(geometry, false, context)
|
||||
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(geometry, false, context)
|
||||
);
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -218,10 +218,10 @@ _ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
|
||||
GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||
var n;
|
||||
var fid = node.getAttribute('fid') ||
|
||||
_ol_xml_.getAttributeNS(node, _ol_format_GMLBase_.GMLNS, 'id');
|
||||
_ol_xml_.getAttributeNS(node, GMLBase.GMLNS, 'id');
|
||||
var values = {}, geometryName;
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = n.localName;
|
||||
@@ -232,7 +232,7 @@ _ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
|
||||
(n.childNodes.length === 1 &&
|
||||
(n.firstChild.nodeType === 3 || n.firstChild.nodeType === 4))) {
|
||||
var value = _ol_xml_.getAllTextContent(n, false);
|
||||
if (_ol_format_GMLBase_.ONLY_WHITESPACE_RE_.test(value)) {
|
||||
if (GMLBase.ONLY_WHITESPACE_RE_.test(value)) {
|
||||
value = undefined;
|
||||
}
|
||||
values[localName] = value;
|
||||
@@ -260,7 +260,7 @@ _ol_format_GMLBase_.prototype.readFeatureElement = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.Point|undefined} Point.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
|
||||
GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||
var flatCoordinates =
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
@@ -276,7 +276,7 @@ _ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readMultiPoint = function(node, objectStack) {
|
||||
GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var coordinates = _ol_xml_.pushParseAndPop([],
|
||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||
@@ -293,7 +293,7 @@ _ol_format_GMLBase_.prototype.readMultiPoint = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readMultiLineString = function(node, objectStack) {
|
||||
GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
||||
/** @type {Array.<ol.geom.LineString>} */
|
||||
var lineStrings = _ol_xml_.pushParseAndPop([],
|
||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||
@@ -312,7 +312,7 @@ _ol_format_GMLBase_.prototype.readMultiLineString = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readMultiPolygon = function(node, objectStack) {
|
||||
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||
/** @type {Array.<ol.geom.Polygon>} */
|
||||
var polygons = _ol_xml_.pushParseAndPop([],
|
||||
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||
@@ -331,7 +331,7 @@ _ol_format_GMLBase_.prototype.readMultiPolygon = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||
GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(this.POINTMEMBER_PARSERS_,
|
||||
node, objectStack, this);
|
||||
};
|
||||
@@ -342,7 +342,7 @@ _ol_format_GMLBase_.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
||||
GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(this.LINESTRINGMEMBER_PARSERS_,
|
||||
node, objectStack, this);
|
||||
};
|
||||
@@ -353,7 +353,7 @@ _ol_format_GMLBase_.prototype.lineStringMemberParser_ = function(node, objectSta
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.polygonMemberParser_ = function(node, objectStack) {
|
||||
GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(this.POLYGONMEMBER_PARSERS_, node,
|
||||
objectStack, this);
|
||||
};
|
||||
@@ -364,7 +364,7 @@ _ol_format_GMLBase_.prototype.polygonMemberParser_ = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.LineString|undefined} LineString.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
|
||||
GMLBase.prototype.readLineString = function(node, objectStack) {
|
||||
var flatCoordinates =
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
@@ -383,7 +383,7 @@ _ol_format_GMLBase_.prototype.readLineString = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
||||
GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
||||
var ring = _ol_xml_.pushParseAndPop(null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
objectStack, this);
|
||||
@@ -400,7 +400,7 @@ _ol_format_GMLBase_.prototype.readFlatLinearRing_ = function(node, objectStack)
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
|
||||
GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
||||
var flatCoordinates =
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
@@ -418,7 +418,7 @@ _ol_format_GMLBase_.prototype.readLinearRing = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) {
|
||||
GMLBase.prototype.readPolygon = function(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var flatLinearRings = _ol_xml_.pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
@@ -446,7 +446,7 @@ _ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||
GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
objectStack, this);
|
||||
@@ -458,12 +458,12 @@ _ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_ = function(node, obje
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.MULTIPOINT_PARSERS_ = {
|
||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'pointMember': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.pointMemberParser_),
|
||||
GMLBase.prototype.pointMemberParser_),
|
||||
'pointMembers': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.pointMemberParser_)
|
||||
GMLBase.prototype.pointMemberParser_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -473,12 +473,12 @@ _ol_format_GMLBase_.prototype.MULTIPOINT_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'lineStringMember': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.lineStringMemberParser_),
|
||||
GMLBase.prototype.lineStringMemberParser_),
|
||||
'lineStringMembers': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.lineStringMemberParser_)
|
||||
GMLBase.prototype.lineStringMemberParser_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -488,12 +488,12 @@ _ol_format_GMLBase_.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'polygonMember': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.polygonMemberParser_),
|
||||
GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMembers': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.polygonMemberParser_)
|
||||
GMLBase.prototype.polygonMemberParser_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -503,10 +503,10 @@ _ol_format_GMLBase_.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.POINTMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Point': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.readFlatCoordinatesFromNode_)
|
||||
GMLBase.prototype.readFlatCoordinatesFromNode_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -516,10 +516,10 @@ _ol_format_GMLBase_.prototype.POINTMEMBER_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LineString': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.readLineString)
|
||||
GMLBase.prototype.readLineString)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -529,10 +529,10 @@ _ol_format_GMLBase_.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'Polygon': _ol_xml_.makeArrayPusher(
|
||||
_ol_format_GMLBase_.prototype.readPolygon)
|
||||
GMLBase.prototype.readPolygon)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -542,10 +542,10 @@ _ol_format_GMLBase_.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @protected
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.RING_PARSERS = {
|
||||
GMLBase.prototype.RING_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'LinearRing': _ol_xml_.makeReplacer(
|
||||
_ol_format_GMLBase_.prototype.readFlatLinearRing_)
|
||||
GMLBase.prototype.readFlatLinearRing_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -553,7 +553,7 @@ _ol_format_GMLBase_.prototype.RING_PARSERS = {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readGeometryFromNode = function(node, opt_options) {
|
||||
GMLBase.prototype.readGeometryFromNode = function(node, opt_options) {
|
||||
var geometry = this.readGeometryElement(node,
|
||||
[this.getReadOptions(node, opt_options ? opt_options : {})]);
|
||||
return geometry ? geometry : null;
|
||||
@@ -569,13 +569,13 @@ _ol_format_GMLBase_.prototype.readGeometryFromNode = function(node, opt_options)
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFeatures;
|
||||
GMLBase.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var options = {
|
||||
featureType: this.featureType,
|
||||
featureNS: this.featureNS
|
||||
@@ -591,8 +591,8 @@ _ol_format_GMLBase_.prototype.readFeaturesFromNode = function(node, opt_options)
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GMLBase_.prototype.readProjectionFromNode = function(node) {
|
||||
GMLBase.prototype.readProjectionFromNode = function(node) {
|
||||
return getProjection(this.srsName ? this.srsName :
|
||||
node.firstElementChild.getAttribute('srsName'));
|
||||
};
|
||||
export default _ol_format_GMLBase_;
|
||||
export default GMLBase;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import XMLFeature from '../format/XMLFeature.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -23,11 +23,11 @@ import _ol_xml_ from '../xml.js';
|
||||
* @param {olx.format.GPXOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_GPX_ = function(opt_options) {
|
||||
var GPX = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_XMLFeature_.call(this);
|
||||
XMLFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -41,7 +41,7 @@ var _ol_format_GPX_ = function(opt_options) {
|
||||
this.readExtensions_ = options.readExtensions;
|
||||
};
|
||||
|
||||
inherits(_ol_format_GPX_, _ol_format_XMLFeature_);
|
||||
inherits(GPX, XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ inherits(_ol_format_GPX_, _ol_format_XMLFeature_);
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
_ol_format_GPX_.NAMESPACE_URIS_ = [
|
||||
GPX.NAMESPACE_URIS_ = [
|
||||
null,
|
||||
'http://www.topografix.com/GPX/1/0',
|
||||
'http://www.topografix.com/GPX/1/1'
|
||||
@@ -61,7 +61,7 @@ _ol_format_GPX_.NAMESPACE_URIS_ = [
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
|
||||
GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
|
||||
'http://www.topografix.com/GPX/1/1/gpx.xsd';
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ _ol_format_GPX_.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
|
||||
* @private
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
_ol_format_GPX_.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
|
||||
GPX.appendCoordinate_ = function(flatCoordinates, layoutOptions, node, values) {
|
||||
flatCoordinates.push(
|
||||
parseFloat(node.getAttribute('lon')),
|
||||
parseFloat(node.getAttribute('lat')));
|
||||
@@ -104,7 +104,7 @@ _ol_format_GPX_.appendCoordinate_ = function(flatCoordinates, layoutOptions, nod
|
||||
* @param {Array.<number>=} ends Ends.
|
||||
* @return {ol.geom.GeometryLayout} Layout.
|
||||
*/
|
||||
_ol_format_GPX_.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, ends) {
|
||||
GPX.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, ends) {
|
||||
var layout = GeometryLayout.XY;
|
||||
var stride = 2;
|
||||
if (layoutOptions.hasZ && layoutOptions.hasM) {
|
||||
@@ -145,13 +145,13 @@ _ol_format_GPX_.applyLayoutOptions_ = function(layoutOptions, flatCoordinates, e
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.parseLink_ = function(node, objectStack) {
|
||||
GPX.parseLink_ = function(node, objectStack) {
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var href = node.getAttribute('href');
|
||||
if (href !== null) {
|
||||
values['link'] = href;
|
||||
}
|
||||
_ol_xml_.parseNode(_ol_format_GPX_.LINK_PARSERS_, node, objectStack);
|
||||
_ol_xml_.parseNode(GPX.LINK_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ _ol_format_GPX_.parseLink_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.parseExtensions_ = function(node, objectStack) {
|
||||
GPX.parseExtensions_ = function(node, objectStack) {
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
values['extensionsNode_'] = node;
|
||||
};
|
||||
@@ -171,16 +171,16 @@ _ol_format_GPX_.parseExtensions_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.parseRtePt_ = function(node, objectStack) {
|
||||
GPX.parseRtePt_ = function(node, objectStack) {
|
||||
var values = _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_GPX_.RTEPT_PARSERS_, node, objectStack);
|
||||
{}, GPX.RTEPT_PARSERS_, node, objectStack);
|
||||
if (values) {
|
||||
var rteValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var flatCoordinates = /** @type {Array.<number>} */
|
||||
(rteValues['flatCoordinates']);
|
||||
var layoutOptions = /** @type {ol.LayoutOptions} */
|
||||
(rteValues['layoutOptions']);
|
||||
_ol_format_GPX_.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
|
||||
GPX.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -190,16 +190,16 @@ _ol_format_GPX_.parseRtePt_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.parseTrkPt_ = function(node, objectStack) {
|
||||
GPX.parseTrkPt_ = function(node, objectStack) {
|
||||
var values = _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_GPX_.TRKPT_PARSERS_, node, objectStack);
|
||||
{}, GPX.TRKPT_PARSERS_, node, objectStack);
|
||||
if (values) {
|
||||
var trkValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var flatCoordinates = /** @type {Array.<number>} */
|
||||
(trkValues['flatCoordinates']);
|
||||
var layoutOptions = /** @type {ol.LayoutOptions} */
|
||||
(trkValues['layoutOptions']);
|
||||
_ol_format_GPX_.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
|
||||
GPX.appendCoordinate_(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -209,9 +209,9 @@ _ol_format_GPX_.parseTrkPt_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.parseTrkSeg_ = function(node, objectStack) {
|
||||
GPX.parseTrkSeg_ = function(node, objectStack) {
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
_ol_xml_.parseNode(_ol_format_GPX_.TRKSEG_PARSERS_, node, objectStack);
|
||||
_ol_xml_.parseNode(GPX.TRKSEG_PARSERS_, node, objectStack);
|
||||
var flatCoordinates = /** @type {Array.<number>} */
|
||||
(values['flatCoordinates']);
|
||||
var ends = /** @type {Array.<number>} */ (values['ends']);
|
||||
@@ -225,12 +225,12 @@ _ol_format_GPX_.parseTrkSeg_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.Feature|undefined} Track.
|
||||
*/
|
||||
_ol_format_GPX_.readRte_ = function(node, objectStack) {
|
||||
GPX.readRte_ = function(node, objectStack) {
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
var values = _ol_xml_.pushParseAndPop({
|
||||
'flatCoordinates': [],
|
||||
'layoutOptions': {}
|
||||
}, _ol_format_GPX_.RTE_PARSERS_, node, objectStack);
|
||||
}, GPX.RTE_PARSERS_, node, objectStack);
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -239,10 +239,10 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
|
||||
delete values['flatCoordinates'];
|
||||
var layoutOptions = /** @type {ol.LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates);
|
||||
var layout = GPX.applyLayoutOptions_(layoutOptions, flatCoordinates);
|
||||
var geometry = new LineString(null);
|
||||
geometry.setFlatCoordinates(layout, flatCoordinates);
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
feature.setProperties(values);
|
||||
return feature;
|
||||
@@ -255,13 +255,13 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.Feature|undefined} Track.
|
||||
*/
|
||||
_ol_format_GPX_.readTrk_ = function(node, objectStack) {
|
||||
GPX.readTrk_ = function(node, objectStack) {
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
var values = _ol_xml_.pushParseAndPop({
|
||||
'flatCoordinates': [],
|
||||
'ends': [],
|
||||
'layoutOptions': {}
|
||||
}, _ol_format_GPX_.TRK_PARSERS_, node, objectStack);
|
||||
}, GPX.TRK_PARSERS_, node, objectStack);
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -272,10 +272,10 @@ _ol_format_GPX_.readTrk_ = function(node, objectStack) {
|
||||
delete values['ends'];
|
||||
var layoutOptions = /** @type {ol.LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
|
||||
var layout = GPX.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
|
||||
var geometry = new MultiLineString(null);
|
||||
geometry.setFlatCoordinates(layout, flatCoordinates, ends);
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
feature.setProperties(values);
|
||||
return feature;
|
||||
@@ -288,18 +288,18 @@ _ol_format_GPX_.readTrk_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {ol.Feature|undefined} Waypoint.
|
||||
*/
|
||||
_ol_format_GPX_.readWpt_ = function(node, objectStack) {
|
||||
GPX.readWpt_ = function(node, objectStack) {
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
var values = _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_GPX_.WPT_PARSERS_, node, objectStack);
|
||||
{}, GPX.WPT_PARSERS_, node, objectStack);
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
var layoutOptions = /** @type {ol.LayoutOptions} */ ({});
|
||||
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
|
||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
|
||||
var coordinates = GPX.appendCoordinate_([], layoutOptions, node, values);
|
||||
var layout = GPX.applyLayoutOptions_(layoutOptions, coordinates);
|
||||
var geometry = new Point(coordinates, layout);
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
feature.setProperties(values);
|
||||
return feature;
|
||||
@@ -311,10 +311,10 @@ _ol_format_GPX_.readWpt_ = function(node, objectStack) {
|
||||
* @type {Object.<string, function(Node, Array.<*>): (ol.Feature|undefined)>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.FEATURE_READER_ = {
|
||||
'rte': _ol_format_GPX_.readRte_,
|
||||
'trk': _ol_format_GPX_.readTrk_,
|
||||
'wpt': _ol_format_GPX_.readWpt_
|
||||
GPX.FEATURE_READER_ = {
|
||||
'rte': GPX.readRte_,
|
||||
'trk': GPX.readTrk_,
|
||||
'wpt': GPX.readWpt_
|
||||
};
|
||||
|
||||
|
||||
@@ -323,11 +323,11 @@ _ol_format_GPX_.FEATURE_READER_ = {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'rte': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readRte_),
|
||||
'trk': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readTrk_),
|
||||
'wpt': _ol_xml_.makeArrayPusher(_ol_format_GPX_.readWpt_)
|
||||
GPX.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'rte': _ol_xml_.makeArrayPusher(GPX.readRte_),
|
||||
'trk': _ol_xml_.makeArrayPusher(GPX.readTrk_),
|
||||
'wpt': _ol_xml_.makeArrayPusher(GPX.readWpt_)
|
||||
});
|
||||
|
||||
|
||||
@@ -336,12 +336,12 @@ _ol_format_GPX_.GPX_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
GPX.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'text':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkText'),
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkText'),
|
||||
'type':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString, 'linkType')
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readString, 'linkType')
|
||||
});
|
||||
|
||||
|
||||
@@ -350,18 +350,18 @@ _ol_format_GPX_.LINK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'link': _ol_format_GPX_.parseLink_,
|
||||
GPX.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'link': GPX.parseLink_,
|
||||
'number':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
|
||||
'extensions': _ol_format_GPX_.parseExtensions_,
|
||||
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'rtept': _ol_format_GPX_.parseRtePt_
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
|
||||
'extensions': GPX.parseExtensions_,
|
||||
'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'rtept': GPX.parseRtePt_
|
||||
});
|
||||
|
||||
|
||||
@@ -370,10 +370,10 @@ _ol_format_GPX_.RTE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime)
|
||||
GPX.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
|
||||
});
|
||||
|
||||
|
||||
@@ -382,18 +382,18 @@ _ol_format_GPX_.RTEPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'link': _ol_format_GPX_.parseLink_,
|
||||
GPX.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'link': GPX.parseLink_,
|
||||
'number':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
|
||||
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'extensions': _ol_format_GPX_.parseExtensions_,
|
||||
'trkseg': _ol_format_GPX_.parseTrkSeg_
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
|
||||
'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'extensions': GPX.parseExtensions_,
|
||||
'trkseg': GPX.parseTrkSeg_
|
||||
});
|
||||
|
||||
|
||||
@@ -402,9 +402,9 @@ _ol_format_GPX_.TRK_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'trkpt': _ol_format_GPX_.parseTrkPt_
|
||||
GPX.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'trkpt': GPX.parseTrkPt_
|
||||
});
|
||||
|
||||
|
||||
@@ -413,10 +413,10 @@ _ol_format_GPX_.TRKSEG_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime)
|
||||
GPX.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime)
|
||||
});
|
||||
|
||||
|
||||
@@ -425,30 +425,30 @@ _ol_format_GPX_.TRKPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDateTime),
|
||||
'magvar': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'geoidheight': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'link': _ol_format_GPX_.parseLink_,
|
||||
'sym': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'type': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'fix': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
GPX.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'time': _ol_xml_.makeObjectPropertySetter(XSD.readDateTime),
|
||||
'magvar': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'geoidheight': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'cmt': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'desc': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'src': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'link': GPX.parseLink_,
|
||||
'sym': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'type': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'fix': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'sat': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
'hdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'vdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
'pdop': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
XSD.readNonNegativeInteger),
|
||||
'hdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'vdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'pdop': _ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'ageofdgpsdata':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readDecimal),
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readDecimal),
|
||||
'dgpsid':
|
||||
_ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readNonNegativeInteger),
|
||||
'extensions': _ol_format_GPX_.parseExtensions_
|
||||
_ol_xml_.makeObjectPropertySetter(XSD.readNonNegativeInteger),
|
||||
'extensions': GPX.parseExtensions_
|
||||
});
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ _ol_format_GPX_.WPT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @param {Array.<ol.Feature>} features List of features.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.prototype.handleReadExtensions_ = function(features) {
|
||||
GPX.prototype.handleReadExtensions_ = function(features) {
|
||||
if (!features) {
|
||||
features = [];
|
||||
}
|
||||
@@ -482,17 +482,17 @@ _ol_format_GPX_.prototype.handleReadExtensions_ = function(features) {
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GPX_.prototype.readFeature;
|
||||
GPX.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GPX_.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
if (!_ol_array_.includes(_ol_format_GPX_.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
GPX.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
if (!_ol_array_.includes(GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return null;
|
||||
}
|
||||
var featureReader = _ol_format_GPX_.FEATURE_READER_[node.localName];
|
||||
var featureReader = GPX.FEATURE_READER_[node.localName];
|
||||
if (!featureReader) {
|
||||
return null;
|
||||
}
|
||||
@@ -516,19 +516,19 @@ _ol_format_GPX_.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GPX_.prototype.readFeatures;
|
||||
GPX.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GPX_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
if (!_ol_array_.includes(_ol_format_GPX_.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
if (!_ol_array_.includes(GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return [];
|
||||
}
|
||||
if (node.localName == 'gpx') {
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = _ol_xml_.pushParseAndPop([], _ol_format_GPX_.GPX_PARSERS_,
|
||||
var features = _ol_xml_.pushParseAndPop([], GPX.GPX_PARSERS_,
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
if (features) {
|
||||
this.handleReadExtensions_(features);
|
||||
@@ -549,7 +549,7 @@ _ol_format_GPX_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GPX_.prototype.readProjection;
|
||||
GPX.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
@@ -558,7 +558,7 @@ _ol_format_GPX_.prototype.readProjection;
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
|
||||
GPX.writeLink_ = function(node, value, objectStack) {
|
||||
node.setAttribute('href', value);
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var properties = context['properties'];
|
||||
@@ -567,8 +567,8 @@ _ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
|
||||
properties['linkType']
|
||||
];
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node}),
|
||||
_ol_format_GPX_.LINK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
link, objectStack, _ol_format_GPX_.LINK_SEQUENCE_);
|
||||
GPX.LINK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
link, objectStack, GPX.LINK_SEQUENCE_);
|
||||
};
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ _ol_format_GPX_.writeLink_ = function(node, value, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
GPX.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var parentNode = context.node;
|
||||
var namespaceURI = parentNode.namespaceURI;
|
||||
@@ -607,12 +607,12 @@ _ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
// pass
|
||||
}
|
||||
var orderedKeys = (node.nodeName == 'rtept') ?
|
||||
_ol_format_GPX_.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
|
||||
_ol_format_GPX_.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||
GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
|
||||
GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||
var values = _ol_xml_.makeSequence(properties, orderedKeys);
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
({node: node, 'properties': properties}),
|
||||
_ol_format_GPX_.WPT_TYPE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
GPX.WPT_TYPE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
};
|
||||
|
||||
@@ -623,22 +623,22 @@ _ol_format_GPX_.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeRte_ = function(node, feature, objectStack) {
|
||||
GPX.writeRte_ = function(node, feature, objectStack) {
|
||||
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
|
||||
var properties = feature.getProperties();
|
||||
var context = {node: node, 'properties': properties};
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {ol.geom.LineString} */
|
||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
||||
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||
context['geometryLayout'] = geometry.getLayout();
|
||||
properties['rtept'] = geometry.getCoordinates();
|
||||
}
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
var orderedKeys = _ol_format_GPX_.RTE_SEQUENCE_[parentNode.namespaceURI];
|
||||
var orderedKeys = GPX.RTE_SEQUENCE_[parentNode.namespaceURI];
|
||||
var values = _ol_xml_.makeSequence(properties, orderedKeys);
|
||||
_ol_xml_.pushSerializeAndPop(context,
|
||||
_ol_format_GPX_.RTE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
GPX.RTE_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
};
|
||||
|
||||
@@ -649,7 +649,7 @@ _ol_format_GPX_.writeRte_ = function(node, feature, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
|
||||
GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
|
||||
var properties = feature.getProperties();
|
||||
/** @type {ol.XmlNodeStackItem} */
|
||||
@@ -657,14 +657,14 @@ _ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {ol.geom.MultiLineString} */
|
||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
||||
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||
properties['trkseg'] = geometry.getLineStrings();
|
||||
}
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
var orderedKeys = _ol_format_GPX_.TRK_SEQUENCE_[parentNode.namespaceURI];
|
||||
var orderedKeys = GPX.TRK_SEQUENCE_[parentNode.namespaceURI];
|
||||
var values = _ol_xml_.makeSequence(properties, orderedKeys);
|
||||
_ol_xml_.pushSerializeAndPop(context,
|
||||
_ol_format_GPX_.TRK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
GPX.TRK_SERIALIZERS_, _ol_xml_.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
};
|
||||
|
||||
@@ -675,12 +675,12 @@ _ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeTrkSeg_ = function(node, lineString, objectStack) {
|
||||
GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
|
||||
/** @type {ol.XmlNodeStackItem} */
|
||||
var context = {node: node, 'geometryLayout': lineString.getLayout(),
|
||||
'properties': {}};
|
||||
_ol_xml_.pushSerializeAndPop(context,
|
||||
_ol_format_GPX_.TRKSEG_SERIALIZERS_, _ol_format_GPX_.TRKSEG_NODE_FACTORY_,
|
||||
GPX.TRKSEG_SERIALIZERS_, GPX.TRKSEG_NODE_FACTORY_,
|
||||
lineString.getCoordinates(), objectStack);
|
||||
};
|
||||
|
||||
@@ -691,16 +691,16 @@ _ol_format_GPX_.writeTrkSeg_ = function(node, lineString, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.writeWpt_ = function(node, feature, objectStack) {
|
||||
GPX.writeWpt_ = function(node, feature, objectStack) {
|
||||
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['properties'] = feature.getProperties();
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
geometry = /** @type {ol.geom.Point} */
|
||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
||||
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||
context['geometryLayout'] = geometry.getLayout();
|
||||
_ol_format_GPX_.writeWptType_(node, geometry.getCoordinates(), objectStack);
|
||||
GPX.writeWptType_(node, geometry.getCoordinates(), objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -710,17 +710,17 @@ _ol_format_GPX_.writeWpt_ = function(node, feature, objectStack) {
|
||||
* @type {Array.<string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.LINK_SEQUENCE_ = ['text', 'type'];
|
||||
GPX.LINK_SEQUENCE_ = ['text', 'type'];
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'text': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
|
||||
GPX.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'text': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
|
||||
});
|
||||
|
||||
|
||||
@@ -729,8 +729,8 @@ _ol_format_GPX_.LINK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, [
|
||||
GPX.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, [
|
||||
'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'rtept'
|
||||
]);
|
||||
|
||||
@@ -740,18 +740,18 @@ _ol_format_GPX_.RTE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
|
||||
GPX.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
|
||||
'number': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeNonNegativeIntegerTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
XSD.writeNonNegativeIntegerTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'rtept': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
|
||||
_ol_format_GPX_.writeWptType_))
|
||||
GPX.writeWptType_))
|
||||
});
|
||||
|
||||
|
||||
@@ -760,8 +760,8 @@ _ol_format_GPX_.RTE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, [
|
||||
GPX.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, [
|
||||
'ele', 'time'
|
||||
]);
|
||||
|
||||
@@ -771,8 +771,8 @@ _ol_format_GPX_.RTEPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, [
|
||||
GPX.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, [
|
||||
'name', 'cmt', 'desc', 'src', 'link', 'number', 'type', 'trkseg'
|
||||
]);
|
||||
|
||||
@@ -782,18 +782,18 @@ _ol_format_GPX_.TRK_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
|
||||
GPX.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
|
||||
'number': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeNonNegativeIntegerTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
XSD.writeNonNegativeIntegerTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'trkseg': _ol_xml_.makeArraySerializer(_ol_xml_.makeChildAppender(
|
||||
_ol_format_GPX_.writeTrkSeg_))
|
||||
GPX.writeTrkSeg_))
|
||||
});
|
||||
|
||||
|
||||
@@ -802,7 +802,7 @@ _ol_format_GPX_.TRK_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
|
||||
GPX.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
|
||||
|
||||
|
||||
/**
|
||||
@@ -810,9 +810,9 @@ _ol_format_GPX_.TRKSEG_NODE_FACTORY_ = _ol_xml_.makeSimpleNodeFactory('trkpt');
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'trkpt': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeWptType_)
|
||||
GPX.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'trkpt': _ol_xml_.makeChildAppender(GPX.writeWptType_)
|
||||
});
|
||||
|
||||
|
||||
@@ -821,8 +821,8 @@ _ol_format_GPX_.TRKSEG_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, [
|
||||
GPX.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, [
|
||||
'ele', 'time', 'magvar', 'geoidheight', 'name', 'cmt', 'desc', 'src',
|
||||
'link', 'sym', 'type', 'fix', 'sat', 'hdop', 'vdop', 'pdop',
|
||||
'ageofdgpsdata', 'dgpsid'
|
||||
@@ -833,30 +833,30 @@ _ol_format_GPX_.WPT_TYPE_SEQUENCE_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
|
||||
'time': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDateTimeTextNode),
|
||||
'magvar': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
|
||||
GPX.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'ele': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
|
||||
'time': _ol_xml_.makeChildAppender(XSD.writeDateTimeTextNode),
|
||||
'magvar': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
|
||||
'geoidheight': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeDecimalTextNode),
|
||||
'name': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeLink_),
|
||||
'sym': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
'fix': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode),
|
||||
XSD.writeDecimalTextNode),
|
||||
'name': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'cmt': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'desc': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'src': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'link': _ol_xml_.makeChildAppender(GPX.writeLink_),
|
||||
'sym': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'type': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'fix': _ol_xml_.makeChildAppender(XSD.writeStringTextNode),
|
||||
'sat': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeNonNegativeIntegerTextNode),
|
||||
'hdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
|
||||
'vdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
|
||||
'pdop': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeDecimalTextNode),
|
||||
XSD.writeNonNegativeIntegerTextNode),
|
||||
'hdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
|
||||
'vdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
|
||||
'pdop': _ol_xml_.makeChildAppender(XSD.writeDecimalTextNode),
|
||||
'ageofdgpsdata': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeDecimalTextNode),
|
||||
XSD.writeDecimalTextNode),
|
||||
'dgpsid': _ol_xml_.makeChildAppender(
|
||||
_ol_format_XSD_.writeNonNegativeIntegerTextNode)
|
||||
XSD.writeNonNegativeIntegerTextNode)
|
||||
});
|
||||
|
||||
|
||||
@@ -865,7 +865,7 @@ _ol_format_GPX_.WPT_TYPE_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_ = {
|
||||
GPX.GEOMETRY_TYPE_TO_NODENAME_ = {
|
||||
'Point': 'wpt',
|
||||
'LineString': 'rte',
|
||||
'MultiLineString': 'trk'
|
||||
@@ -880,10 +880,10 @@ _ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_ = {
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
var geometry = /** @type {ol.Feature} */ (value).getGeometry();
|
||||
if (geometry) {
|
||||
var nodeName = _ol_format_GPX_.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
|
||||
var nodeName = GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
|
||||
if (nodeName) {
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
return _ol_xml_.createElementNS(parentNode.namespaceURI, nodeName);
|
||||
@@ -897,11 +897,11 @@ _ol_format_GPX_.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_GPX_.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_GPX_.NAMESPACE_URIS_, {
|
||||
'rte': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeRte_),
|
||||
'trk': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeTrk_),
|
||||
'wpt': _ol_xml_.makeChildAppender(_ol_format_GPX_.writeWpt_)
|
||||
GPX.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
GPX.NAMESPACE_URIS_, {
|
||||
'rte': _ol_xml_.makeChildAppender(GPX.writeRte_),
|
||||
'trk': _ol_xml_.makeChildAppender(GPX.writeTrk_),
|
||||
'wpt': _ol_xml_.makeChildAppender(GPX.writeWpt_)
|
||||
});
|
||||
|
||||
|
||||
@@ -916,7 +916,7 @@ _ol_format_GPX_.GPX_SERIALIZERS_ = _ol_xml_.makeStructureNS(
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GPX_.prototype.writeFeatures;
|
||||
GPX.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
@@ -930,7 +930,7 @@ _ol_format_GPX_.prototype.writeFeatures;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GPX_.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
GPX.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
//FIXME Serialize metadata
|
||||
var gpx = _ol_xml_.createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');
|
||||
@@ -938,13 +938,13 @@ _ol_format_GPX_.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
var xmlSchemaInstanceUri = 'http://www.w3.org/2001/XMLSchema-instance';
|
||||
_ol_xml_.setAttributeNS(gpx, xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri);
|
||||
_ol_xml_.setAttributeNS(gpx, xmlSchemaInstanceUri, 'xsi:schemaLocation',
|
||||
_ol_format_GPX_.SCHEMA_LOCATION_);
|
||||
GPX.SCHEMA_LOCATION_);
|
||||
gpx.setAttribute('version', '1.1');
|
||||
gpx.setAttribute('creator', 'OpenLayers');
|
||||
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
({node: gpx}), _ol_format_GPX_.GPX_SERIALIZERS_,
|
||||
_ol_format_GPX_.GPX_NODE_FACTORY_, features, [opt_options]);
|
||||
({node: gpx}), GPX.GPX_SERIALIZERS_,
|
||||
GPX.GPX_NODE_FACTORY_, features, [opt_options]);
|
||||
return gpx;
|
||||
};
|
||||
export default _ol_format_GPX_;
|
||||
export default GPX;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import JSONFeature from '../format/JSONFeature.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -28,11 +28,11 @@ import {get as getProjection} from '../proj.js';
|
||||
* @param {olx.format.GeoJSONOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_GeoJSON_ = function(opt_options) {
|
||||
var GeoJSON = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_JSONFeature_.call(this);
|
||||
JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -62,7 +62,7 @@ var _ol_format_GeoJSON_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_);
|
||||
inherits(GeoJSON, JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,13 +71,13 @@ inherits(_ol_format_GeoJSON_, _ol_format_JSONFeature_);
|
||||
* @private
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) {
|
||||
GeoJSON.readGeometry_ = function(object, opt_options) {
|
||||
if (!object) {
|
||||
return null;
|
||||
}
|
||||
var geometryReader = _ol_format_GeoJSON_.GEOMETRY_READERS_[object.type];
|
||||
var geometryReader = GeoJSON.GEOMETRY_READERS_[object.type];
|
||||
return (
|
||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
||||
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||
geometryReader(object), false, opt_options)
|
||||
);
|
||||
};
|
||||
@@ -89,7 +89,7 @@ _ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) {
|
||||
* @private
|
||||
* @return {ol.geom.GeometryCollection} Geometry collection.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
|
||||
GeoJSON.readGeometryCollectionGeometry_ = function(
|
||||
object, opt_options) {
|
||||
var geometries = object.geometries.map(
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
|
||||
* @return {ol.geom.Geometry} geometry Geometry.
|
||||
*/
|
||||
function(geometry) {
|
||||
return _ol_format_GeoJSON_.readGeometry_(geometry, opt_options);
|
||||
return GeoJSON.readGeometry_(geometry, opt_options);
|
||||
});
|
||||
return new GeometryCollection(geometries);
|
||||
};
|
||||
@@ -108,7 +108,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
|
||||
* @private
|
||||
* @return {ol.geom.Point} Point.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readPointGeometry_ = function(object) {
|
||||
GeoJSON.readPointGeometry_ = function(object) {
|
||||
return new Point(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -118,7 +118,7 @@ _ol_format_GeoJSON_.readPointGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.LineString} LineString.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readLineStringGeometry_ = function(object) {
|
||||
GeoJSON.readLineStringGeometry_ = function(object) {
|
||||
return new LineString(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ _ol_format_GeoJSON_.readLineStringGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.MultiLineString} MultiLineString.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) {
|
||||
GeoJSON.readMultiLineStringGeometry_ = function(object) {
|
||||
return new MultiLineString(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -138,7 +138,7 @@ _ol_format_GeoJSON_.readMultiLineStringGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.MultiPoint} MultiPoint.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) {
|
||||
GeoJSON.readMultiPointGeometry_ = function(object) {
|
||||
return new MultiPoint(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -148,7 +148,7 @@ _ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.MultiPolygon} MultiPolygon.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||
GeoJSON.readMultiPolygonGeometry_ = function(object) {
|
||||
return new MultiPolygon(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ _ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {ol.geom.Polygon} Polygon.
|
||||
*/
|
||||
_ol_format_GeoJSON_.readPolygonGeometry_ = function(object) {
|
||||
GeoJSON.readPolygonGeometry_ = function(object) {
|
||||
return new Polygon(object.coordinates);
|
||||
};
|
||||
|
||||
@@ -169,10 +169,10 @@ _ol_format_GeoJSON_.readPolygonGeometry_ = function(object) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
|
||||
var geometryWriter = _ol_format_GeoJSON_.GEOMETRY_WRITERS_[geometry.getType()];
|
||||
GeoJSON.writeGeometry_ = function(geometry, opt_options) {
|
||||
var geometryWriter = GeoJSON.GEOMETRY_WRITERS_[geometry.getType()];
|
||||
return geometryWriter(/** @type {ol.geom.Geometry} */ (
|
||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
|
||||
FeatureFormat.transformWithOptions(geometry, true, opt_options)),
|
||||
opt_options);
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ _ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
|
||||
GeoJSON.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
|
||||
return /** @type {GeoJSONGeometryCollection} */ ({
|
||||
type: 'GeometryCollection',
|
||||
geometries: []
|
||||
@@ -196,12 +196,12 @@ _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function(
|
||||
GeoJSON.writeGeometryCollectionGeometry_ = function(
|
||||
geometry, opt_options) {
|
||||
var geometries = geometry.getGeometriesArray().map(function(geometry) {
|
||||
var options = _ol_obj_.assign({}, opt_options);
|
||||
delete options.featureProjection;
|
||||
return _ol_format_GeoJSON_.writeGeometry_(geometry, options);
|
||||
return GeoJSON.writeGeometry_(geometry, options);
|
||||
});
|
||||
return /** @type {GeoJSONGeometryCollection} */ ({
|
||||
type: 'GeometryCollection',
|
||||
@@ -216,7 +216,7 @@ _ol_format_GeoJSON_.writeGeometryCollectionGeometry_ = function(
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writeLineStringGeometry_ = function(geometry, opt_options) {
|
||||
return /** @type {GeoJSONGeometry} */ ({
|
||||
type: 'LineString',
|
||||
coordinates: geometry.getCoordinates()
|
||||
@@ -230,7 +230,7 @@ _ol_format_GeoJSON_.writeLineStringGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writeMultiLineStringGeometry_ = function(geometry, opt_options) {
|
||||
return /** @type {GeoJSONGeometry} */ ({
|
||||
type: 'MultiLineString',
|
||||
coordinates: geometry.getCoordinates()
|
||||
@@ -244,7 +244,7 @@ _ol_format_GeoJSON_.writeMultiLineStringGeometry_ = function(geometry, opt_optio
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writeMultiPointGeometry_ = function(geometry, opt_options) {
|
||||
return /** @type {GeoJSONGeometry} */ ({
|
||||
type: 'MultiPoint',
|
||||
coordinates: geometry.getCoordinates()
|
||||
@@ -258,7 +258,7 @@ _ol_format_GeoJSON_.writeMultiPointGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writeMultiPolygonGeometry_ = function(geometry, opt_options) {
|
||||
var right;
|
||||
if (opt_options) {
|
||||
right = opt_options.rightHanded;
|
||||
@@ -276,7 +276,7 @@ _ol_format_GeoJSON_.writeMultiPolygonGeometry_ = function(geometry, opt_options)
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writePointGeometry_ = function(geometry, opt_options) {
|
||||
return /** @type {GeoJSONGeometry} */ ({
|
||||
type: 'Point',
|
||||
coordinates: geometry.getCoordinates()
|
||||
@@ -290,7 +290,7 @@ _ol_format_GeoJSON_.writePointGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||
*/
|
||||
_ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
GeoJSON.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
var right;
|
||||
if (opt_options) {
|
||||
right = opt_options.rightHanded;
|
||||
@@ -307,14 +307,14 @@ _ol_format_GeoJSON_.writePolygonGeometry_ = function(geometry, opt_options) {
|
||||
* @private
|
||||
* @type {Object.<string, function(GeoJSONObject): ol.geom.Geometry>}
|
||||
*/
|
||||
_ol_format_GeoJSON_.GEOMETRY_READERS_ = {
|
||||
'Point': _ol_format_GeoJSON_.readPointGeometry_,
|
||||
'LineString': _ol_format_GeoJSON_.readLineStringGeometry_,
|
||||
'Polygon': _ol_format_GeoJSON_.readPolygonGeometry_,
|
||||
'MultiPoint': _ol_format_GeoJSON_.readMultiPointGeometry_,
|
||||
'MultiLineString': _ol_format_GeoJSON_.readMultiLineStringGeometry_,
|
||||
'MultiPolygon': _ol_format_GeoJSON_.readMultiPolygonGeometry_,
|
||||
'GeometryCollection': _ol_format_GeoJSON_.readGeometryCollectionGeometry_
|
||||
GeoJSON.GEOMETRY_READERS_ = {
|
||||
'Point': GeoJSON.readPointGeometry_,
|
||||
'LineString': GeoJSON.readLineStringGeometry_,
|
||||
'Polygon': GeoJSON.readPolygonGeometry_,
|
||||
'MultiPoint': GeoJSON.readMultiPointGeometry_,
|
||||
'MultiLineString': GeoJSON.readMultiLineStringGeometry_,
|
||||
'MultiPolygon': GeoJSON.readMultiPolygonGeometry_,
|
||||
'GeometryCollection': GeoJSON.readGeometryCollectionGeometry_
|
||||
};
|
||||
|
||||
|
||||
@@ -323,15 +323,15 @@ _ol_format_GeoJSON_.GEOMETRY_READERS_ = {
|
||||
* @private
|
||||
* @type {Object.<string, function(ol.geom.Geometry, olx.format.WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||
*/
|
||||
_ol_format_GeoJSON_.GEOMETRY_WRITERS_ = {
|
||||
'Point': _ol_format_GeoJSON_.writePointGeometry_,
|
||||
'LineString': _ol_format_GeoJSON_.writeLineStringGeometry_,
|
||||
'Polygon': _ol_format_GeoJSON_.writePolygonGeometry_,
|
||||
'MultiPoint': _ol_format_GeoJSON_.writeMultiPointGeometry_,
|
||||
'MultiLineString': _ol_format_GeoJSON_.writeMultiLineStringGeometry_,
|
||||
'MultiPolygon': _ol_format_GeoJSON_.writeMultiPolygonGeometry_,
|
||||
'GeometryCollection': _ol_format_GeoJSON_.writeGeometryCollectionGeometry_,
|
||||
'Circle': _ol_format_GeoJSON_.writeEmptyGeometryCollectionGeometry_
|
||||
GeoJSON.GEOMETRY_WRITERS_ = {
|
||||
'Point': GeoJSON.writePointGeometry_,
|
||||
'LineString': GeoJSON.writeLineStringGeometry_,
|
||||
'Polygon': GeoJSON.writePolygonGeometry_,
|
||||
'MultiPoint': GeoJSON.writeMultiPointGeometry_,
|
||||
'MultiLineString': GeoJSON.writeMultiLineStringGeometry_,
|
||||
'MultiPolygon': GeoJSON.writeMultiPolygonGeometry_,
|
||||
'GeometryCollection': GeoJSON.writeGeometryCollectionGeometry_,
|
||||
'Circle': GeoJSON.writeEmptyGeometryCollectionGeometry_
|
||||
};
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ _ol_format_GeoJSON_.GEOMETRY_WRITERS_ = {
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readFeature;
|
||||
GeoJSON.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
@@ -361,13 +361,13 @@ _ol_format_GeoJSON_.prototype.readFeature;
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readFeatures;
|
||||
GeoJSON.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
|
||||
GeoJSON.prototype.readFeatureFromObject = function(
|
||||
object, opt_options) {
|
||||
/**
|
||||
* @type {GeoJSONFeature}
|
||||
@@ -382,7 +382,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
|
||||
});
|
||||
}
|
||||
|
||||
var geometry = _ol_format_GeoJSON_.readGeometry_(geoJSONFeature.geometry, opt_options);
|
||||
var geometry = GeoJSON.readGeometry_(geoJSONFeature.geometry, opt_options);
|
||||
var feature = new _ol_Feature_();
|
||||
if (this.geometryName_) {
|
||||
feature.setGeometryName(this.geometryName_);
|
||||
@@ -403,7 +403,7 @@ _ol_format_GeoJSON_.prototype.readFeatureFromObject = function(
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readFeaturesFromObject = function(
|
||||
GeoJSON.prototype.readFeaturesFromObject = function(
|
||||
object, opt_options) {
|
||||
var geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
@@ -434,15 +434,15 @@ _ol_format_GeoJSON_.prototype.readFeaturesFromObject = function(
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readGeometry;
|
||||
GeoJSON.prototype.readGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readGeometryFromObject = function(
|
||||
GeoJSON.prototype.readGeometryFromObject = function(
|
||||
object, opt_options) {
|
||||
return _ol_format_GeoJSON_.readGeometry_(
|
||||
return GeoJSON.readGeometry_(
|
||||
/** @type {GeoJSONGeometry} */ (object), opt_options);
|
||||
};
|
||||
|
||||
@@ -455,13 +455,13 @@ _ol_format_GeoJSON_.prototype.readGeometryFromObject = function(
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readProjection;
|
||||
GeoJSON.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
GeoJSON.prototype.readProjectionFromObject = function(object) {
|
||||
var geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
var crs = geoJSONObject.crs;
|
||||
var projection;
|
||||
@@ -488,7 +488,7 @@ _ol_format_GeoJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeFeature;
|
||||
GeoJSON.prototype.writeFeature;
|
||||
|
||||
|
||||
/**
|
||||
@@ -500,7 +500,7 @@ _ol_format_GeoJSON_.prototype.writeFeature;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options) {
|
||||
GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
|
||||
var object = /** @type {GeoJSONFeature} */ ({
|
||||
@@ -513,7 +513,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
object.geometry =
|
||||
_ol_format_GeoJSON_.writeGeometry_(geometry, opt_options);
|
||||
GeoJSON.writeGeometry_(geometry, opt_options);
|
||||
} else {
|
||||
object.geometry = null;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ _ol_format_GeoJSON_.prototype.writeFeatureObject = function(feature, opt_options
|
||||
* @return {string} GeoJSON.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeFeatures;
|
||||
GeoJSON.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
@@ -549,7 +549,7 @@ _ol_format_GeoJSON_.prototype.writeFeatures;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_options) {
|
||||
GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
var objects = [];
|
||||
var i, ii;
|
||||
@@ -572,7 +572,7 @@ _ol_format_GeoJSON_.prototype.writeFeaturesObject = function(features, opt_optio
|
||||
* @return {string} GeoJSON.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeGeometry;
|
||||
GeoJSON.prototype.writeGeometry;
|
||||
|
||||
|
||||
/**
|
||||
@@ -584,9 +584,9 @@ _ol_format_GeoJSON_.prototype.writeGeometry;
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_GeoJSON_.prototype.writeGeometryObject = function(geometry,
|
||||
GeoJSON.prototype.writeGeometryObject = function(geometry,
|
||||
opt_options) {
|
||||
return _ol_format_GeoJSON_.writeGeometry_(geometry,
|
||||
return GeoJSON.writeGeometry_(geometry,
|
||||
this.adaptOptions(opt_options));
|
||||
};
|
||||
export default _ol_format_GeoJSON_;
|
||||
export default GeoJSON;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_IGCZ_ from '../format/IGCZ.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
@@ -19,11 +19,11 @@ import {get as getProjection} from '../proj.js';
|
||||
* @param {olx.format.IGCOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_IGC_ = function(opt_options) {
|
||||
var IGC = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -39,7 +39,7 @@ var _ol_format_IGC_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_IGC_, _ol_format_TextFeature_);
|
||||
inherits(IGC, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ inherits(_ol_format_IGC_, _ol_format_TextFeature_);
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_IGC_.B_RECORD_RE_ =
|
||||
IGC.B_RECORD_RE_ =
|
||||
/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ _ol_format_IGC_.B_RECORD_RE_ =
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
|
||||
IGC.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
|
||||
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ _ol_format_IGC_.H_RECORD_RE_ = /^H.([A-Z]{3}).*?:(.*)/;
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
|
||||
IGC.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ _ol_format_IGC_.HFDTE_RECORD_RE_ = /^HFDTE(\d{2})(\d{2})(\d{2})/;
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
|
||||
IGC.NEWLINE_RE_ = /\r\n|\r|\n/;
|
||||
|
||||
|
||||
/**
|
||||
@@ -86,15 +86,15 @@ _ol_format_IGC_.NEWLINE_RE_ = /\r\n|\r|\n/;
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readFeature;
|
||||
IGC.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
IGC.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
var altitudeMode = this.altitudeMode_;
|
||||
var lines = text.split(_ol_format_IGC_.NEWLINE_RE_);
|
||||
var lines = text.split(IGC.NEWLINE_RE_);
|
||||
/** @type {Object.<string, string>} */
|
||||
var properties = {};
|
||||
var flatCoordinates = [];
|
||||
@@ -107,7 +107,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
var line = lines[i];
|
||||
var m;
|
||||
if (line.charAt(0) == 'B') {
|
||||
m = _ol_format_IGC_.B_RECORD_RE_.exec(line);
|
||||
m = IGC.B_RECORD_RE_.exec(line);
|
||||
if (m) {
|
||||
var hour = parseInt(m[1], 10);
|
||||
var minute = parseInt(m[2], 10);
|
||||
@@ -141,13 +141,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
lastDateTime = dateTime;
|
||||
}
|
||||
} else if (line.charAt(0) == 'H') {
|
||||
m = _ol_format_IGC_.HFDTE_RECORD_RE_.exec(line);
|
||||
m = IGC.HFDTE_RECORD_RE_.exec(line);
|
||||
if (m) {
|
||||
day = parseInt(m[1], 10);
|
||||
month = parseInt(m[2], 10) - 1;
|
||||
year = 2000 + parseInt(m[3], 10);
|
||||
} else {
|
||||
m = _ol_format_IGC_.H_RECORD_RE_.exec(line);
|
||||
m = IGC.H_RECORD_RE_.exec(line);
|
||||
if (m) {
|
||||
properties[m[1]] = m[2].trim();
|
||||
}
|
||||
@@ -161,7 +161,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
|
||||
GeometryLayout.XYM : GeometryLayout.XYZM;
|
||||
lineString.setFlatCoordinates(layout, flatCoordinates);
|
||||
var feature = new _ol_Feature_(_ol_format_Feature_.transformWithOptions(
|
||||
var feature = new _ol_Feature_(FeatureFormat.transformWithOptions(
|
||||
lineString, false, opt_options));
|
||||
feature.setProperties(properties);
|
||||
return feature;
|
||||
@@ -178,13 +178,13 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readFeatures;
|
||||
IGC.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
IGC.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
var feature = this.readFeatureFromText(text, opt_options);
|
||||
if (feature) {
|
||||
return [feature];
|
||||
@@ -202,33 +202,33 @@ _ol_format_IGC_.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readProjection;
|
||||
IGC.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
IGC.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
IGC.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
IGC.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_IGC_.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
export default _ol_format_IGC_;
|
||||
IGC.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
export default IGC;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/format/JSONFeature
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
|
||||
/**
|
||||
@@ -15,11 +15,11 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
* @abstract
|
||||
* @extends {ol.format.Feature}
|
||||
*/
|
||||
var _ol_format_JSONFeature_ = function() {
|
||||
_ol_format_Feature_.call(this);
|
||||
var JSONFeature = function() {
|
||||
FeatureFormat.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_JSONFeature_, _ol_format_Feature_);
|
||||
inherits(JSONFeature, FeatureFormat);
|
||||
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ inherits(_ol_format_JSONFeature_, _ol_format_Feature_);
|
||||
* @private
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.getObject_ = function(source) {
|
||||
JSONFeature.prototype.getObject_ = function(source) {
|
||||
if (typeof source === 'string') {
|
||||
var object = JSON.parse(source);
|
||||
return object ? /** @type {Object} */ (object) : null;
|
||||
@@ -42,7 +42,7 @@ _ol_format_JSONFeature_.prototype.getObject_ = function(source) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.getType = function() {
|
||||
JSONFeature.prototype.getType = function() {
|
||||
return _ol_format_FormatType_.JSON;
|
||||
};
|
||||
|
||||
@@ -50,7 +50,7 @@ _ol_format_JSONFeature_.prototype.getType = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
JSONFeature.prototype.readFeature = function(source, opt_options) {
|
||||
return this.readFeatureFromObject(
|
||||
this.getObject_(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
@@ -59,7 +59,7 @@ _ol_format_JSONFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
JSONFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
return this.readFeaturesFromObject(
|
||||
this.getObject_(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
@@ -72,7 +72,7 @@ _ol_format_JSONFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readFeatureFromObject = function(object, opt_options) {};
|
||||
JSONFeature.prototype.readFeatureFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,13 +82,13 @@ _ol_format_JSONFeature_.prototype.readFeatureFromObject = function(object, opt_o
|
||||
* @protected
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readFeaturesFromObject = function(object, opt_options) {};
|
||||
JSONFeature.prototype.readFeaturesFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
JSONFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
return this.readGeometryFromObject(
|
||||
this.getObject_(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
@@ -101,13 +101,13 @@ _ol_format_JSONFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readGeometryFromObject = function(object, opt_options) {};
|
||||
JSONFeature.prototype.readGeometryFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readProjection = function(source) {
|
||||
JSONFeature.prototype.readProjection = function(source) {
|
||||
return this.readProjectionFromObject(this.getObject_(source));
|
||||
};
|
||||
|
||||
@@ -118,13 +118,13 @@ _ol_format_JSONFeature_.prototype.readProjection = function(source) {
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.readProjectionFromObject = function(object) {};
|
||||
JSONFeature.prototype.readProjectionFromObject = function(object) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeFeature = function(feature, opt_options) {
|
||||
JSONFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
|
||||
};
|
||||
|
||||
@@ -135,13 +135,13 @@ _ol_format_JSONFeature_.prototype.writeFeature = function(feature, opt_options)
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||
JSONFeature.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeFeatures = function(features, opt_options) {
|
||||
JSONFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
|
||||
};
|
||||
|
||||
@@ -152,13 +152,13 @@ _ol_format_JSONFeature_.prototype.writeFeatures = function(features, opt_options
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||
JSONFeature.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
|
||||
};
|
||||
|
||||
@@ -169,5 +169,5 @@ _ol_format_JSONFeature_.prototype.writeGeometry = function(geometry, opt_options
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
_ol_format_JSONFeature_.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||
export default _ol_format_JSONFeature_;
|
||||
JSONFeature.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||
export default JSONFeature;
|
||||
|
||||
1027
src/ol/format/KML.js
1027
src/ol/format/KML.js
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import PBF from 'pbf';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
@@ -30,9 +30,9 @@ import _ol_render_Feature_ from '../render/Feature.js';
|
||||
* @param {olx.format.MVTOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_MVT_ = function(opt_options) {
|
||||
var MVT = function(opt_options) {
|
||||
|
||||
_ol_format_Feature_.call(this);
|
||||
FeatureFormat.call(this);
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -79,14 +79,14 @@ var _ol_format_MVT_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_MVT_, _ol_format_Feature_);
|
||||
inherits(MVT, FeatureFormat);
|
||||
|
||||
|
||||
/**
|
||||
* Reader callbacks for parsing the PBF.
|
||||
* @type {Object.<string, function(number, Object, ol.ext.PBF)>}
|
||||
*/
|
||||
_ol_format_MVT_.pbfReaders_ = {
|
||||
MVT.pbfReaders_ = {
|
||||
layers: function(tag, layers, pbf) {
|
||||
if (tag === 3) {
|
||||
var layer = {
|
||||
@@ -95,7 +95,7 @@ _ol_format_MVT_.pbfReaders_ = {
|
||||
features: []
|
||||
};
|
||||
var end = pbf.readVarint() + pbf.pos;
|
||||
pbf.readFields(_ol_format_MVT_.pbfReaders_.layer, layer, end);
|
||||
pbf.readFields(MVT.pbfReaders_.layer, layer, end);
|
||||
layer.length = layer.features.length;
|
||||
if (layer.length) {
|
||||
layers[layer.name] = layer;
|
||||
@@ -157,7 +157,7 @@ _ol_format_MVT_.pbfReaders_ = {
|
||||
* @param {number} i Index of the feature in the raw layer's `features` array.
|
||||
* @return {Object} Raw feature.
|
||||
*/
|
||||
_ol_format_MVT_.readRawFeature_ = function(pbf, layer, i) {
|
||||
MVT.readRawFeature_ = function(pbf, layer, i) {
|
||||
pbf.pos = layer.features[i];
|
||||
var end = pbf.readVarint() + pbf.pos;
|
||||
|
||||
@@ -166,7 +166,7 @@ _ol_format_MVT_.readRawFeature_ = function(pbf, layer, i) {
|
||||
type: 0,
|
||||
properties: {}
|
||||
};
|
||||
pbf.readFields(_ol_format_MVT_.pbfReaders_.feature, feature, end);
|
||||
pbf.readFields(MVT.pbfReaders_.feature, feature, end);
|
||||
return feature;
|
||||
};
|
||||
|
||||
@@ -181,7 +181,7 @@ _ol_format_MVT_.readRawFeature_ = function(pbf, layer, i) {
|
||||
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
|
||||
* @param {Array.<number>} ends Array to store ends in.
|
||||
*/
|
||||
_ol_format_MVT_.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
|
||||
MVT.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
|
||||
pbf.pos = feature.geometry;
|
||||
|
||||
var end = pbf.readVarint() + pbf.pos;
|
||||
@@ -245,7 +245,7 @@ _ol_format_MVT_.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends)
|
||||
* geometry.
|
||||
* @return {ol.geom.GeometryType} The geometry type.
|
||||
*/
|
||||
_ol_format_MVT_.getGeometryType_ = function(type, numEnds) {
|
||||
MVT.getGeometryType_ = function(type, numEnds) {
|
||||
/** @type {ol.geom.GeometryType} */
|
||||
var geometryType;
|
||||
if (type === 1) {
|
||||
@@ -270,7 +270,7 @@ _ol_format_MVT_.getGeometryType_ = function(type, numEnds) {
|
||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||
* @return {ol.Feature|ol.render.Feature} Feature.
|
||||
*/
|
||||
_ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options) {
|
||||
MVT.prototype.createFeature_ = function(pbf, rawFeature, opt_options) {
|
||||
var type = rawFeature.type;
|
||||
if (type === 0) {
|
||||
return null;
|
||||
@@ -283,9 +283,9 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
||||
|
||||
var flatCoordinates = [];
|
||||
var ends = [];
|
||||
_ol_format_MVT_.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);
|
||||
MVT.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);
|
||||
|
||||
var geometryType = _ol_format_MVT_.getGeometryType_(type, ends.length);
|
||||
var geometryType = MVT.getGeometryType_(type, ends.length);
|
||||
|
||||
if (this.featureClass_ === _ol_render_Feature_) {
|
||||
feature = new this.featureClass_(geometryType, flatCoordinates, ends, values, id);
|
||||
@@ -322,7 +322,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
||||
if (this.geometryName_) {
|
||||
feature.setGeometryName(this.geometryName_);
|
||||
}
|
||||
var geometry = _ol_format_Feature_.transformWithOptions(geom, false, this.adaptOptions(opt_options));
|
||||
var geometry = FeatureFormat.transformWithOptions(geom, false, this.adaptOptions(opt_options));
|
||||
feature.setGeometry(geometry);
|
||||
feature.setId(id);
|
||||
feature.setProperties(values);
|
||||
@@ -336,7 +336,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_format_MVT_.prototype.getLastExtent = function() {
|
||||
MVT.prototype.getLastExtent = function() {
|
||||
return this.extent_;
|
||||
};
|
||||
|
||||
@@ -344,7 +344,7 @@ _ol_format_MVT_.prototype.getLastExtent = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_MVT_.prototype.getType = function() {
|
||||
MVT.prototype.getType = function() {
|
||||
return _ol_format_FormatType_.ARRAY_BUFFER;
|
||||
};
|
||||
|
||||
@@ -353,11 +353,11 @@ _ol_format_MVT_.prototype.getType = function() {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_format_MVT_.prototype.readFeatures = function(source, opt_options) {
|
||||
MVT.prototype.readFeatures = function(source, opt_options) {
|
||||
var layers = this.layers_;
|
||||
|
||||
var pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
||||
var pbfLayers = pbf.readFields(_ol_format_MVT_.pbfReaders_.layers, {});
|
||||
var pbfLayers = pbf.readFields(MVT.pbfReaders_.layers, {});
|
||||
/** @type {Array.<ol.Feature|ol.render.Feature>} */
|
||||
var features = [];
|
||||
var pbfLayer;
|
||||
@@ -369,7 +369,7 @@ _ol_format_MVT_.prototype.readFeatures = function(source, opt_options) {
|
||||
|
||||
var rawFeature;
|
||||
for (var i = 0, ii = pbfLayer.length; i < ii; ++i) {
|
||||
rawFeature = _ol_format_MVT_.readRawFeature_(pbf, pbfLayer, i);
|
||||
rawFeature = MVT.readRawFeature_(pbf, pbfLayer, i);
|
||||
features.push(this.createFeature_(pbf, rawFeature));
|
||||
}
|
||||
this.extent_ = pbfLayer ? [0, 0, pbfLayer.extent, pbfLayer.extent] : null;
|
||||
@@ -383,7 +383,7 @@ _ol_format_MVT_.prototype.readFeatures = function(source, opt_options) {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_format_MVT_.prototype.readProjection = function(source) {
|
||||
MVT.prototype.readProjection = function(source) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -393,7 +393,7 @@ _ol_format_MVT_.prototype.readProjection = function(source) {
|
||||
* @param {Array.<string>} layers Layers.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_MVT_.prototype.setLayers = function(layers) {
|
||||
MVT.prototype.setLayers = function(layers) {
|
||||
this.layers_ = layers;
|
||||
};
|
||||
|
||||
@@ -402,33 +402,33 @@ _ol_format_MVT_.prototype.setLayers = function(layers) {
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_MVT_.prototype.readFeature = function() {};
|
||||
MVT.prototype.readFeature = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_MVT_.prototype.readGeometry = function() {};
|
||||
MVT.prototype.readGeometry = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_MVT_.prototype.writeFeature = function() {};
|
||||
MVT.prototype.writeFeature = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_MVT_.prototype.writeGeometry = function() {};
|
||||
MVT.prototype.writeGeometry = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_MVT_.prototype.writeFeatures = function() {};
|
||||
export default _ol_format_MVT_;
|
||||
MVT.prototype.writeFeatures = function() {};
|
||||
export default MVT;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import XMLFeature from '../format/XMLFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import Point from '../geom/Point.js';
|
||||
@@ -24,8 +24,8 @@ import _ol_xml_ from '../xml.js';
|
||||
* @extends {ol.format.XMLFeature}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_OSMXML_ = function() {
|
||||
_ol_format_XMLFeature_.call(this);
|
||||
var OSMXML = function() {
|
||||
XMLFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -33,7 +33,7 @@ var _ol_format_OSMXML_ = function() {
|
||||
this.defaultDataProjection = getProjection('EPSG:4326');
|
||||
};
|
||||
|
||||
inherits(_ol_format_OSMXML_, _ol_format_XMLFeature_);
|
||||
inherits(OSMXML, XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ inherits(_ol_format_OSMXML_, _ol_format_XMLFeature_);
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.readNode_ = function(node, objectStack) {
|
||||
OSMXML.readNode_ = function(node, objectStack) {
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var id = node.getAttribute('id');
|
||||
@@ -54,10 +54,10 @@ _ol_format_OSMXML_.readNode_ = function(node, objectStack) {
|
||||
|
||||
var values = _ol_xml_.pushParseAndPop({
|
||||
tags: {}
|
||||
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
|
||||
}, OSMXML.NODE_PARSERS_, node, objectStack);
|
||||
if (!_ol_obj_.isEmpty(values.tags)) {
|
||||
var geometry = new Point(coordinates);
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
feature.setId(id);
|
||||
feature.setProperties(values.tags);
|
||||
@@ -71,13 +71,13 @@ _ol_format_OSMXML_.readNode_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.readWay_ = function(node, objectStack) {
|
||||
OSMXML.readWay_ = function(node, objectStack) {
|
||||
var id = node.getAttribute('id');
|
||||
var values = _ol_xml_.pushParseAndPop({
|
||||
id: id,
|
||||
ndrefs: [],
|
||||
tags: {}
|
||||
}, _ol_format_OSMXML_.WAY_PARSERS_, node, objectStack);
|
||||
}, OSMXML.WAY_PARSERS_, node, objectStack);
|
||||
var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
state.ways.push(values);
|
||||
};
|
||||
@@ -88,7 +88,7 @@ _ol_format_OSMXML_.readWay_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.readNd_ = function(node, objectStack) {
|
||||
OSMXML.readNd_ = function(node, objectStack) {
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
values.ndrefs.push(node.getAttribute('ref'));
|
||||
};
|
||||
@@ -99,7 +99,7 @@ _ol_format_OSMXML_.readNd_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.readTag_ = function(node, objectStack) {
|
||||
OSMXML.readTag_ = function(node, objectStack) {
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
values.tags[node.getAttribute('k')] = node.getAttribute('v');
|
||||
};
|
||||
@@ -110,7 +110,7 @@ _ol_format_OSMXML_.readTag_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
_ol_format_OSMXML_.NAMESPACE_URIS_ = [
|
||||
OSMXML.NAMESPACE_URIS_ = [
|
||||
null
|
||||
];
|
||||
|
||||
@@ -120,10 +120,10 @@ _ol_format_OSMXML_.NAMESPACE_URIS_ = [
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.WAY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OSMXML_.NAMESPACE_URIS_, {
|
||||
'nd': _ol_format_OSMXML_.readNd_,
|
||||
'tag': _ol_format_OSMXML_.readTag_
|
||||
OSMXML.WAY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OSMXML.NAMESPACE_URIS_, {
|
||||
'nd': OSMXML.readNd_,
|
||||
'tag': OSMXML.readTag_
|
||||
});
|
||||
|
||||
|
||||
@@ -132,10 +132,10 @@ _ol_format_OSMXML_.WAY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OSMXML_.NAMESPACE_URIS_, {
|
||||
'node': _ol_format_OSMXML_.readNode_,
|
||||
'way': _ol_format_OSMXML_.readWay_
|
||||
OSMXML.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OSMXML.NAMESPACE_URIS_, {
|
||||
'node': OSMXML.readNode_,
|
||||
'way': OSMXML.readWay_
|
||||
});
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ _ol_format_OSMXML_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OSMXML_.NODE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OSMXML_.NAMESPACE_URIS_, {
|
||||
'tag': _ol_format_OSMXML_.readTag_
|
||||
OSMXML.NODE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OSMXML.NAMESPACE_URIS_, {
|
||||
'tag': OSMXML.readTag_
|
||||
});
|
||||
|
||||
|
||||
@@ -159,20 +159,20 @@ _ol_format_OSMXML_.NODE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.readFeatures;
|
||||
OSMXML.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var options = this.getReadOptions(node, opt_options);
|
||||
if (node.localName == 'osm') {
|
||||
var state = _ol_xml_.pushParseAndPop({
|
||||
nodes: {},
|
||||
ways: [],
|
||||
features: []
|
||||
}, _ol_format_OSMXML_.PARSERS_, node, [options]);
|
||||
}, OSMXML.PARSERS_, node, [options]);
|
||||
// parse nodes in ways
|
||||
for (var j = 0; j < state.ways.length; j++) {
|
||||
var values = /** @type {Object} */ (state.ways[j]);
|
||||
@@ -192,7 +192,7 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options)
|
||||
geometry = new LineString(null);
|
||||
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||
}
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
||||
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||
var feature = new _ol_Feature_(geometry);
|
||||
feature.setId(values.id);
|
||||
feature.setProperties(values.tags);
|
||||
@@ -214,26 +214,26 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options)
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.readProjection;
|
||||
OSMXML.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.writeFeatureNode = function(feature, opt_options) {};
|
||||
OSMXML.prototype.writeFeatureNode = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.writeFeaturesNode = function(features, opt_options) {};
|
||||
OSMXML.prototype.writeFeaturesNode = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OSMXML_.prototype.writeGeometryNode = function(geometry, opt_options) {};
|
||||
export default _ol_format_OSMXML_;
|
||||
OSMXML.prototype.writeGeometryNode = function(geometry, opt_options) {};
|
||||
export default OSMXML;
|
||||
|
||||
@@ -2,26 +2,26 @@
|
||||
* @module ol/format/OWS
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_format_XLink_ from '../format/XLink.js';
|
||||
import _ol_format_XML_ from '../format/XML.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import XLink from '../format/XLink.js';
|
||||
import XML from '../format/XML.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.format.XML}
|
||||
*/
|
||||
var _ol_format_OWS_ = function() {
|
||||
_ol_format_XML_.call(this);
|
||||
var OWS = function() {
|
||||
XML.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_OWS_, _ol_format_XML_);
|
||||
inherits(OWS, XML);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OWS_.prototype.readFromDocument = function(doc) {
|
||||
OWS.prototype.readFromDocument = function(doc) {
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFromNode(n);
|
||||
@@ -34,9 +34,9 @@ _ol_format_OWS_.prototype.readFromDocument = function(doc) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_OWS_.prototype.readFromNode = function(node) {
|
||||
OWS.prototype.readFromNode = function(node) {
|
||||
var owsObject = _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.PARSERS_, node, []);
|
||||
OWS.PARSERS_, node, []);
|
||||
return owsObject ? owsObject : null;
|
||||
};
|
||||
|
||||
@@ -47,9 +47,9 @@ _ol_format_OWS_.prototype.readFromNode = function(node) {
|
||||
* @private
|
||||
* @return {Object|undefined} The address.
|
||||
*/
|
||||
_ol_format_OWS_.readAddress_ = function(node, objectStack) {
|
||||
OWS.readAddress_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.ADDRESS_PARSERS_, node, objectStack);
|
||||
OWS.ADDRESS_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ _ol_format_OWS_.readAddress_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The values.
|
||||
*/
|
||||
_ol_format_OWS_.readAllowedValues_ = function(node, objectStack) {
|
||||
OWS.readAllowedValues_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.ALLOWED_VALUES_PARSERS_, node, objectStack);
|
||||
OWS.ALLOWED_VALUES_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -71,13 +71,13 @@ _ol_format_OWS_.readAllowedValues_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The constraint.
|
||||
*/
|
||||
_ol_format_OWS_.readConstraint_ = function(node, objectStack) {
|
||||
OWS.readConstraint_ = function(node, objectStack) {
|
||||
var name = node.getAttribute('name');
|
||||
if (!name) {
|
||||
return undefined;
|
||||
}
|
||||
return _ol_xml_.pushParseAndPop({'name': name},
|
||||
_ol_format_OWS_.CONSTRAINT_PARSERS_, node,
|
||||
OWS.CONSTRAINT_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
@@ -88,9 +88,9 @@ _ol_format_OWS_.readConstraint_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The contact info.
|
||||
*/
|
||||
_ol_format_OWS_.readContactInfo_ = function(node, objectStack) {
|
||||
OWS.readContactInfo_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.CONTACT_INFO_PARSERS_, node, objectStack);
|
||||
OWS.CONTACT_INFO_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -100,9 +100,9 @@ _ol_format_OWS_.readContactInfo_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The DCP.
|
||||
*/
|
||||
_ol_format_OWS_.readDcp_ = function(node, objectStack) {
|
||||
OWS.readDcp_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.DCP_PARSERS_, node, objectStack);
|
||||
OWS.DCP_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -112,13 +112,13 @@ _ol_format_OWS_.readDcp_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The GET object.
|
||||
*/
|
||||
_ol_format_OWS_.readGet_ = function(node, objectStack) {
|
||||
var href = _ol_format_XLink_.readHref(node);
|
||||
OWS.readGet_ = function(node, objectStack) {
|
||||
var href = XLink.readHref(node);
|
||||
if (!href) {
|
||||
return undefined;
|
||||
}
|
||||
return _ol_xml_.pushParseAndPop({'href': href},
|
||||
_ol_format_OWS_.REQUEST_METHOD_PARSERS_, node, objectStack);
|
||||
OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -128,8 +128,8 @@ _ol_format_OWS_.readGet_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The HTTP object.
|
||||
*/
|
||||
_ol_format_OWS_.readHttp_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({}, _ol_format_OWS_.HTTP_PARSERS_,
|
||||
OWS.readHttp_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({}, OWS.HTTP_PARSERS_,
|
||||
node, objectStack);
|
||||
};
|
||||
|
||||
@@ -140,10 +140,10 @@ _ol_format_OWS_.readHttp_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The operation.
|
||||
*/
|
||||
_ol_format_OWS_.readOperation_ = function(node, objectStack) {
|
||||
OWS.readOperation_ = function(node, objectStack) {
|
||||
var name = node.getAttribute('name');
|
||||
var value = _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.OPERATION_PARSERS_, node, objectStack);
|
||||
OWS.OPERATION_PARSERS_, node, objectStack);
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -159,10 +159,10 @@ _ol_format_OWS_.readOperation_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The operations metadata.
|
||||
*/
|
||||
_ol_format_OWS_.readOperationsMetadata_ = function(node,
|
||||
OWS.readOperationsMetadata_ = function(node,
|
||||
objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.OPERATIONS_METADATA_PARSERS_, node,
|
||||
OWS.OPERATIONS_METADATA_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
@@ -173,9 +173,9 @@ _ol_format_OWS_.readOperationsMetadata_ = function(node,
|
||||
* @private
|
||||
* @return {Object|undefined} The phone.
|
||||
*/
|
||||
_ol_format_OWS_.readPhone_ = function(node, objectStack) {
|
||||
OWS.readPhone_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop({},
|
||||
_ol_format_OWS_.PHONE_PARSERS_, node, objectStack);
|
||||
OWS.PHONE_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -185,10 +185,10 @@ _ol_format_OWS_.readPhone_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The service identification.
|
||||
*/
|
||||
_ol_format_OWS_.readServiceIdentification_ = function(node,
|
||||
OWS.readServiceIdentification_ = function(node,
|
||||
objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_OWS_.SERVICE_IDENTIFICATION_PARSERS_, node,
|
||||
{}, OWS.SERVICE_IDENTIFICATION_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
@@ -199,9 +199,9 @@ _ol_format_OWS_.readServiceIdentification_ = function(node,
|
||||
* @private
|
||||
* @return {Object|undefined} The service contact.
|
||||
*/
|
||||
_ol_format_OWS_.readServiceContact_ = function(node, objectStack) {
|
||||
OWS.readServiceContact_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_OWS_.SERVICE_CONTACT_PARSERS_, node,
|
||||
{}, OWS.SERVICE_CONTACT_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
@@ -212,9 +212,9 @@ _ol_format_OWS_.readServiceContact_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} The service provider.
|
||||
*/
|
||||
_ol_format_OWS_.readServiceProvider_ = function(node, objectStack) {
|
||||
OWS.readServiceProvider_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_OWS_.SERVICE_PROVIDER_PARSERS_, node,
|
||||
{}, OWS.SERVICE_PROVIDER_PARSERS_, node,
|
||||
objectStack);
|
||||
};
|
||||
|
||||
@@ -225,8 +225,8 @@ _ol_format_OWS_.readServiceProvider_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {string|undefined} The value.
|
||||
*/
|
||||
_ol_format_OWS_.readValue_ = function(node, objectStack) {
|
||||
return _ol_format_XSD_.readString(node);
|
||||
OWS.readValue_ = function(node, objectStack) {
|
||||
return XSD.readString(node);
|
||||
};
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ _ol_format_OWS_.readValue_ = function(node, objectStack) {
|
||||
* @type {Array.<string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.NAMESPACE_URIS_ = [
|
||||
OWS.NAMESPACE_URIS_ = [
|
||||
null,
|
||||
'http://www.opengis.net/ows/1.1'
|
||||
];
|
||||
@@ -246,14 +246,14 @@ _ol_format_OWS_.NAMESPACE_URIS_ = [
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
OWS.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'ServiceIdentification': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readServiceIdentification_),
|
||||
OWS.readServiceIdentification_),
|
||||
'ServiceProvider': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readServiceProvider_),
|
||||
OWS.readServiceProvider_),
|
||||
'OperationsMetadata': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readOperationsMetadata_)
|
||||
OWS.readOperationsMetadata_)
|
||||
});
|
||||
|
||||
|
||||
@@ -262,17 +262,17 @@ _ol_format_OWS_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
OWS.ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'DeliveryPoint': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
'City': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'City': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'AdministrativeArea': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
'PostalCode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Country': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'PostalCode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Country': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'ElectronicMailAddress': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -281,9 +281,9 @@ _ol_format_OWS_.ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.ALLOWED_VALUES_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Value': _ol_xml_.makeObjectPropertyPusher(_ol_format_OWS_.readValue_)
|
||||
OWS.ALLOWED_VALUES_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Value': _ol_xml_.makeObjectPropertyPusher(OWS.readValue_)
|
||||
});
|
||||
|
||||
|
||||
@@ -292,10 +292,10 @@ _ol_format_OWS_.ALLOWED_VALUES_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.CONSTRAINT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
OWS.CONSTRAINT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'AllowedValues': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readAllowedValues_)
|
||||
OWS.readAllowedValues_)
|
||||
});
|
||||
|
||||
|
||||
@@ -304,10 +304,10 @@ _ol_format_OWS_.CONSTRAINT_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.CONTACT_INFO_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Phone': _ol_xml_.makeObjectPropertySetter(_ol_format_OWS_.readPhone_),
|
||||
'Address': _ol_xml_.makeObjectPropertySetter(_ol_format_OWS_.readAddress_)
|
||||
OWS.CONTACT_INFO_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Phone': _ol_xml_.makeObjectPropertySetter(OWS.readPhone_),
|
||||
'Address': _ol_xml_.makeObjectPropertySetter(OWS.readAddress_)
|
||||
});
|
||||
|
||||
|
||||
@@ -316,9 +316,9 @@ _ol_format_OWS_.CONTACT_INFO_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.DCP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'HTTP': _ol_xml_.makeObjectPropertySetter(_ol_format_OWS_.readHttp_)
|
||||
OWS.DCP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'HTTP': _ol_xml_.makeObjectPropertySetter(OWS.readHttp_)
|
||||
});
|
||||
|
||||
|
||||
@@ -327,9 +327,9 @@ _ol_format_OWS_.DCP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Get': _ol_xml_.makeObjectPropertyPusher(_ol_format_OWS_.readGet_),
|
||||
OWS.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Get': _ol_xml_.makeObjectPropertyPusher(OWS.readGet_),
|
||||
'Post': undefined // TODO
|
||||
});
|
||||
|
||||
@@ -339,9 +339,9 @@ _ol_format_OWS_.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.OPERATION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'DCP': _ol_xml_.makeObjectPropertySetter(_ol_format_OWS_.readDcp_)
|
||||
OWS.OPERATION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'DCP': _ol_xml_.makeObjectPropertySetter(OWS.readDcp_)
|
||||
});
|
||||
|
||||
|
||||
@@ -350,9 +350,9 @@ _ol_format_OWS_.OPERATION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.OPERATIONS_METADATA_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Operation': _ol_format_OWS_.readOperation_
|
||||
OWS.OPERATIONS_METADATA_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Operation': OWS.readOperation_
|
||||
});
|
||||
|
||||
|
||||
@@ -361,10 +361,10 @@ _ol_format_OWS_.OPERATIONS_METADATA_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.PHONE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Voice': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Facsimile': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString)
|
||||
OWS.PHONE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Voice': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Facsimile': _ol_xml_.makeObjectPropertySetter(XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -373,10 +373,10 @@ _ol_format_OWS_.PHONE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.REQUEST_METHOD_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
OWS.REQUEST_METHOD_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Constraint': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_OWS_.readConstraint_)
|
||||
OWS.readConstraint_)
|
||||
});
|
||||
|
||||
|
||||
@@ -385,14 +385,14 @@ _ol_format_OWS_.REQUEST_METHOD_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.SERVICE_CONTACT_PARSERS_ =
|
||||
OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'IndividualName': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
'PositionName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'PositionName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'ContactInfo': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readContactInfo_)
|
||||
OWS.readContactInfo_)
|
||||
});
|
||||
|
||||
|
||||
@@ -401,16 +401,16 @@ _ol_format_OWS_.SERVICE_CONTACT_PARSERS_ =
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'AccessConstraints': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Fees': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'AccessConstraints': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Fees': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'ServiceTypeVersion': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
'ServiceType': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString)
|
||||
XSD.readString),
|
||||
'ServiceType': _ol_xml_.makeObjectPropertySetter(XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -419,12 +419,12 @@ _ol_format_OWS_.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_OWS_.SERVICE_PROVIDER_PARSERS_ =
|
||||
OWS.SERVICE_PROVIDER_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(
|
||||
_ol_format_OWS_.NAMESPACE_URIS_, {
|
||||
'ProviderName': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'ProviderSite': _ol_xml_.makeObjectPropertySetter(_ol_format_XLink_.readHref),
|
||||
OWS.NAMESPACE_URIS_, {
|
||||
'ProviderName': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'ProviderSite': _ol_xml_.makeObjectPropertySetter(XLink.readHref),
|
||||
'ServiceContact': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_OWS_.readServiceContact_)
|
||||
OWS.readServiceContact_)
|
||||
});
|
||||
export default _ol_format_OWS_;
|
||||
export default OWS;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||
@@ -24,11 +24,11 @@ import {get as getProjection} from '../proj.js';
|
||||
* Optional configuration object.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_Polyline_ = function(opt_options) {
|
||||
var Polyline = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -49,7 +49,7 @@ var _ol_format_Polyline_ = function(opt_options) {
|
||||
options.geometryLayout : GeometryLayout.XY;
|
||||
};
|
||||
|
||||
inherits(_ol_format_Polyline_, _ol_format_TextFeature_);
|
||||
inherits(Polyline, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ inherits(_ol_format_Polyline_, _ol_format_TextFeature_);
|
||||
* @return {string} The encoded string.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.encodeDeltas = function(numbers, stride, opt_factor) {
|
||||
Polyline.encodeDeltas = function(numbers, stride, opt_factor) {
|
||||
var factor = opt_factor ? opt_factor : 1e5;
|
||||
var d;
|
||||
|
||||
@@ -85,7 +85,7 @@ _ol_format_Polyline_.encodeDeltas = function(numbers, stride, opt_factor) {
|
||||
}
|
||||
}
|
||||
|
||||
return _ol_format_Polyline_.encodeFloats(numbers, factor);
|
||||
return Polyline.encodeFloats(numbers, factor);
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ _ol_format_Polyline_.encodeDeltas = function(numbers, stride, opt_factor) {
|
||||
* @return {Array.<number>} A list of n-dimensional points.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.decodeDeltas = function(encoded, stride, opt_factor) {
|
||||
Polyline.decodeDeltas = function(encoded, stride, opt_factor) {
|
||||
var factor = opt_factor ? opt_factor : 1e5;
|
||||
var d;
|
||||
|
||||
@@ -110,7 +110,7 @@ _ol_format_Polyline_.decodeDeltas = function(encoded, stride, opt_factor) {
|
||||
lastNumbers[d] = 0;
|
||||
}
|
||||
|
||||
var numbers = _ol_format_Polyline_.decodeFloats(encoded, factor);
|
||||
var numbers = Polyline.decodeFloats(encoded, factor);
|
||||
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii;) {
|
||||
@@ -137,14 +137,14 @@ _ol_format_Polyline_.decodeDeltas = function(encoded, stride, opt_factor) {
|
||||
* @return {string} The encoded string.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.encodeFloats = function(numbers, opt_factor) {
|
||||
Polyline.encodeFloats = function(numbers, opt_factor) {
|
||||
var factor = opt_factor ? opt_factor : 1e5;
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii; ++i) {
|
||||
numbers[i] = Math.round(numbers[i] * factor);
|
||||
}
|
||||
|
||||
return _ol_format_Polyline_.encodeSignedIntegers(numbers);
|
||||
return Polyline.encodeSignedIntegers(numbers);
|
||||
};
|
||||
|
||||
|
||||
@@ -157,9 +157,9 @@ _ol_format_Polyline_.encodeFloats = function(numbers, opt_factor) {
|
||||
* @return {Array.<number>} A list of floating point numbers.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.decodeFloats = function(encoded, opt_factor) {
|
||||
Polyline.decodeFloats = function(encoded, opt_factor) {
|
||||
var factor = opt_factor ? opt_factor : 1e5;
|
||||
var numbers = _ol_format_Polyline_.decodeSignedIntegers(encoded);
|
||||
var numbers = Polyline.decodeSignedIntegers(encoded);
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii; ++i) {
|
||||
numbers[i] /= factor;
|
||||
@@ -176,13 +176,13 @@ _ol_format_Polyline_.decodeFloats = function(encoded, opt_factor) {
|
||||
* @param {Array.<number>} numbers A list of signed integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
_ol_format_Polyline_.encodeSignedIntegers = function(numbers) {
|
||||
Polyline.encodeSignedIntegers = function(numbers) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii; ++i) {
|
||||
var num = numbers[i];
|
||||
numbers[i] = (num < 0) ? ~(num << 1) : (num << 1);
|
||||
}
|
||||
return _ol_format_Polyline_.encodeUnsignedIntegers(numbers);
|
||||
return Polyline.encodeUnsignedIntegers(numbers);
|
||||
};
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ _ol_format_Polyline_.encodeSignedIntegers = function(numbers) {
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of signed integers.
|
||||
*/
|
||||
_ol_format_Polyline_.decodeSignedIntegers = function(encoded) {
|
||||
var numbers = _ol_format_Polyline_.decodeUnsignedIntegers(encoded);
|
||||
Polyline.decodeSignedIntegers = function(encoded) {
|
||||
var numbers = Polyline.decodeUnsignedIntegers(encoded);
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii; ++i) {
|
||||
var num = numbers[i];
|
||||
@@ -209,11 +209,11 @@ _ol_format_Polyline_.decodeSignedIntegers = function(encoded) {
|
||||
* @param {Array.<number>} numbers A list of unsigned integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
_ol_format_Polyline_.encodeUnsignedIntegers = function(numbers) {
|
||||
Polyline.encodeUnsignedIntegers = function(numbers) {
|
||||
var encoded = '';
|
||||
var i, ii;
|
||||
for (i = 0, ii = numbers.length; i < ii; ++i) {
|
||||
encoded += _ol_format_Polyline_.encodeUnsignedInteger(numbers[i]);
|
||||
encoded += Polyline.encodeUnsignedInteger(numbers[i]);
|
||||
}
|
||||
return encoded;
|
||||
};
|
||||
@@ -225,7 +225,7 @@ _ol_format_Polyline_.encodeUnsignedIntegers = function(numbers) {
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of unsigned integers.
|
||||
*/
|
||||
_ol_format_Polyline_.decodeUnsignedIntegers = function(encoded) {
|
||||
Polyline.decodeUnsignedIntegers = function(encoded) {
|
||||
var numbers = [];
|
||||
var current = 0;
|
||||
var shift = 0;
|
||||
@@ -251,7 +251,7 @@ _ol_format_Polyline_.decodeUnsignedIntegers = function(encoded) {
|
||||
* @param {number} num Unsigned integer that should be encoded.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
_ol_format_Polyline_.encodeUnsignedInteger = function(num) {
|
||||
Polyline.encodeUnsignedInteger = function(num) {
|
||||
var value, encoded = '';
|
||||
while (num >= 0x20) {
|
||||
value = (0x20 | (num & 0x1f)) + 63;
|
||||
@@ -274,13 +274,13 @@ _ol_format_Polyline_.encodeUnsignedInteger = function(num) {
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readFeature;
|
||||
Polyline.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
Polyline.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
var geometry = this.readGeometryFromText(text, opt_options);
|
||||
return new _ol_Feature_(geometry);
|
||||
};
|
||||
@@ -296,13 +296,13 @@ _ol_format_Polyline_.prototype.readFeatureFromText = function(text, opt_options)
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readFeatures;
|
||||
Polyline.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
Polyline.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
var feature = this.readFeatureFromText(text, opt_options);
|
||||
return [feature];
|
||||
};
|
||||
@@ -317,15 +317,15 @@ _ol_format_Polyline_.prototype.readFeaturesFromText = function(text, opt_options
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readGeometry;
|
||||
Polyline.prototype.readGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
Polyline.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
var stride = SimpleGeometry.getStrideForLayout(this.geometryLayout_);
|
||||
var flatCoordinates = _ol_format_Polyline_.decodeDeltas(
|
||||
var flatCoordinates = Polyline.decodeDeltas(
|
||||
text, stride, this.factor_);
|
||||
_ol_geom_flat_flip_.flipXY(
|
||||
flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
||||
@@ -333,7 +333,7 @@ _ol_format_Polyline_.prototype.readGeometryFromText = function(text, opt_options
|
||||
flatCoordinates, 0, flatCoordinates.length, stride);
|
||||
|
||||
return (
|
||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
||||
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||
new LineString(coordinates, this.geometryLayout_), false,
|
||||
this.adaptOptions(opt_options))
|
||||
);
|
||||
@@ -348,13 +348,13 @@ _ol_format_Polyline_.prototype.readGeometryFromText = function(text, opt_options
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.readProjection;
|
||||
Polyline.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.writeFeatureText = function(feature, opt_options) {
|
||||
Polyline.prototype.writeFeatureText = function(feature, opt_options) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
return this.writeGeometryText(geometry, opt_options);
|
||||
@@ -368,7 +368,7 @@ _ol_format_Polyline_.prototype.writeFeatureText = function(feature, opt_options)
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
Polyline.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
return this.writeFeatureText(features[0], opt_options);
|
||||
};
|
||||
|
||||
@@ -382,20 +382,20 @@ _ol_format_Polyline_.prototype.writeFeaturesText = function(features, opt_option
|
||||
* @return {string} Geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.writeGeometry;
|
||||
Polyline.prototype.writeGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_Polyline_.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
Polyline.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
geometry = /** @type {ol.geom.LineString} */
|
||||
(_ol_format_Feature_.transformWithOptions(
|
||||
(FeatureFormat.transformWithOptions(
|
||||
geometry, true, this.adaptOptions(opt_options)));
|
||||
var flatCoordinates = geometry.getFlatCoordinates();
|
||||
var stride = geometry.getStride();
|
||||
_ol_geom_flat_flip_.flipXY(
|
||||
flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
||||
return _ol_format_Polyline_.encodeDeltas(flatCoordinates, stride, this.factor_);
|
||||
return Polyline.encodeDeltas(flatCoordinates, stride, this.factor_);
|
||||
};
|
||||
export default _ol_format_Polyline_;
|
||||
export default Polyline;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/format/TextFeature
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
|
||||
/**
|
||||
@@ -15,11 +15,11 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
* @abstract
|
||||
* @extends {ol.format.Feature}
|
||||
*/
|
||||
var _ol_format_TextFeature_ = function() {
|
||||
_ol_format_Feature_.call(this);
|
||||
var TextFeature = function() {
|
||||
FeatureFormat.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_TextFeature_, _ol_format_Feature_);
|
||||
inherits(TextFeature, FeatureFormat);
|
||||
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ inherits(_ol_format_TextFeature_, _ol_format_Feature_);
|
||||
* @private
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.getText_ = function(source) {
|
||||
TextFeature.prototype.getText_ = function(source) {
|
||||
if (typeof source === 'string') {
|
||||
return source;
|
||||
} else {
|
||||
@@ -39,7 +39,7 @@ _ol_format_TextFeature_.prototype.getText_ = function(source) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.getType = function() {
|
||||
TextFeature.prototype.getType = function() {
|
||||
return _ol_format_FormatType_.TEXT;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ _ol_format_TextFeature_.prototype.getType = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
TextFeature.prototype.readFeature = function(source, opt_options) {
|
||||
return this.readFeatureFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -60,13 +60,13 @@ _ol_format_TextFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeatureFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readFeatureFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
TextFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
return this.readFeaturesFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -79,13 +79,13 @@ _ol_format_TextFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readFeaturesFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readFeaturesFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
TextFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
return this.readGeometryFromText(
|
||||
this.getText_(source), this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -98,13 +98,13 @@ _ol_format_TextFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
TextFeature.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readProjection = function(source) {
|
||||
TextFeature.prototype.readProjection = function(source) {
|
||||
return this.readProjectionFromText(this.getText_(source));
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ _ol_format_TextFeature_.prototype.readProjection = function(source) {
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.readProjectionFromText = function(text) {
|
||||
TextFeature.prototype.readProjectionFromText = function(text) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -122,7 +122,7 @@ _ol_format_TextFeature_.prototype.readProjectionFromText = function(text) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeature = function(feature, opt_options) {
|
||||
TextFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
return this.writeFeatureText(feature, this.adaptOptions(opt_options));
|
||||
};
|
||||
|
||||
@@ -134,13 +134,13 @@ _ol_format_TextFeature_.prototype.writeFeature = function(feature, opt_options)
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
TextFeature.prototype.writeFeatureText = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeatures = function(
|
||||
TextFeature.prototype.writeFeatures = function(
|
||||
features, opt_options) {
|
||||
return this.writeFeaturesText(features, this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -153,13 +153,13 @@ _ol_format_TextFeature_.prototype.writeFeatures = function(
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
TextFeature.prototype.writeFeaturesText = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeGeometry = function(
|
||||
TextFeature.prototype.writeGeometry = function(
|
||||
geometry, opt_options) {
|
||||
return this.writeGeometryText(geometry, this.adaptOptions(opt_options));
|
||||
};
|
||||
@@ -172,5 +172,5 @@ _ol_format_TextFeature_.prototype.writeGeometry = function(
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
*/
|
||||
_ol_format_TextFeature_.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
export default _ol_format_TextFeature_;
|
||||
TextFeature.prototype.writeGeometryText = function(geometry, opt_options) {};
|
||||
export default TextFeature;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import JSONFeature from '../format/JSONFeature.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
@@ -22,11 +22,11 @@ import {get as getProjection} from '../proj.js';
|
||||
* @param {olx.format.TopoJSONOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_TopoJSON_ = function(opt_options) {
|
||||
var TopoJSON = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_JSONFeature_.call(this);
|
||||
JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -49,7 +49,7 @@ var _ol_format_TopoJSON_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_TopoJSON_, _ol_format_JSONFeature_);
|
||||
inherits(TopoJSON, JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ inherits(_ol_format_TopoJSON_, _ol_format_JSONFeature_);
|
||||
* @return {Array.<ol.Coordinate>} Coordinates array.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.concatenateArcs_ = function(indices, arcs) {
|
||||
TopoJSON.concatenateArcs_ = function(indices, arcs) {
|
||||
/** @type {Array.<ol.Coordinate>} */
|
||||
var coordinates = [];
|
||||
var index, arc;
|
||||
@@ -99,10 +99,10 @@ _ol_format_TopoJSON_.concatenateArcs_ = function(indices, arcs) {
|
||||
* @return {ol.geom.Point} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
|
||||
TopoJSON.readPointGeometry_ = function(object, scale, translate) {
|
||||
var coordinates = object.coordinates;
|
||||
if (scale && translate) {
|
||||
_ol_format_TopoJSON_.transformVertex_(coordinates, scale, translate);
|
||||
TopoJSON.transformVertex_(coordinates, scale, translate);
|
||||
}
|
||||
return new Point(coordinates);
|
||||
};
|
||||
@@ -117,13 +117,13 @@ _ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
|
||||
* @return {ol.geom.MultiPoint} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readMultiPointGeometry_ = function(object, scale,
|
||||
TopoJSON.readMultiPointGeometry_ = function(object, scale,
|
||||
translate) {
|
||||
var coordinates = object.coordinates;
|
||||
var i, ii;
|
||||
if (scale && translate) {
|
||||
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
_ol_format_TopoJSON_.transformVertex_(coordinates[i], scale, translate);
|
||||
TopoJSON.transformVertex_(coordinates[i], scale, translate);
|
||||
}
|
||||
}
|
||||
return new MultiPoint(coordinates);
|
||||
@@ -138,8 +138,8 @@ _ol_format_TopoJSON_.readMultiPointGeometry_ = function(object, scale,
|
||||
* @return {ol.geom.LineString} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readLineStringGeometry_ = function(object, arcs) {
|
||||
var coordinates = _ol_format_TopoJSON_.concatenateArcs_(object.arcs, arcs);
|
||||
TopoJSON.readLineStringGeometry_ = function(object, arcs) {
|
||||
var coordinates = TopoJSON.concatenateArcs_(object.arcs, arcs);
|
||||
return new LineString(coordinates);
|
||||
};
|
||||
|
||||
@@ -152,11 +152,11 @@ _ol_format_TopoJSON_.readLineStringGeometry_ = function(object, arcs) {
|
||||
* @return {ol.geom.MultiLineString} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readMultiLineStringGeometry_ = function(object, arcs) {
|
||||
TopoJSON.readMultiLineStringGeometry_ = function(object, arcs) {
|
||||
var coordinates = [];
|
||||
var i, ii;
|
||||
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
||||
coordinates[i] = _ol_format_TopoJSON_.concatenateArcs_(object.arcs[i], arcs);
|
||||
coordinates[i] = TopoJSON.concatenateArcs_(object.arcs[i], arcs);
|
||||
}
|
||||
return new MultiLineString(coordinates);
|
||||
};
|
||||
@@ -170,11 +170,11 @@ _ol_format_TopoJSON_.readMultiLineStringGeometry_ = function(object, arcs) {
|
||||
* @return {ol.geom.Polygon} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readPolygonGeometry_ = function(object, arcs) {
|
||||
TopoJSON.readPolygonGeometry_ = function(object, arcs) {
|
||||
var coordinates = [];
|
||||
var i, ii;
|
||||
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
||||
coordinates[i] = _ol_format_TopoJSON_.concatenateArcs_(object.arcs[i], arcs);
|
||||
coordinates[i] = TopoJSON.concatenateArcs_(object.arcs[i], arcs);
|
||||
}
|
||||
return new Polygon(coordinates);
|
||||
};
|
||||
@@ -188,7 +188,7 @@ _ol_format_TopoJSON_.readPolygonGeometry_ = function(object, arcs) {
|
||||
* @return {ol.geom.MultiPolygon} Geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
||||
TopoJSON.readMultiPolygonGeometry_ = function(object, arcs) {
|
||||
var coordinates = [];
|
||||
var polyArray, ringCoords, j, jj;
|
||||
var i, ii;
|
||||
@@ -198,7 +198,7 @@ _ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
||||
ringCoords = [];
|
||||
for (j = 0, jj = polyArray.length; j < jj; ++j) {
|
||||
// for each ring
|
||||
ringCoords[j] = _ol_format_TopoJSON_.concatenateArcs_(polyArray[j], arcs);
|
||||
ringCoords[j] = TopoJSON.concatenateArcs_(polyArray[j], arcs);
|
||||
}
|
||||
coordinates[i] = ringCoords;
|
||||
}
|
||||
@@ -221,13 +221,13 @@ _ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
||||
* @return {Array.<ol.Feature>} Array of features.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readFeaturesFromGeometryCollection_ = function(
|
||||
TopoJSON.readFeaturesFromGeometryCollection_ = function(
|
||||
collection, arcs, scale, translate, property, name, opt_options) {
|
||||
var geometries = collection.geometries;
|
||||
var features = [];
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
features[i] = _ol_format_TopoJSON_.readFeatureFromGeometry_(
|
||||
features[i] = TopoJSON.readFeatureFromGeometry_(
|
||||
geometries[i], arcs, scale, translate, property, name, opt_options);
|
||||
}
|
||||
return features;
|
||||
@@ -248,11 +248,11 @@ _ol_format_TopoJSON_.readFeaturesFromGeometryCollection_ = function(
|
||||
* @return {ol.Feature} Feature.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
||||
TopoJSON.readFeatureFromGeometry_ = function(object, arcs,
|
||||
scale, translate, property, name, opt_options) {
|
||||
var geometry;
|
||||
var type = object.type;
|
||||
var geometryReader = _ol_format_TopoJSON_.GEOMETRY_READERS_[type];
|
||||
var geometryReader = TopoJSON.GEOMETRY_READERS_[type];
|
||||
if ((type === 'Point') || (type === 'MultiPoint')) {
|
||||
geometry = geometryReader(object, scale, translate);
|
||||
} else {
|
||||
@@ -260,7 +260,7 @@ _ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
||||
}
|
||||
var feature = new _ol_Feature_();
|
||||
feature.setGeometry(/** @type {ol.geom.Geometry} */ (
|
||||
_ol_format_Feature_.transformWithOptions(geometry, false, opt_options)));
|
||||
FeatureFormat.transformWithOptions(geometry, false, opt_options)));
|
||||
if (object.id !== undefined) {
|
||||
feature.setId(object.id);
|
||||
}
|
||||
@@ -286,13 +286,13 @@ _ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readFeatures;
|
||||
TopoJSON.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
||||
TopoJSON.prototype.readFeaturesFromObject = function(
|
||||
object, opt_options) {
|
||||
if (object.type == 'Topology') {
|
||||
var topoJSONTopology = /** @type {TopoJSONTopology} */ (object);
|
||||
@@ -304,7 +304,7 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
||||
}
|
||||
var arcs = topoJSONTopology.arcs;
|
||||
if (transform) {
|
||||
_ol_format_TopoJSON_.transformArcs_(arcs, scale, translate);
|
||||
TopoJSON.transformArcs_(arcs, scale, translate);
|
||||
}
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
@@ -319,12 +319,12 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
||||
feature = /** @type {TopoJSONGeometryCollection} */
|
||||
(topoJSONFeatures[objectName]);
|
||||
features.push.apply(features,
|
||||
_ol_format_TopoJSON_.readFeaturesFromGeometryCollection_(
|
||||
TopoJSON.readFeaturesFromGeometryCollection_(
|
||||
feature, arcs, scale, translate, property, objectName, opt_options));
|
||||
} else {
|
||||
feature = /** @type {TopoJSONGeometry} */
|
||||
(topoJSONFeatures[objectName]);
|
||||
features.push(_ol_format_TopoJSON_.readFeatureFromGeometry_(
|
||||
features.push(TopoJSON.readFeatureFromGeometry_(
|
||||
feature, arcs, scale, translate, property, objectName, opt_options));
|
||||
}
|
||||
}
|
||||
@@ -344,10 +344,10 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.transformArcs_ = function(arcs, scale, translate) {
|
||||
TopoJSON.transformArcs_ = function(arcs, scale, translate) {
|
||||
var i, ii;
|
||||
for (i = 0, ii = arcs.length; i < ii; ++i) {
|
||||
_ol_format_TopoJSON_.transformArc_(arcs[i], scale, translate);
|
||||
TopoJSON.transformArc_(arcs[i], scale, translate);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -360,7 +360,7 @@ _ol_format_TopoJSON_.transformArcs_ = function(arcs, scale, translate) {
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
||||
TopoJSON.transformArc_ = function(arc, scale, translate) {
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var vertex;
|
||||
@@ -371,7 +371,7 @@ _ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
||||
y += vertex[1];
|
||||
vertex[0] = x;
|
||||
vertex[1] = y;
|
||||
_ol_format_TopoJSON_.transformVertex_(vertex, scale, translate);
|
||||
TopoJSON.transformVertex_(vertex, scale, translate);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -385,7 +385,7 @@ _ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_TopoJSON_.transformVertex_ = function(vertex, scale, translate) {
|
||||
TopoJSON.transformVertex_ = function(vertex, scale, translate) {
|
||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||
vertex[1] = vertex[1] * scale[1] + translate[1];
|
||||
};
|
||||
@@ -399,13 +399,13 @@ _ol_format_TopoJSON_.transformVertex_ = function(vertex, scale, translate) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readProjection;
|
||||
TopoJSON.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
TopoJSON.prototype.readProjectionFromObject = function(object) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -415,13 +415,13 @@ _ol_format_TopoJSON_.prototype.readProjectionFromObject = function(object) {
|
||||
* @private
|
||||
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>}
|
||||
*/
|
||||
_ol_format_TopoJSON_.GEOMETRY_READERS_ = {
|
||||
'Point': _ol_format_TopoJSON_.readPointGeometry_,
|
||||
'LineString': _ol_format_TopoJSON_.readLineStringGeometry_,
|
||||
'Polygon': _ol_format_TopoJSON_.readPolygonGeometry_,
|
||||
'MultiPoint': _ol_format_TopoJSON_.readMultiPointGeometry_,
|
||||
'MultiLineString': _ol_format_TopoJSON_.readMultiLineStringGeometry_,
|
||||
'MultiPolygon': _ol_format_TopoJSON_.readMultiPolygonGeometry_
|
||||
TopoJSON.GEOMETRY_READERS_ = {
|
||||
'Point': TopoJSON.readPointGeometry_,
|
||||
'LineString': TopoJSON.readLineStringGeometry_,
|
||||
'Polygon': TopoJSON.readPolygonGeometry_,
|
||||
'MultiPoint': TopoJSON.readMultiPointGeometry_,
|
||||
'MultiLineString': TopoJSON.readMultiLineStringGeometry_,
|
||||
'MultiPolygon': TopoJSON.readMultiPolygonGeometry_
|
||||
};
|
||||
|
||||
|
||||
@@ -429,33 +429,33 @@ _ol_format_TopoJSON_.GEOMETRY_READERS_ = {
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||
TopoJSON.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||
TopoJSON.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||
TopoJSON.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readGeometryFromObject = function() {};
|
||||
TopoJSON.prototype.readGeometryFromObject = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @override
|
||||
*/
|
||||
_ol_format_TopoJSON_.prototype.readFeatureFromObject = function() {};
|
||||
export default _ol_format_TopoJSON_;
|
||||
TopoJSON.prototype.readFeatureFromObject = function() {};
|
||||
export default TopoJSON;
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_format_GML2_ from '../format/GML2.js';
|
||||
import _ol_format_GML3_ from '../format/GML3.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import GML2 from '../format/GML2.js';
|
||||
import GML3 from '../format/GML3.js';
|
||||
import GMLBase from '../format/GMLBase.js';
|
||||
import _ol_format_filter_ from '../format/filter.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import XMLFeature from '../format/XMLFeature.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
@@ -27,7 +27,7 @@ import _ol_xml_ from '../xml.js';
|
||||
* @extends {ol.format.XMLFeature}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_WFS_ = function(opt_options) {
|
||||
var WFS = function(opt_options) {
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ var _ol_format_WFS_ = function(opt_options) {
|
||||
* @type {ol.format.GMLBase}
|
||||
*/
|
||||
this.gmlFormat_ = options.gmlFormat ?
|
||||
options.gmlFormat : new _ol_format_GML3_();
|
||||
options.gmlFormat : new GML3();
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -55,54 +55,54 @@ var _ol_format_WFS_ = function(opt_options) {
|
||||
*/
|
||||
this.schemaLocation_ = options.schemaLocation ?
|
||||
options.schemaLocation :
|
||||
_ol_format_WFS_.SCHEMA_LOCATIONS[_ol_format_WFS_.DEFAULT_VERSION];
|
||||
WFS.SCHEMA_LOCATIONS[WFS.DEFAULT_VERSION];
|
||||
|
||||
_ol_format_XMLFeature_.call(this);
|
||||
XMLFeature.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_WFS_, _ol_format_XMLFeature_);
|
||||
inherits(WFS, XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.FEATURE_PREFIX = 'feature';
|
||||
WFS.FEATURE_PREFIX = 'feature';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.XMLNS = 'http://www.w3.org/2000/xmlns/';
|
||||
WFS.XMLNS = 'http://www.w3.org/2000/xmlns/';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.OGCNS = 'http://www.opengis.net/ogc';
|
||||
WFS.OGCNS = 'http://www.opengis.net/ogc';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.WFSNS = 'http://www.opengis.net/wfs';
|
||||
WFS.WFSNS = 'http://www.opengis.net/wfs';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.FESNS = 'http://www.opengis.net/fes';
|
||||
WFS.FESNS = 'http://www.opengis.net/fes';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, string>}
|
||||
*/
|
||||
_ol_format_WFS_.SCHEMA_LOCATIONS = {
|
||||
WFS.SCHEMA_LOCATIONS = {
|
||||
'1.1.0': 'http://www.opengis.net/wfs ' +
|
||||
'http://schemas.opengis.net/wfs/1.1.0/wfs.xsd',
|
||||
'1.0.0': 'http://www.opengis.net/wfs ' +
|
||||
@@ -114,13 +114,13 @@ _ol_format_WFS_.SCHEMA_LOCATIONS = {
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WFS_.DEFAULT_VERSION = '1.1.0';
|
||||
WFS.DEFAULT_VERSION = '1.1.0';
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<string>|string|undefined} featureType
|
||||
*/
|
||||
_ol_format_WFS_.prototype.getFeatureType = function() {
|
||||
WFS.prototype.getFeatureType = function() {
|
||||
return this.featureType_;
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ _ol_format_WFS_.prototype.getFeatureType = function() {
|
||||
/**
|
||||
* @param {Array.<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
*/
|
||||
_ol_format_WFS_.prototype.setFeatureType = function(featureType) {
|
||||
WFS.prototype.setFeatureType = function(featureType) {
|
||||
this.featureType_ = featureType;
|
||||
};
|
||||
|
||||
@@ -142,13 +142,13 @@ _ol_format_WFS_.prototype.setFeatureType = function(featureType) {
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readFeatures;
|
||||
WFS.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var context = /** @type {ol.XmlNodeStackItem} */ ({
|
||||
'featureType': this.featureType_,
|
||||
'featureNS': this.featureNS_
|
||||
@@ -156,9 +156,9 @@ _ol_format_WFS_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
_ol_obj_.assign(context, this.getReadOptions(node,
|
||||
opt_options ? opt_options : {}));
|
||||
var objectStack = [context];
|
||||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS[_ol_format_GMLBase_.GMLNS][
|
||||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS[GMLBase.GMLNS][
|
||||
'featureMember'] =
|
||||
_ol_xml_.makeArrayPusher(_ol_format_GMLBase_.prototype.readFeaturesInternal);
|
||||
_ol_xml_.makeArrayPusher(GMLBase.prototype.readFeaturesInternal);
|
||||
var features = _ol_xml_.pushParseAndPop([],
|
||||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node,
|
||||
objectStack, this.gmlFormat_);
|
||||
@@ -176,7 +176,7 @@ _ol_format_WFS_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readTransactionResponse = function(source) {
|
||||
WFS.prototype.readTransactionResponse = function(source) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readTransactionResponseFromDocument(
|
||||
/** @type {Document} */ (source));
|
||||
@@ -199,7 +199,7 @@ _ol_format_WFS_.prototype.readTransactionResponse = function(source) {
|
||||
* FeatureCollection metadata.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readFeatureCollectionMetadata = function(source) {
|
||||
WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readFeatureCollectionMetadataFromDocument(
|
||||
/** @type {Document} */ (source));
|
||||
@@ -220,7 +220,7 @@ _ol_format_WFS_.prototype.readFeatureCollectionMetadata = function(source) {
|
||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
|
||||
WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFeatureCollectionMetadataFromNode(n);
|
||||
@@ -235,10 +235,10 @@ _ol_format_WFS_.prototype.readFeatureCollectionMetadataFromDocument = function(d
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.FEATURE_COLLECTION_PARSERS_ = {
|
||||
WFS.FEATURE_COLLECTION_PARSERS_ = {
|
||||
'http://www.opengis.net/gml': {
|
||||
'boundedBy': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_GMLBase_.prototype.readGeometryElement, 'bounds')
|
||||
GMLBase.prototype.readGeometryElement, 'bounds')
|
||||
}
|
||||
};
|
||||
|
||||
@@ -248,14 +248,14 @@ _ol_format_WFS_.FEATURE_COLLECTION_PARSERS_ = {
|
||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||
WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||
var result = {};
|
||||
var value = _ol_format_XSD_.readNonNegativeIntegerString(
|
||||
var value = XSD.readNonNegativeIntegerString(
|
||||
node.getAttribute('numberOfFeatures'));
|
||||
result['numberOfFeatures'] = value;
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
/** @type {ol.WFSFeatureCollectionMetadata} */ (result),
|
||||
_ol_format_WFS_.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_);
|
||||
WFS.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_);
|
||||
};
|
||||
|
||||
|
||||
@@ -264,14 +264,14 @@ _ol_format_WFS_.prototype.readFeatureCollectionMetadataFromNode = function(node)
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.TRANSACTION_SUMMARY_PARSERS_ = {
|
||||
WFS.TRANSACTION_SUMMARY_PARSERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'totalInserted': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'totalUpdated': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'totalDeleted': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger)
|
||||
XSD.readNonNegativeInteger)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -282,9 +282,9 @@ _ol_format_WFS_.TRANSACTION_SUMMARY_PARSERS_ = {
|
||||
* @return {Object|undefined} Transaction Summary.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.readTransactionSummary_ = function(node, objectStack) {
|
||||
WFS.readTransactionSummary_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WFS_.TRANSACTION_SUMMARY_PARSERS_, node, objectStack);
|
||||
{}, WFS.TRANSACTION_SUMMARY_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ _ol_format_WFS_.readTransactionSummary_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.OGC_FID_PARSERS_ = {
|
||||
WFS.OGC_FID_PARSERS_ = {
|
||||
'http://www.opengis.net/ogc': {
|
||||
'FeatureId': _ol_xml_.makeArrayPusher(function(node, objectStack) {
|
||||
return node.getAttribute('fid');
|
||||
@@ -307,8 +307,8 @@ _ol_format_WFS_.OGC_FID_PARSERS_ = {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.fidParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(_ol_format_WFS_.OGC_FID_PARSERS_, node, objectStack);
|
||||
WFS.fidParser_ = function(node, objectStack) {
|
||||
_ol_xml_.parseNode(WFS.OGC_FID_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -317,9 +317,9 @@ _ol_format_WFS_.fidParser_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.INSERT_RESULTS_PARSERS_ = {
|
||||
WFS.INSERT_RESULTS_PARSERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'Feature': _ol_format_WFS_.fidParser_
|
||||
'Feature': WFS.fidParser_
|
||||
}
|
||||
};
|
||||
|
||||
@@ -330,9 +330,9 @@ _ol_format_WFS_.INSERT_RESULTS_PARSERS_ = {
|
||||
* @return {Array.<string>|undefined} Insert results.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.readInsertResults_ = function(node, objectStack) {
|
||||
WFS.readInsertResults_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
[], _ol_format_WFS_.INSERT_RESULTS_PARSERS_, node, objectStack);
|
||||
[], WFS.INSERT_RESULTS_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -341,12 +341,12 @@ _ol_format_WFS_.readInsertResults_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.TRANSACTION_RESPONSE_PARSERS_ = {
|
||||
WFS.TRANSACTION_RESPONSE_PARSERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'TransactionSummary': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WFS_.readTransactionSummary_, 'transactionSummary'),
|
||||
WFS.readTransactionSummary_, 'transactionSummary'),
|
||||
'InsertResults': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WFS_.readInsertResults_, 'insertIds')
|
||||
WFS.readInsertResults_, 'insertIds')
|
||||
}
|
||||
};
|
||||
|
||||
@@ -355,7 +355,7 @@ _ol_format_WFS_.TRANSACTION_RESPONSE_PARSERS_ = {
|
||||
* @param {Document} doc Document.
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||
WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readTransactionResponseFromNode(n);
|
||||
@@ -369,10 +369,10 @@ _ol_format_WFS_.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||
* @param {Node} node Node.
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readTransactionResponseFromNode = function(node) {
|
||||
WFS.prototype.readTransactionResponseFromNode = function(node) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
/** @type {ol.WFSTransactionResponse} */({}),
|
||||
_ol_format_WFS_.TRANSACTION_RESPONSE_PARSERS_, node, []);
|
||||
WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
|
||||
};
|
||||
|
||||
|
||||
@@ -380,9 +380,9 @@ _ol_format_WFS_.prototype.readTransactionResponseFromNode = function(node) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.QUERY_SERIALIZERS_ = {
|
||||
WFS.QUERY_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'PropertyName': _ol_xml_.makeChildAppender(_ol_format_XSD_.writeStringTextNode)
|
||||
'PropertyName': _ol_xml_.makeChildAppender(XSD.writeStringTextNode)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -393,7 +393,7 @@ _ol_format_WFS_.QUERY_SERIALIZERS_ = {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeFeature_ = function(node, feature, objectStack) {
|
||||
WFS.writeFeature_ = function(node, feature, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var featureType = context['featureType'];
|
||||
var featureNS = context['featureNS'];
|
||||
@@ -401,9 +401,9 @@ _ol_format_WFS_.writeFeature_ = function(node, feature, objectStack) {
|
||||
var child = _ol_xml_.createElementNS(featureNS, featureType);
|
||||
node.appendChild(child);
|
||||
if (gmlVersion === 2) {
|
||||
_ol_format_GML2_.prototype.writeFeatureElement(child, feature, objectStack);
|
||||
GML2.prototype.writeFeatureElement(child, feature, objectStack);
|
||||
} else {
|
||||
_ol_format_GML3_.prototype.writeFeatureElement(child, feature, objectStack);
|
||||
GML3.prototype.writeFeatureElement(child, feature, objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -414,9 +414,9 @@ _ol_format_WFS_.writeFeature_ = function(node, feature, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeOgcFidFilter_ = function(node, fid, objectStack) {
|
||||
var filter = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'Filter');
|
||||
var child = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'FeatureId');
|
||||
WFS.writeOgcFidFilter_ = function(node, fid, objectStack) {
|
||||
var filter = _ol_xml_.createElementNS(WFS.OGCNS, 'Filter');
|
||||
var child = _ol_xml_.createElementNS(WFS.OGCNS, 'FeatureId');
|
||||
filter.appendChild(child);
|
||||
child.setAttribute('fid', fid);
|
||||
node.appendChild(filter);
|
||||
@@ -429,9 +429,9 @@ _ol_format_WFS_.writeOgcFidFilter_ = function(node, fid, objectStack) {
|
||||
* @returns {string} The value of the typeName property.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.getTypeName_ = function(featurePrefix, featureType) {
|
||||
WFS.getTypeName_ = function(featurePrefix, featureType) {
|
||||
featurePrefix = featurePrefix ? featurePrefix :
|
||||
_ol_format_WFS_.FEATURE_PREFIX;
|
||||
WFS.FEATURE_PREFIX;
|
||||
var prefix = featurePrefix + ':';
|
||||
// The featureType already contains the prefix.
|
||||
if (featureType.indexOf(prefix) === 0) {
|
||||
@@ -448,19 +448,19 @@ _ol_format_WFS_.getTypeName_ = function(featurePrefix, featureType) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeDelete_ = function(node, feature, objectStack) {
|
||||
WFS.writeDelete_ = function(node, feature, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
_ol_asserts_.assert(feature.getId() !== undefined, 26); // Features must have an id set
|
||||
var featureType = context['featureType'];
|
||||
var featurePrefix = context['featurePrefix'];
|
||||
var featureNS = context['featureNS'];
|
||||
var typeName = _ol_format_WFS_.getTypeName_(featurePrefix, featureType);
|
||||
var typeName = WFS.getTypeName_(featurePrefix, featureType);
|
||||
node.setAttribute('typeName', typeName);
|
||||
_ol_xml_.setAttributeNS(node, _ol_format_WFS_.XMLNS, 'xmlns:' + featurePrefix,
|
||||
_ol_xml_.setAttributeNS(node, WFS.XMLNS, 'xmlns:' + featurePrefix,
|
||||
featureNS);
|
||||
var fid = feature.getId();
|
||||
if (fid !== undefined) {
|
||||
_ol_format_WFS_.writeOgcFidFilter_(node, fid, objectStack);
|
||||
WFS.writeOgcFidFilter_(node, fid, objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -471,16 +471,16 @@ _ol_format_WFS_.writeDelete_ = function(node, feature, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeUpdate_ = function(node, feature, objectStack) {
|
||||
WFS.writeUpdate_ = function(node, feature, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
_ol_asserts_.assert(feature.getId() !== undefined, 27); // Features must have an id set
|
||||
var featureType = context['featureType'];
|
||||
var featurePrefix = context['featurePrefix'];
|
||||
var featureNS = context['featureNS'];
|
||||
var typeName = _ol_format_WFS_.getTypeName_(featurePrefix, featureType);
|
||||
var typeName = WFS.getTypeName_(featurePrefix, featureType);
|
||||
var geometryName = feature.getGeometryName();
|
||||
node.setAttribute('typeName', typeName);
|
||||
_ol_xml_.setAttributeNS(node, _ol_format_WFS_.XMLNS, 'xmlns:' + featurePrefix,
|
||||
_ol_xml_.setAttributeNS(node, WFS.XMLNS, 'xmlns:' + featurePrefix,
|
||||
featureNS);
|
||||
var fid = feature.getId();
|
||||
if (fid !== undefined) {
|
||||
@@ -499,10 +499,10 @@ _ol_format_WFS_.writeUpdate_ = function(node, feature, objectStack) {
|
||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ (
|
||||
{'gmlVersion': context['gmlVersion'], node: node,
|
||||
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_,
|
||||
WFS.TRANSACTION_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Property'), values,
|
||||
objectStack);
|
||||
_ol_format_WFS_.writeOgcFidFilter_(node, fid, objectStack);
|
||||
WFS.writeOgcFidFilter_(node, fid, objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -513,25 +513,25 @@ _ol_format_WFS_.writeUpdate_ = function(node, feature, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeProperty_ = function(node, pair, objectStack) {
|
||||
var name = _ol_xml_.createElementNS(_ol_format_WFS_.WFSNS, 'Name');
|
||||
WFS.writeProperty_ = function(node, pair, objectStack) {
|
||||
var name = _ol_xml_.createElementNS(WFS.WFSNS, 'Name');
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
var gmlVersion = context['gmlVersion'];
|
||||
node.appendChild(name);
|
||||
_ol_format_XSD_.writeStringTextNode(name, pair.name);
|
||||
XSD.writeStringTextNode(name, pair.name);
|
||||
if (pair.value !== undefined && pair.value !== null) {
|
||||
var value = _ol_xml_.createElementNS(_ol_format_WFS_.WFSNS, 'Value');
|
||||
var value = _ol_xml_.createElementNS(WFS.WFSNS, 'Value');
|
||||
node.appendChild(value);
|
||||
if (pair.value instanceof Geometry) {
|
||||
if (gmlVersion === 2) {
|
||||
_ol_format_GML2_.prototype.writeGeometryElement(value,
|
||||
GML2.prototype.writeGeometryElement(value,
|
||||
pair.value, objectStack);
|
||||
} else {
|
||||
_ol_format_GML3_.prototype.writeGeometryElement(value,
|
||||
GML3.prototype.writeGeometryElement(value,
|
||||
pair.value, objectStack);
|
||||
}
|
||||
} else {
|
||||
_ol_format_XSD_.writeStringTextNode(value, pair.value);
|
||||
XSD.writeStringTextNode(value, pair.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -544,7 +544,7 @@ _ol_format_WFS_.writeProperty_ = function(node, pair, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeNative_ = function(node, nativeElement, objectStack) {
|
||||
WFS.writeNative_ = function(node, nativeElement, objectStack) {
|
||||
if (nativeElement.vendorId) {
|
||||
node.setAttribute('vendorId', nativeElement.vendorId);
|
||||
}
|
||||
@@ -552,7 +552,7 @@ _ol_format_WFS_.writeNative_ = function(node, nativeElement, objectStack) {
|
||||
node.setAttribute('safeToIgnore', nativeElement.safeToIgnore);
|
||||
}
|
||||
if (nativeElement.value !== undefined) {
|
||||
_ol_format_XSD_.writeStringTextNode(node, nativeElement.value);
|
||||
XSD.writeStringTextNode(node, nativeElement.value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -561,13 +561,13 @@ _ol_format_WFS_.writeNative_ = function(node, nativeElement, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_ = {
|
||||
WFS.TRANSACTION_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'Insert': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeFeature_),
|
||||
'Update': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeUpdate_),
|
||||
'Delete': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeDelete_),
|
||||
'Property': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeProperty_),
|
||||
'Native': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeNative_)
|
||||
'Insert': _ol_xml_.makeChildAppender(WFS.writeFeature_),
|
||||
'Update': _ol_xml_.makeChildAppender(WFS.writeUpdate_),
|
||||
'Delete': _ol_xml_.makeChildAppender(WFS.writeDelete_),
|
||||
'Property': _ol_xml_.makeChildAppender(WFS.writeProperty_),
|
||||
'Native': _ol_xml_.makeChildAppender(WFS.writeNative_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -578,7 +578,7 @@ _ol_format_WFS_.TRANSACTION_SERIALIZERS_ = {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeQuery_ = function(node, featureType, objectStack) {
|
||||
WFS.writeQuery_ = function(node, featureType, objectStack) {
|
||||
var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var featurePrefix = context['featurePrefix'];
|
||||
var featureNS = context['featureNS'];
|
||||
@@ -587,7 +587,7 @@ _ol_format_WFS_.writeQuery_ = function(node, featureType, objectStack) {
|
||||
var typeName;
|
||||
// If feature prefix is not defined, we must not use the default prefix.
|
||||
if (featurePrefix) {
|
||||
typeName = _ol_format_WFS_.getTypeName_(featurePrefix, featureType);
|
||||
typeName = WFS.getTypeName_(featurePrefix, featureType);
|
||||
} else {
|
||||
typeName = featureType;
|
||||
}
|
||||
@@ -596,20 +596,20 @@ _ol_format_WFS_.writeQuery_ = function(node, featureType, objectStack) {
|
||||
node.setAttribute('srsName', srsName);
|
||||
}
|
||||
if (featureNS) {
|
||||
_ol_xml_.setAttributeNS(node, _ol_format_WFS_.XMLNS, 'xmlns:' + featurePrefix,
|
||||
_ol_xml_.setAttributeNS(node, WFS.XMLNS, 'xmlns:' + featurePrefix,
|
||||
featureNS);
|
||||
}
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (_ol_obj_.assign({}, context));
|
||||
item.node = node;
|
||||
_ol_xml_.pushSerializeAndPop(item,
|
||||
_ol_format_WFS_.QUERY_SERIALIZERS_,
|
||||
WFS.QUERY_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('PropertyName'), propertyNames,
|
||||
objectStack);
|
||||
var filter = context['filter'];
|
||||
if (filter) {
|
||||
var child = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'Filter');
|
||||
var child = _ol_xml_.createElementNS(WFS.OGCNS, 'Filter');
|
||||
node.appendChild(child);
|
||||
_ol_format_WFS_.writeFilterCondition_(child, filter, objectStack);
|
||||
WFS.writeFilterCondition_(child, filter, objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -620,11 +620,11 @@ _ol_format_WFS_.writeQuery_ = function(node, featureType, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeFilterCondition_ = function(node, filter, objectStack) {
|
||||
WFS.writeFilterCondition_ = function(node, filter, objectStack) {
|
||||
/** @type {ol.XmlNodeStackItem} */
|
||||
var item = {node: node};
|
||||
_ol_xml_.pushSerializeAndPop(item,
|
||||
_ol_format_WFS_.GETFEATURE_SERIALIZERS_,
|
||||
WFS.GETFEATURE_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory(filter.getTagName()),
|
||||
[filter], objectStack);
|
||||
};
|
||||
@@ -636,12 +636,12 @@ _ol_format_WFS_.writeFilterCondition_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeBboxFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeBboxFilter_ = function(node, filter, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['srsName'] = filter.srsName;
|
||||
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.geometryName);
|
||||
_ol_format_GML3_.prototype.writeGeometryElement(node, filter.extent, objectStack);
|
||||
WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
GML3.prototype.writeGeometryElement(node, filter.extent, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -651,12 +651,12 @@ _ol_format_WFS_.writeBboxFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeContainsFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeContainsFilter_ = function(node, filter, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['srsName'] = filter.srsName;
|
||||
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.geometryName);
|
||||
_ol_format_GML3_.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -666,12 +666,12 @@ _ol_format_WFS_.writeContainsFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeIntersectsFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeIntersectsFilter_ = function(node, filter, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['srsName'] = filter.srsName;
|
||||
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.geometryName);
|
||||
_ol_format_GML3_.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -681,12 +681,12 @@ _ol_format_WFS_.writeIntersectsFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeWithinFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeWithinFilter_ = function(node, filter, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['srsName'] = filter.srsName;
|
||||
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.geometryName);
|
||||
_ol_format_GML3_.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -696,23 +696,23 @@ _ol_format_WFS_.writeWithinFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeDuringFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeDuringFilter_ = function(node, filter, objectStack) {
|
||||
|
||||
var valueReference = _ol_xml_.createElementNS(_ol_format_WFS_.FESNS, 'ValueReference');
|
||||
_ol_format_XSD_.writeStringTextNode(valueReference, filter.propertyName);
|
||||
var valueReference = _ol_xml_.createElementNS(WFS.FESNS, 'ValueReference');
|
||||
XSD.writeStringTextNode(valueReference, filter.propertyName);
|
||||
node.appendChild(valueReference);
|
||||
|
||||
var timePeriod = _ol_xml_.createElementNS(_ol_format_GMLBase_.GMLNS, 'TimePeriod');
|
||||
var timePeriod = _ol_xml_.createElementNS(GMLBase.GMLNS, 'TimePeriod');
|
||||
|
||||
node.appendChild(timePeriod);
|
||||
|
||||
var begin = _ol_xml_.createElementNS(_ol_format_GMLBase_.GMLNS, 'begin');
|
||||
var begin = _ol_xml_.createElementNS(GMLBase.GMLNS, 'begin');
|
||||
timePeriod.appendChild(begin);
|
||||
_ol_format_WFS_.writeTimeInstant_(begin, filter.begin);
|
||||
WFS.writeTimeInstant_(begin, filter.begin);
|
||||
|
||||
var end = _ol_xml_.createElementNS(_ol_format_GMLBase_.GMLNS, 'end');
|
||||
var end = _ol_xml_.createElementNS(GMLBase.GMLNS, 'end');
|
||||
timePeriod.appendChild(end);
|
||||
_ol_format_WFS_.writeTimeInstant_(end, filter.end);
|
||||
WFS.writeTimeInstant_(end, filter.end);
|
||||
};
|
||||
|
||||
|
||||
@@ -722,14 +722,14 @@ _ol_format_WFS_.writeDuringFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeLogicalFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeLogicalFilter_ = function(node, filter, objectStack) {
|
||||
/** @type {ol.XmlNodeStackItem} */
|
||||
var item = {node: node};
|
||||
var conditions = filter.conditions;
|
||||
for (var i = 0, ii = conditions.length; i < ii; ++i) {
|
||||
var condition = conditions[i];
|
||||
_ol_xml_.pushSerializeAndPop(item,
|
||||
_ol_format_WFS_.GETFEATURE_SERIALIZERS_,
|
||||
WFS.GETFEATURE_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory(condition.getTagName()),
|
||||
[condition], objectStack);
|
||||
}
|
||||
@@ -742,12 +742,12 @@ _ol_format_WFS_.writeLogicalFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeNotFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeNotFilter_ = function(node, filter, objectStack) {
|
||||
/** @type {ol.XmlNodeStackItem} */
|
||||
var item = {node: node};
|
||||
var condition = filter.condition;
|
||||
_ol_xml_.pushSerializeAndPop(item,
|
||||
_ol_format_WFS_.GETFEATURE_SERIALIZERS_,
|
||||
WFS.GETFEATURE_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory(condition.getTagName()),
|
||||
[condition], objectStack);
|
||||
};
|
||||
@@ -759,12 +759,12 @@ _ol_format_WFS_.writeNotFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeComparisonFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeComparisonFilter_ = function(node, filter, objectStack) {
|
||||
if (filter.matchCase !== undefined) {
|
||||
node.setAttribute('matchCase', filter.matchCase.toString());
|
||||
}
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.propertyName);
|
||||
_ol_format_WFS_.writeOgcLiteral_(node, '' + filter.expression);
|
||||
WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
WFS.writeOgcLiteral_(node, '' + filter.expression);
|
||||
};
|
||||
|
||||
|
||||
@@ -774,8 +774,8 @@ _ol_format_WFS_.writeComparisonFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeIsNullFilter_ = function(node, filter, objectStack) {
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.propertyName);
|
||||
WFS.writeIsNullFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
};
|
||||
|
||||
|
||||
@@ -785,16 +785,16 @@ _ol_format_WFS_.writeIsNullFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeIsBetweenFilter_ = function(node, filter, objectStack) {
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.propertyName);
|
||||
WFS.writeIsBetweenFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
|
||||
var lowerBoundary = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'LowerBoundary');
|
||||
var lowerBoundary = _ol_xml_.createElementNS(WFS.OGCNS, 'LowerBoundary');
|
||||
node.appendChild(lowerBoundary);
|
||||
_ol_format_WFS_.writeOgcLiteral_(lowerBoundary, '' + filter.lowerBoundary);
|
||||
WFS.writeOgcLiteral_(lowerBoundary, '' + filter.lowerBoundary);
|
||||
|
||||
var upperBoundary = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'UpperBoundary');
|
||||
var upperBoundary = _ol_xml_.createElementNS(WFS.OGCNS, 'UpperBoundary');
|
||||
node.appendChild(upperBoundary);
|
||||
_ol_format_WFS_.writeOgcLiteral_(upperBoundary, '' + filter.upperBoundary);
|
||||
WFS.writeOgcLiteral_(upperBoundary, '' + filter.upperBoundary);
|
||||
};
|
||||
|
||||
|
||||
@@ -804,15 +804,15 @@ _ol_format_WFS_.writeIsBetweenFilter_ = function(node, filter, objectStack) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeIsLikeFilter_ = function(node, filter, objectStack) {
|
||||
WFS.writeIsLikeFilter_ = function(node, filter, objectStack) {
|
||||
node.setAttribute('wildCard', filter.wildCard);
|
||||
node.setAttribute('singleChar', filter.singleChar);
|
||||
node.setAttribute('escapeChar', filter.escapeChar);
|
||||
if (filter.matchCase !== undefined) {
|
||||
node.setAttribute('matchCase', filter.matchCase.toString());
|
||||
}
|
||||
_ol_format_WFS_.writeOgcPropertyName_(node, filter.propertyName);
|
||||
_ol_format_WFS_.writeOgcLiteral_(node, '' + filter.pattern);
|
||||
WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
WFS.writeOgcLiteral_(node, '' + filter.pattern);
|
||||
};
|
||||
|
||||
|
||||
@@ -822,9 +822,9 @@ _ol_format_WFS_.writeIsLikeFilter_ = function(node, filter, objectStack) {
|
||||
* @param {string} value Value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeOgcExpression_ = function(tagName, node, value) {
|
||||
var property = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, tagName);
|
||||
_ol_format_XSD_.writeStringTextNode(property, value);
|
||||
WFS.writeOgcExpression_ = function(tagName, node, value) {
|
||||
var property = _ol_xml_.createElementNS(WFS.OGCNS, tagName);
|
||||
XSD.writeStringTextNode(property, value);
|
||||
node.appendChild(property);
|
||||
};
|
||||
|
||||
@@ -834,8 +834,8 @@ _ol_format_WFS_.writeOgcExpression_ = function(tagName, node, value) {
|
||||
* @param {string} value PropertyName value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeOgcPropertyName_ = function(node, value) {
|
||||
_ol_format_WFS_.writeOgcExpression_('PropertyName', node, value);
|
||||
WFS.writeOgcPropertyName_ = function(node, value) {
|
||||
WFS.writeOgcExpression_('PropertyName', node, value);
|
||||
};
|
||||
|
||||
|
||||
@@ -844,8 +844,8 @@ _ol_format_WFS_.writeOgcPropertyName_ = function(node, value) {
|
||||
* @param {string} value PropertyName value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeOgcLiteral_ = function(node, value) {
|
||||
_ol_format_WFS_.writeOgcExpression_('Literal', node, value);
|
||||
WFS.writeOgcLiteral_ = function(node, value) {
|
||||
WFS.writeOgcExpression_('Literal', node, value);
|
||||
};
|
||||
|
||||
|
||||
@@ -854,13 +854,13 @@ _ol_format_WFS_.writeOgcLiteral_ = function(node, value) {
|
||||
* @param {string} time PropertyName value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeTimeInstant_ = function(node, time) {
|
||||
var timeInstant = _ol_xml_.createElementNS(_ol_format_GMLBase_.GMLNS, 'TimeInstant');
|
||||
WFS.writeTimeInstant_ = function(node, time) {
|
||||
var timeInstant = _ol_xml_.createElementNS(GMLBase.GMLNS, 'TimeInstant');
|
||||
node.appendChild(timeInstant);
|
||||
|
||||
var timePosition = _ol_xml_.createElementNS(_ol_format_GMLBase_.GMLNS, 'timePosition');
|
||||
var timePosition = _ol_xml_.createElementNS(GMLBase.GMLNS, 'timePosition');
|
||||
timeInstant.appendChild(timePosition);
|
||||
_ol_format_XSD_.writeStringTextNode(timePosition, time);
|
||||
XSD.writeStringTextNode(timePosition, time);
|
||||
};
|
||||
|
||||
|
||||
@@ -868,28 +868,28 @@ _ol_format_WFS_.writeTimeInstant_ = function(node, time) {
|
||||
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.GETFEATURE_SERIALIZERS_ = {
|
||||
WFS.GETFEATURE_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'Query': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeQuery_)
|
||||
'Query': _ol_xml_.makeChildAppender(WFS.writeQuery_)
|
||||
},
|
||||
'http://www.opengis.net/ogc': {
|
||||
'During': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeDuringFilter_),
|
||||
'And': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeLogicalFilter_),
|
||||
'Or': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeLogicalFilter_),
|
||||
'Not': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeNotFilter_),
|
||||
'BBOX': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeBboxFilter_),
|
||||
'Contains': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeContainsFilter_),
|
||||
'Intersects': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeIntersectsFilter_),
|
||||
'Within': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeWithinFilter_),
|
||||
'PropertyIsEqualTo': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsNotEqualTo': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsLessThan': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsLessThanOrEqualTo': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThan': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThanOrEqualTo': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeComparisonFilter_),
|
||||
'PropertyIsNull': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeIsNullFilter_),
|
||||
'PropertyIsBetween': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeIsBetweenFilter_),
|
||||
'PropertyIsLike': _ol_xml_.makeChildAppender(_ol_format_WFS_.writeIsLikeFilter_)
|
||||
'During': _ol_xml_.makeChildAppender(WFS.writeDuringFilter_),
|
||||
'And': _ol_xml_.makeChildAppender(WFS.writeLogicalFilter_),
|
||||
'Or': _ol_xml_.makeChildAppender(WFS.writeLogicalFilter_),
|
||||
'Not': _ol_xml_.makeChildAppender(WFS.writeNotFilter_),
|
||||
'BBOX': _ol_xml_.makeChildAppender(WFS.writeBboxFilter_),
|
||||
'Contains': _ol_xml_.makeChildAppender(WFS.writeContainsFilter_),
|
||||
'Intersects': _ol_xml_.makeChildAppender(WFS.writeIntersectsFilter_),
|
||||
'Within': _ol_xml_.makeChildAppender(WFS.writeWithinFilter_),
|
||||
'PropertyIsEqualTo': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsNotEqualTo': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsLessThan': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsLessThanOrEqualTo': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThan': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThanOrEqualTo': _ol_xml_.makeChildAppender(WFS.writeComparisonFilter_),
|
||||
'PropertyIsNull': _ol_xml_.makeChildAppender(WFS.writeIsNullFilter_),
|
||||
'PropertyIsBetween': _ol_xml_.makeChildAppender(WFS.writeIsBetweenFilter_),
|
||||
'PropertyIsLike': _ol_xml_.makeChildAppender(WFS.writeIsLikeFilter_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -901,9 +901,9 @@ _ol_format_WFS_.GETFEATURE_SERIALIZERS_ = {
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.writeFilter = function(filter) {
|
||||
var child = _ol_xml_.createElementNS(_ol_format_WFS_.OGCNS, 'Filter');
|
||||
_ol_format_WFS_.writeFilterCondition_(child, filter, []);
|
||||
WFS.writeFilter = function(filter) {
|
||||
var child = _ol_xml_.createElementNS(WFS.OGCNS, 'Filter');
|
||||
WFS.writeFilterCondition_(child, filter, []);
|
||||
return child;
|
||||
};
|
||||
|
||||
@@ -914,12 +914,12 @@ _ol_format_WFS_.writeFilter = function(filter) {
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WFS_.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
||||
WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
||||
var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (_ol_obj_.assign({}, context));
|
||||
item.node = node;
|
||||
_ol_xml_.pushSerializeAndPop(item,
|
||||
_ol_format_WFS_.GETFEATURE_SERIALIZERS_,
|
||||
WFS.GETFEATURE_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Query'), featureTypes,
|
||||
objectStack);
|
||||
};
|
||||
@@ -932,8 +932,8 @@ _ol_format_WFS_.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.writeGetFeature = function(options) {
|
||||
var node = _ol_xml_.createElementNS(_ol_format_WFS_.WFSNS, 'GetFeature');
|
||||
WFS.prototype.writeGetFeature = function(options) {
|
||||
var node = _ol_xml_.createElementNS(WFS.WFSNS, 'GetFeature');
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', '1.1.0');
|
||||
var filter;
|
||||
@@ -984,7 +984,7 @@ _ol_format_WFS_.prototype.writeGetFeature = function(options) {
|
||||
};
|
||||
_ol_asserts_.assert(Array.isArray(options.featureTypes),
|
||||
11); // `options.featureTypes` should be an Array
|
||||
_ol_format_WFS_.writeGetFeature_(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
|
||||
WFS.writeGetFeature_(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
|
||||
return node;
|
||||
};
|
||||
|
||||
@@ -999,12 +999,12 @@ _ol_format_WFS_.prototype.writeGetFeature = function(options) {
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
options) {
|
||||
var objectStack = [];
|
||||
var node = _ol_xml_.createElementNS(_ol_format_WFS_.WFSNS, 'Transaction');
|
||||
var node = _ol_xml_.createElementNS(WFS.WFSNS, 'Transaction');
|
||||
var version = options.version ?
|
||||
options.version : _ol_format_WFS_.DEFAULT_VERSION;
|
||||
options.version : WFS.DEFAULT_VERSION;
|
||||
var gmlVersion = version === '1.0.0' ? 2 : 3;
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', version);
|
||||
@@ -1017,17 +1017,17 @@ _ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
node.setAttribute('handle', options.handle);
|
||||
}
|
||||
}
|
||||
var schemaLocation = _ol_format_WFS_.SCHEMA_LOCATIONS[version];
|
||||
var schemaLocation = WFS.SCHEMA_LOCATIONS[version];
|
||||
_ol_xml_.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', schemaLocation);
|
||||
var featurePrefix = options.featurePrefix ? options.featurePrefix : _ol_format_WFS_.FEATURE_PREFIX;
|
||||
var featurePrefix = options.featurePrefix ? options.featurePrefix : WFS.FEATURE_PREFIX;
|
||||
if (inserts) {
|
||||
obj = {node: node, 'featureNS': options.featureNS,
|
||||
'featureType': options.featureType, 'featurePrefix': featurePrefix,
|
||||
'gmlVersion': gmlVersion, 'hasZ': options.hasZ, 'srsName': options.srsName};
|
||||
_ol_obj_.assign(obj, baseObj);
|
||||
_ol_xml_.pushSerializeAndPop(obj,
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_,
|
||||
WFS.TRANSACTION_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Insert'), inserts,
|
||||
objectStack);
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ _ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
'gmlVersion': gmlVersion, 'hasZ': options.hasZ, 'srsName': options.srsName};
|
||||
_ol_obj_.assign(obj, baseObj);
|
||||
_ol_xml_.pushSerializeAndPop(obj,
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_,
|
||||
WFS.TRANSACTION_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Update'), updates,
|
||||
objectStack);
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ _ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
_ol_xml_.pushSerializeAndPop({node: node, 'featureNS': options.featureNS,
|
||||
'featureType': options.featureType, 'featurePrefix': featurePrefix,
|
||||
'gmlVersion': gmlVersion, 'srsName': options.srsName},
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_,
|
||||
WFS.TRANSACTION_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Delete'), deletes,
|
||||
objectStack);
|
||||
}
|
||||
@@ -1053,7 +1053,7 @@ _ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
_ol_xml_.pushSerializeAndPop({node: node, 'featureNS': options.featureNS,
|
||||
'featureType': options.featureType, 'featurePrefix': featurePrefix,
|
||||
'gmlVersion': gmlVersion, 'srsName': options.srsName},
|
||||
_ol_format_WFS_.TRANSACTION_SERIALIZERS_,
|
||||
WFS.TRANSACTION_SERIALIZERS_,
|
||||
_ol_xml_.makeSimpleNodeFactory('Native'), options.nativeElements,
|
||||
objectStack);
|
||||
}
|
||||
@@ -1069,13 +1069,13 @@ _ol_format_WFS_.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
* @return {?ol.proj.Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readProjection;
|
||||
WFS.prototype.readProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readProjectionFromDocument = function(doc) {
|
||||
WFS.prototype.readProjectionFromDocument = function(doc) {
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readProjectionFromNode(n);
|
||||
@@ -1088,7 +1088,7 @@ _ol_format_WFS_.prototype.readProjectionFromDocument = function(doc) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WFS_.prototype.readProjectionFromNode = function(node) {
|
||||
WFS.prototype.readProjectionFromNode = function(node) {
|
||||
if (node.firstElementChild &&
|
||||
node.firstElementChild.firstElementChild) {
|
||||
node = node.firstElementChild.firstElementChild;
|
||||
@@ -1105,4 +1105,4 @@ _ol_format_WFS_.prototype.readProjectionFromNode = function(node) {
|
||||
|
||||
return null;
|
||||
};
|
||||
export default _ol_format_WFS_;
|
||||
export default WFS;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
@@ -26,11 +26,11 @@ import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||
* @param {olx.format.WKTOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_WKT_ = function(opt_options) {
|
||||
var WKT = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
_ol_format_TextFeature_.call(this);
|
||||
TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* Split GeometryCollection into multiple features.
|
||||
@@ -42,35 +42,35 @@ var _ol_format_WKT_ = function(opt_options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_format_WKT_, _ol_format_TextFeature_);
|
||||
inherits(WKT, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WKT_.EMPTY = 'EMPTY';
|
||||
WKT.EMPTY = 'EMPTY';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WKT_.Z = 'Z';
|
||||
WKT.Z = 'Z';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WKT_.M = 'M';
|
||||
WKT.M = 'M';
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_WKT_.ZM = 'ZM';
|
||||
WKT.ZM = 'ZM';
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,7 @@ _ol_format_WKT_.ZM = 'ZM';
|
||||
* @return {string} Coordinates part of Point as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodePointGeometry_ = function(geom) {
|
||||
WKT.encodePointGeometry_ = function(geom) {
|
||||
var coordinates = geom.getCoordinates();
|
||||
if (coordinates.length === 0) {
|
||||
return '';
|
||||
@@ -92,11 +92,11 @@ _ol_format_WKT_.encodePointGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of MultiPoint as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeMultiPointGeometry_ = function(geom) {
|
||||
WKT.encodeMultiPointGeometry_ = function(geom) {
|
||||
var array = [];
|
||||
var components = geom.getPoints();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
array.push('(' + _ol_format_WKT_.encodePointGeometry_(components[i]) + ')');
|
||||
array.push('(' + WKT.encodePointGeometry_(components[i]) + ')');
|
||||
}
|
||||
return array.join(',');
|
||||
};
|
||||
@@ -107,11 +107,11 @@ _ol_format_WKT_.encodeMultiPointGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of GeometryCollection as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeGeometryCollectionGeometry_ = function(geom) {
|
||||
WKT.encodeGeometryCollectionGeometry_ = function(geom) {
|
||||
var array = [];
|
||||
var geoms = geom.getGeometries();
|
||||
for (var i = 0, ii = geoms.length; i < ii; ++i) {
|
||||
array.push(_ol_format_WKT_.encode_(geoms[i]));
|
||||
array.push(WKT.encode_(geoms[i]));
|
||||
}
|
||||
return array.join(',');
|
||||
};
|
||||
@@ -122,7 +122,7 @@ _ol_format_WKT_.encodeGeometryCollectionGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of LineString as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeLineStringGeometry_ = function(geom) {
|
||||
WKT.encodeLineStringGeometry_ = function(geom) {
|
||||
var coordinates = geom.getCoordinates();
|
||||
var array = [];
|
||||
for (var i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
@@ -137,11 +137,11 @@ _ol_format_WKT_.encodeLineStringGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of MultiLineString as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeMultiLineStringGeometry_ = function(geom) {
|
||||
WKT.encodeMultiLineStringGeometry_ = function(geom) {
|
||||
var array = [];
|
||||
var components = geom.getLineStrings();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
array.push('(' + _ol_format_WKT_.encodeLineStringGeometry_(
|
||||
array.push('(' + WKT.encodeLineStringGeometry_(
|
||||
components[i]) + ')');
|
||||
}
|
||||
return array.join(',');
|
||||
@@ -153,11 +153,11 @@ _ol_format_WKT_.encodeMultiLineStringGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of Polygon as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodePolygonGeometry_ = function(geom) {
|
||||
WKT.encodePolygonGeometry_ = function(geom) {
|
||||
var array = [];
|
||||
var rings = geom.getLinearRings();
|
||||
for (var i = 0, ii = rings.length; i < ii; ++i) {
|
||||
array.push('(' + _ol_format_WKT_.encodeLineStringGeometry_(
|
||||
array.push('(' + WKT.encodeLineStringGeometry_(
|
||||
rings[i]) + ')');
|
||||
}
|
||||
return array.join(',');
|
||||
@@ -169,11 +169,11 @@ _ol_format_WKT_.encodePolygonGeometry_ = function(geom) {
|
||||
* @return {string} Coordinates part of MultiPolygon as WKT.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeMultiPolygonGeometry_ = function(geom) {
|
||||
WKT.encodeMultiPolygonGeometry_ = function(geom) {
|
||||
var array = [];
|
||||
var components = geom.getPolygons();
|
||||
for (var i = 0, ii = components.length; i < ii; ++i) {
|
||||
array.push('(' + _ol_format_WKT_.encodePolygonGeometry_(
|
||||
array.push('(' + WKT.encodePolygonGeometry_(
|
||||
components[i]) + ')');
|
||||
}
|
||||
return array.join(',');
|
||||
@@ -184,14 +184,14 @@ _ol_format_WKT_.encodeMultiPolygonGeometry_ = function(geom) {
|
||||
* @return {string} Potential dimensional information for WKT type.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encodeGeometryLayout_ = function(geom) {
|
||||
WKT.encodeGeometryLayout_ = function(geom) {
|
||||
var layout = geom.getLayout();
|
||||
var dimInfo = '';
|
||||
if (layout === GeometryLayout.XYZ || layout === GeometryLayout.XYZM) {
|
||||
dimInfo += _ol_format_WKT_.Z;
|
||||
dimInfo += WKT.Z;
|
||||
}
|
||||
if (layout === GeometryLayout.XYM || layout === GeometryLayout.XYZM) {
|
||||
dimInfo += _ol_format_WKT_.M;
|
||||
dimInfo += WKT.M;
|
||||
}
|
||||
return dimInfo;
|
||||
};
|
||||
@@ -203,19 +203,19 @@ _ol_format_WKT_.encodeGeometryLayout_ = function(geom) {
|
||||
* @return {string} WKT string for the geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.encode_ = function(geom) {
|
||||
WKT.encode_ = function(geom) {
|
||||
var type = geom.getType();
|
||||
var geometryEncoder = _ol_format_WKT_.GeometryEncoder_[type];
|
||||
var geometryEncoder = WKT.GeometryEncoder_[type];
|
||||
var enc = geometryEncoder(geom);
|
||||
type = type.toUpperCase();
|
||||
if (geom instanceof SimpleGeometry) {
|
||||
var dimInfo = _ol_format_WKT_.encodeGeometryLayout_(geom);
|
||||
var dimInfo = WKT.encodeGeometryLayout_(geom);
|
||||
if (dimInfo.length > 0) {
|
||||
type += ' ' + dimInfo;
|
||||
}
|
||||
}
|
||||
if (enc.length === 0) {
|
||||
return type + ' ' + _ol_format_WKT_.EMPTY;
|
||||
return type + ' ' + WKT.EMPTY;
|
||||
}
|
||||
return type + '(' + enc + ')';
|
||||
};
|
||||
@@ -226,14 +226,14 @@ _ol_format_WKT_.encode_ = function(geom) {
|
||||
* @type {Object.<string, function(ol.geom.Geometry): string>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.GeometryEncoder_ = {
|
||||
'Point': _ol_format_WKT_.encodePointGeometry_,
|
||||
'LineString': _ol_format_WKT_.encodeLineStringGeometry_,
|
||||
'Polygon': _ol_format_WKT_.encodePolygonGeometry_,
|
||||
'MultiPoint': _ol_format_WKT_.encodeMultiPointGeometry_,
|
||||
'MultiLineString': _ol_format_WKT_.encodeMultiLineStringGeometry_,
|
||||
'MultiPolygon': _ol_format_WKT_.encodeMultiPolygonGeometry_,
|
||||
'GeometryCollection': _ol_format_WKT_.encodeGeometryCollectionGeometry_
|
||||
WKT.GeometryEncoder_ = {
|
||||
'Point': WKT.encodePointGeometry_,
|
||||
'LineString': WKT.encodeLineStringGeometry_,
|
||||
'Polygon': WKT.encodePolygonGeometry_,
|
||||
'MultiPoint': WKT.encodeMultiPointGeometry_,
|
||||
'MultiLineString': WKT.encodeMultiLineStringGeometry_,
|
||||
'MultiPolygon': WKT.encodeMultiPolygonGeometry_,
|
||||
'GeometryCollection': WKT.encodeGeometryCollectionGeometry_
|
||||
};
|
||||
|
||||
|
||||
@@ -244,9 +244,9 @@ _ol_format_WKT_.GeometryEncoder_ = {
|
||||
* The geometry created.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.prototype.parse_ = function(wkt) {
|
||||
var lexer = new _ol_format_WKT_.Lexer(wkt);
|
||||
var parser = new _ol_format_WKT_.Parser(lexer);
|
||||
WKT.prototype.parse_ = function(wkt) {
|
||||
var lexer = new WKT.Lexer(wkt);
|
||||
var parser = new WKT.Parser(lexer);
|
||||
return parser.parse();
|
||||
};
|
||||
|
||||
@@ -260,13 +260,13 @@ _ol_format_WKT_.prototype.parse_ = function(wkt) {
|
||||
* @return {ol.Feature} Feature.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readFeature;
|
||||
WKT.prototype.readFeature;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
WKT.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
var geom = this.readGeometryFromText(text, opt_options);
|
||||
if (geom) {
|
||||
var feature = new _ol_Feature_();
|
||||
@@ -286,13 +286,13 @@ _ol_format_WKT_.prototype.readFeatureFromText = function(text, opt_options) {
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readFeatures;
|
||||
WKT.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
WKT.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
var geometries = [];
|
||||
var geometry = this.readGeometryFromText(text, opt_options);
|
||||
if (this.splitCollection_ &&
|
||||
@@ -321,17 +321,17 @@ _ol_format_WKT_.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readGeometry;
|
||||
WKT.prototype.readGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
var geometry = this.parse_(text);
|
||||
if (geometry) {
|
||||
return (
|
||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(geometry, false, opt_options)
|
||||
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(geometry, false, opt_options)
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
@@ -348,13 +348,13 @@ _ol_format_WKT_.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
* @return {string} WKT string.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeFeature;
|
||||
WKT.prototype.writeFeature;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeFeatureText = function(feature, opt_options) {
|
||||
WKT.prototype.writeFeatureText = function(feature, opt_options) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
return this.writeGeometryText(geometry, opt_options);
|
||||
@@ -372,13 +372,13 @@ _ol_format_WKT_.prototype.writeFeatureText = function(feature, opt_options) {
|
||||
* @return {string} WKT string.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeFeatures;
|
||||
WKT.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
WKT.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
if (features.length == 1) {
|
||||
return this.writeFeatureText(features[0], opt_options);
|
||||
}
|
||||
@@ -400,15 +400,15 @@ _ol_format_WKT_.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
* @return {string} WKT string.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeGeometry;
|
||||
WKT.prototype.writeGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WKT_.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
return _ol_format_WKT_.encode_(/** @type {ol.geom.Geometry} */ (
|
||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)));
|
||||
WKT.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
return WKT.encode_(/** @type {ol.geom.Geometry} */ (
|
||||
FeatureFormat.transformWithOptions(geometry, true, opt_options)));
|
||||
};
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ _ol_format_WKT_.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
* @enum {number}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.TokenType_ = {
|
||||
WKT.TokenType_ = {
|
||||
TEXT: 1,
|
||||
LEFT_PAREN: 2,
|
||||
RIGHT_PAREN: 3,
|
||||
@@ -433,7 +433,7 @@ _ol_format_WKT_.TokenType_ = {
|
||||
* @constructor
|
||||
* @protected
|
||||
*/
|
||||
_ol_format_WKT_.Lexer = function(wkt) {
|
||||
WKT.Lexer = function(wkt) {
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
@@ -453,7 +453,7 @@ _ol_format_WKT_.Lexer = function(wkt) {
|
||||
* @return {boolean} Whether the character is alphabetic.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.isAlpha_ = function(c) {
|
||||
WKT.Lexer.prototype.isAlpha_ = function(c) {
|
||||
return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
|
||||
};
|
||||
|
||||
@@ -465,7 +465,7 @@ _ol_format_WKT_.Lexer.prototype.isAlpha_ = function(c) {
|
||||
* @return {boolean} Whether the character is numeric.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.isNumeric_ = function(c, opt_decimal) {
|
||||
WKT.Lexer.prototype.isNumeric_ = function(c, opt_decimal) {
|
||||
var decimal = opt_decimal !== undefined ? opt_decimal : false;
|
||||
return c >= '0' && c <= '9' || c == '.' && !decimal;
|
||||
};
|
||||
@@ -476,7 +476,7 @@ _ol_format_WKT_.Lexer.prototype.isNumeric_ = function(c, opt_decimal) {
|
||||
* @return {boolean} Whether the character is whitespace.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.isWhiteSpace_ = function(c) {
|
||||
WKT.Lexer.prototype.isWhiteSpace_ = function(c) {
|
||||
return c == ' ' || c == '\t' || c == '\r' || c == '\n';
|
||||
};
|
||||
|
||||
@@ -485,7 +485,7 @@ _ol_format_WKT_.Lexer.prototype.isWhiteSpace_ = function(c) {
|
||||
* @return {string} Next string character.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.nextChar_ = function() {
|
||||
WKT.Lexer.prototype.nextChar_ = function() {
|
||||
return this.wkt.charAt(++this.index_);
|
||||
};
|
||||
|
||||
@@ -494,26 +494,26 @@ _ol_format_WKT_.Lexer.prototype.nextChar_ = function() {
|
||||
* Fetch and return the next token.
|
||||
* @return {!ol.WKTToken} Next string token.
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.nextToken = function() {
|
||||
WKT.Lexer.prototype.nextToken = function() {
|
||||
var c = this.nextChar_();
|
||||
var token = {position: this.index_, value: c};
|
||||
|
||||
if (c == '(') {
|
||||
token.type = _ol_format_WKT_.TokenType_.LEFT_PAREN;
|
||||
token.type = WKT.TokenType_.LEFT_PAREN;
|
||||
} else if (c == ',') {
|
||||
token.type = _ol_format_WKT_.TokenType_.COMMA;
|
||||
token.type = WKT.TokenType_.COMMA;
|
||||
} else if (c == ')') {
|
||||
token.type = _ol_format_WKT_.TokenType_.RIGHT_PAREN;
|
||||
token.type = WKT.TokenType_.RIGHT_PAREN;
|
||||
} else if (this.isNumeric_(c) || c == '-') {
|
||||
token.type = _ol_format_WKT_.TokenType_.NUMBER;
|
||||
token.type = WKT.TokenType_.NUMBER;
|
||||
token.value = this.readNumber_();
|
||||
} else if (this.isAlpha_(c)) {
|
||||
token.type = _ol_format_WKT_.TokenType_.TEXT;
|
||||
token.type = WKT.TokenType_.TEXT;
|
||||
token.value = this.readText_();
|
||||
} else if (this.isWhiteSpace_(c)) {
|
||||
return this.nextToken();
|
||||
} else if (c === '') {
|
||||
token.type = _ol_format_WKT_.TokenType_.EOF;
|
||||
token.type = WKT.TokenType_.EOF;
|
||||
} else {
|
||||
throw new Error('Unexpected character: ' + c);
|
||||
}
|
||||
@@ -526,7 +526,7 @@ _ol_format_WKT_.Lexer.prototype.nextToken = function() {
|
||||
* @return {number} Numeric token value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.readNumber_ = function() {
|
||||
WKT.Lexer.prototype.readNumber_ = function() {
|
||||
var c, index = this.index_;
|
||||
var decimal = false;
|
||||
var scientificNotation = false;
|
||||
@@ -554,7 +554,7 @@ _ol_format_WKT_.Lexer.prototype.readNumber_ = function() {
|
||||
* @return {string} String token value.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Lexer.prototype.readText_ = function() {
|
||||
WKT.Lexer.prototype.readText_ = function() {
|
||||
var c, index = this.index_;
|
||||
do {
|
||||
c = this.nextChar_();
|
||||
@@ -569,7 +569,7 @@ _ol_format_WKT_.Lexer.prototype.readText_ = function() {
|
||||
* @constructor
|
||||
* @protected
|
||||
*/
|
||||
_ol_format_WKT_.Parser = function(lexer) {
|
||||
WKT.Parser = function(lexer) {
|
||||
|
||||
/**
|
||||
* @type {ol.format.WKT.Lexer}
|
||||
@@ -595,7 +595,7 @@ _ol_format_WKT_.Parser = function(lexer) {
|
||||
* Fetch the next token form the lexer and replace the active token.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.consume_ = function() {
|
||||
WKT.Parser.prototype.consume_ = function() {
|
||||
this.token_ = this.lexer_.nextToken();
|
||||
};
|
||||
|
||||
@@ -604,7 +604,7 @@ _ol_format_WKT_.Parser.prototype.consume_ = function() {
|
||||
* @param {ol.format.WKT.TokenType_} type Token type.
|
||||
* @return {boolean} Whether the token matches the given type.
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.isTokenType = function(type) {
|
||||
WKT.Parser.prototype.isTokenType = function(type) {
|
||||
var isMatch = this.token_.type == type;
|
||||
return isMatch;
|
||||
};
|
||||
@@ -615,7 +615,7 @@ _ol_format_WKT_.Parser.prototype.isTokenType = function(type) {
|
||||
* @param {ol.format.WKT.TokenType_} type Token type.
|
||||
* @return {boolean} Whether the token matches the given type.
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.match = function(type) {
|
||||
WKT.Parser.prototype.match = function(type) {
|
||||
var isMatch = this.isTokenType(type);
|
||||
if (isMatch) {
|
||||
this.consume_();
|
||||
@@ -628,7 +628,7 @@ _ol_format_WKT_.Parser.prototype.match = function(type) {
|
||||
* Try to parse the tokens provided by the lexer.
|
||||
* @return {ol.geom.Geometry} The geometry.
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parse = function() {
|
||||
WKT.Parser.prototype.parse = function() {
|
||||
this.consume_();
|
||||
var geometry = this.parseGeometry_();
|
||||
return geometry;
|
||||
@@ -640,16 +640,16 @@ _ol_format_WKT_.Parser.prototype.parse = function() {
|
||||
* @return {ol.geom.GeometryLayout} The layout.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseGeometryLayout_ = function() {
|
||||
WKT.Parser.prototype.parseGeometryLayout_ = function() {
|
||||
var layout = GeometryLayout.XY;
|
||||
var dimToken = this.token_;
|
||||
if (this.isTokenType(_ol_format_WKT_.TokenType_.TEXT)) {
|
||||
if (this.isTokenType(WKT.TokenType_.TEXT)) {
|
||||
var dimInfo = dimToken.value;
|
||||
if (dimInfo === _ol_format_WKT_.Z) {
|
||||
if (dimInfo === WKT.Z) {
|
||||
layout = GeometryLayout.XYZ;
|
||||
} else if (dimInfo === _ol_format_WKT_.M) {
|
||||
} else if (dimInfo === WKT.M) {
|
||||
layout = GeometryLayout.XYM;
|
||||
} else if (dimInfo === _ol_format_WKT_.ZM) {
|
||||
} else if (dimInfo === WKT.ZM) {
|
||||
layout = GeometryLayout.XYZM;
|
||||
}
|
||||
if (layout !== GeometryLayout.XY) {
|
||||
@@ -664,17 +664,17 @@ _ol_format_WKT_.Parser.prototype.parseGeometryLayout_ = function() {
|
||||
* @return {!ol.geom.Geometry} The geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseGeometry_ = function() {
|
||||
WKT.Parser.prototype.parseGeometry_ = function() {
|
||||
var token = this.token_;
|
||||
if (this.match(_ol_format_WKT_.TokenType_.TEXT)) {
|
||||
if (this.match(WKT.TokenType_.TEXT)) {
|
||||
var geomType = token.value;
|
||||
this.layout_ = this.parseGeometryLayout_();
|
||||
if (geomType == GeometryType.GEOMETRY_COLLECTION.toUpperCase()) {
|
||||
var geometries = this.parseGeometryCollectionText_();
|
||||
return new GeometryCollection(geometries);
|
||||
} else {
|
||||
var parser = _ol_format_WKT_.Parser.GeometryParser_[geomType];
|
||||
var ctor = _ol_format_WKT_.Parser.GeometryConstructor_[geomType];
|
||||
var parser = WKT.Parser.GeometryParser_[geomType];
|
||||
var ctor = WKT.Parser.GeometryConstructor_[geomType];
|
||||
if (!parser || !ctor) {
|
||||
throw new Error('Invalid geometry type: ' + geomType);
|
||||
}
|
||||
@@ -690,13 +690,13 @@ _ol_format_WKT_.Parser.prototype.parseGeometry_ = function() {
|
||||
* @return {!Array.<ol.geom.Geometry>} A collection of geometries.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseGeometryCollectionText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parseGeometryCollectionText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var geometries = [];
|
||||
do {
|
||||
geometries.push(this.parseGeometry_());
|
||||
} while (this.match(_ol_format_WKT_.TokenType_.COMMA));
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
} while (this.match(WKT.TokenType_.COMMA));
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return geometries;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -710,10 +710,10 @@ _ol_format_WKT_.Parser.prototype.parseGeometryCollectionText_ = function() {
|
||||
* @return {Array.<number>} All values in a point.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePointText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parsePointText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates = this.parsePoint_();
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -727,10 +727,10 @@ _ol_format_WKT_.Parser.prototype.parsePointText_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} All points in a linestring.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseLineStringText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parseLineStringText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates = this.parsePointList_();
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -744,10 +744,10 @@ _ol_format_WKT_.Parser.prototype.parseLineStringText_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} All points in a polygon.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePolygonText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parsePolygonText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates = this.parseLineStringTextList_();
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -761,15 +761,15 @@ _ol_format_WKT_.Parser.prototype.parsePolygonText_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} All points in a multipoint.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseMultiPointText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parseMultiPointText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates;
|
||||
if (this.token_.type == _ol_format_WKT_.TokenType_.LEFT_PAREN) {
|
||||
if (this.token_.type == WKT.TokenType_.LEFT_PAREN) {
|
||||
coordinates = this.parsePointTextList_();
|
||||
} else {
|
||||
coordinates = this.parsePointList_();
|
||||
}
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -784,10 +784,10 @@ _ol_format_WKT_.Parser.prototype.parseMultiPointText_ = function() {
|
||||
* in a multilinestring.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseMultiLineStringText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parseMultiLineStringText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates = this.parseLineStringTextList_();
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -801,10 +801,10 @@ _ol_format_WKT_.Parser.prototype.parseMultiLineStringText_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} All polygon points in a multipolygon.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseMultiPolygonText_ = function() {
|
||||
if (this.match(_ol_format_WKT_.TokenType_.LEFT_PAREN)) {
|
||||
WKT.Parser.prototype.parseMultiPolygonText_ = function() {
|
||||
if (this.match(WKT.TokenType_.LEFT_PAREN)) {
|
||||
var coordinates = this.parsePolygonTextList_();
|
||||
if (this.match(_ol_format_WKT_.TokenType_.RIGHT_PAREN)) {
|
||||
if (this.match(WKT.TokenType_.RIGHT_PAREN)) {
|
||||
return coordinates;
|
||||
}
|
||||
} else if (this.isEmptyGeometry_()) {
|
||||
@@ -818,12 +818,12 @@ _ol_format_WKT_.Parser.prototype.parseMultiPolygonText_ = function() {
|
||||
* @return {!Array.<number>} A point.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePoint_ = function() {
|
||||
WKT.Parser.prototype.parsePoint_ = function() {
|
||||
var coordinates = [];
|
||||
var dimensions = this.layout_.length;
|
||||
for (var i = 0; i < dimensions; ++i) {
|
||||
var token = this.token_;
|
||||
if (this.match(_ol_format_WKT_.TokenType_.NUMBER)) {
|
||||
if (this.match(WKT.TokenType_.NUMBER)) {
|
||||
coordinates.push(token.value);
|
||||
} else {
|
||||
break;
|
||||
@@ -840,9 +840,9 @@ _ol_format_WKT_.Parser.prototype.parsePoint_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePointList_ = function() {
|
||||
WKT.Parser.prototype.parsePointList_ = function() {
|
||||
var coordinates = [this.parsePoint_()];
|
||||
while (this.match(_ol_format_WKT_.TokenType_.COMMA)) {
|
||||
while (this.match(WKT.TokenType_.COMMA)) {
|
||||
coordinates.push(this.parsePoint_());
|
||||
}
|
||||
return coordinates;
|
||||
@@ -853,9 +853,9 @@ _ol_format_WKT_.Parser.prototype.parsePointList_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePointTextList_ = function() {
|
||||
WKT.Parser.prototype.parsePointTextList_ = function() {
|
||||
var coordinates = [this.parsePointText_()];
|
||||
while (this.match(_ol_format_WKT_.TokenType_.COMMA)) {
|
||||
while (this.match(WKT.TokenType_.COMMA)) {
|
||||
coordinates.push(this.parsePointText_());
|
||||
}
|
||||
return coordinates;
|
||||
@@ -866,9 +866,9 @@ _ol_format_WKT_.Parser.prototype.parsePointTextList_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parseLineStringTextList_ = function() {
|
||||
WKT.Parser.prototype.parseLineStringTextList_ = function() {
|
||||
var coordinates = [this.parseLineStringText_()];
|
||||
while (this.match(_ol_format_WKT_.TokenType_.COMMA)) {
|
||||
while (this.match(WKT.TokenType_.COMMA)) {
|
||||
coordinates.push(this.parseLineStringText_());
|
||||
}
|
||||
return coordinates;
|
||||
@@ -879,9 +879,9 @@ _ol_format_WKT_.Parser.prototype.parseLineStringTextList_ = function() {
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.parsePolygonTextList_ = function() {
|
||||
WKT.Parser.prototype.parsePolygonTextList_ = function() {
|
||||
var coordinates = [this.parsePolygonText_()];
|
||||
while (this.match(_ol_format_WKT_.TokenType_.COMMA)) {
|
||||
while (this.match(WKT.TokenType_.COMMA)) {
|
||||
coordinates.push(this.parsePolygonText_());
|
||||
}
|
||||
return coordinates;
|
||||
@@ -892,9 +892,9 @@ _ol_format_WKT_.Parser.prototype.parsePolygonTextList_ = function() {
|
||||
* @return {boolean} Whether the token implies an empty geometry.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.isEmptyGeometry_ = function() {
|
||||
var isEmpty = this.isTokenType(_ol_format_WKT_.TokenType_.TEXT) &&
|
||||
this.token_.value == _ol_format_WKT_.EMPTY;
|
||||
WKT.Parser.prototype.isEmptyGeometry_ = function() {
|
||||
var isEmpty = this.isTokenType(WKT.TokenType_.TEXT) &&
|
||||
this.token_.value == WKT.EMPTY;
|
||||
if (isEmpty) {
|
||||
this.consume_();
|
||||
}
|
||||
@@ -907,7 +907,7 @@ _ol_format_WKT_.Parser.prototype.isEmptyGeometry_ = function() {
|
||||
* @return {string} Error message.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() {
|
||||
WKT.Parser.prototype.formatErrorMessage_ = function() {
|
||||
return 'Unexpected `' + this.token_.value + '` at position ' +
|
||||
this.token_.position + ' in `' + this.lexer_.wkt + '`';
|
||||
};
|
||||
@@ -917,7 +917,7 @@ _ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() {
|
||||
* @enum {function (new:ol.geom.Geometry, Array, ol.geom.GeometryLayout)}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.GeometryConstructor_ = {
|
||||
WKT.Parser.GeometryConstructor_ = {
|
||||
'POINT': Point,
|
||||
'LINESTRING': LineString,
|
||||
'POLYGON': Polygon,
|
||||
@@ -931,12 +931,12 @@ _ol_format_WKT_.Parser.GeometryConstructor_ = {
|
||||
* @enum {(function(): Array)}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WKT_.Parser.GeometryParser_ = {
|
||||
'POINT': _ol_format_WKT_.Parser.prototype.parsePointText_,
|
||||
'LINESTRING': _ol_format_WKT_.Parser.prototype.parseLineStringText_,
|
||||
'POLYGON': _ol_format_WKT_.Parser.prototype.parsePolygonText_,
|
||||
'MULTIPOINT': _ol_format_WKT_.Parser.prototype.parseMultiPointText_,
|
||||
'MULTILINESTRING': _ol_format_WKT_.Parser.prototype.parseMultiLineStringText_,
|
||||
'MULTIPOLYGON': _ol_format_WKT_.Parser.prototype.parseMultiPolygonText_
|
||||
WKT.Parser.GeometryParser_ = {
|
||||
'POINT': WKT.Parser.prototype.parsePointText_,
|
||||
'LINESTRING': WKT.Parser.prototype.parseLineStringText_,
|
||||
'POLYGON': WKT.Parser.prototype.parsePolygonText_,
|
||||
'MULTIPOINT': WKT.Parser.prototype.parseMultiPointText_,
|
||||
'MULTILINESTRING': WKT.Parser.prototype.parseMultiLineStringText_,
|
||||
'MULTIPOLYGON': WKT.Parser.prototype.parseMultiPolygonText_
|
||||
};
|
||||
export default _ol_format_WKT_;
|
||||
export default WKT;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* @module ol/format/WMSCapabilities
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_format_XLink_ from '../format/XLink.js';
|
||||
import _ol_format_XML_ from '../format/XML.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import XLink from '../format/XLink.js';
|
||||
import XML from '../format/XML.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
/**
|
||||
@@ -15,9 +15,9 @@ import _ol_xml_ from '../xml.js';
|
||||
* @extends {ol.format.XML}
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_WMSCapabilities_ = function() {
|
||||
var WMSCapabilities = function() {
|
||||
|
||||
_ol_format_XML_.call(this);
|
||||
XML.call(this);
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
@@ -25,7 +25,7 @@ var _ol_format_WMSCapabilities_ = function() {
|
||||
this.version = undefined;
|
||||
};
|
||||
|
||||
inherits(_ol_format_WMSCapabilities_, _ol_format_XML_);
|
||||
inherits(WMSCapabilities, XML);
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,13 +36,13 @@ inherits(_ol_format_WMSCapabilities_, _ol_format_XML_);
|
||||
* @return {Object} An object representing the WMS capabilities.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.prototype.read;
|
||||
WMSCapabilities.prototype.read;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.prototype.readFromDocument = function(doc) {
|
||||
WMSCapabilities.prototype.readFromDocument = function(doc) {
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFromNode(n);
|
||||
@@ -55,11 +55,11 @@ _ol_format_WMSCapabilities_.prototype.readFromDocument = function(doc) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.prototype.readFromNode = function(node) {
|
||||
WMSCapabilities.prototype.readFromNode = function(node) {
|
||||
this.version = node.getAttribute('version').trim();
|
||||
var wmsCapabilityObject = _ol_xml_.pushParseAndPop({
|
||||
'version': this.version
|
||||
}, _ol_format_WMSCapabilities_.PARSERS_, node, []);
|
||||
}, WMSCapabilities.PARSERS_, node, []);
|
||||
return wmsCapabilityObject ? wmsCapabilityObject : null;
|
||||
};
|
||||
|
||||
@@ -70,9 +70,9 @@ _ol_format_WMSCapabilities_.prototype.readFromNode = function(node) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readAttribution_ = function(node, objectStack) {
|
||||
WMSCapabilities.readAttribution_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.ATTRIBUTION_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.ATTRIBUTION_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -82,17 +82,17 @@ _ol_format_WMSCapabilities_.readAttribution_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object} Bounding box object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readBoundingBox_ = function(node, objectStack) {
|
||||
WMSCapabilities.readBoundingBox_ = function(node, objectStack) {
|
||||
var extent = [
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('minx')),
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('miny')),
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('maxx')),
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('maxy'))
|
||||
XSD.readDecimalString(node.getAttribute('minx')),
|
||||
XSD.readDecimalString(node.getAttribute('miny')),
|
||||
XSD.readDecimalString(node.getAttribute('maxx')),
|
||||
XSD.readDecimalString(node.getAttribute('maxy'))
|
||||
];
|
||||
|
||||
var resolutions = [
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('resx')),
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('resy'))
|
||||
XSD.readDecimalString(node.getAttribute('resx')),
|
||||
XSD.readDecimalString(node.getAttribute('resy'))
|
||||
];
|
||||
|
||||
return {
|
||||
@@ -109,10 +109,10 @@ _ol_format_WMSCapabilities_.readBoundingBox_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {ol.Extent|undefined} Bounding box object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
||||
WMSCapabilities.readEXGeographicBoundingBox_ = function(node, objectStack) {
|
||||
var geographicBoundingBox = _ol_xml_.pushParseAndPop(
|
||||
{},
|
||||
_ol_format_WMSCapabilities_.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
|
||||
WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_,
|
||||
node, objectStack);
|
||||
if (!geographicBoundingBox) {
|
||||
return undefined;
|
||||
@@ -142,9 +142,9 @@ _ol_format_WMSCapabilities_.readEXGeographicBoundingBox_ = function(node, object
|
||||
* @private
|
||||
* @return {Object|undefined} Capability object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readCapability_ = function(node, objectStack) {
|
||||
WMSCapabilities.readCapability_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.CAPABILITY_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.CAPABILITY_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -154,9 +154,9 @@ _ol_format_WMSCapabilities_.readCapability_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} Service object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readService_ = function(node, objectStack) {
|
||||
WMSCapabilities.readService_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.SERVICE_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.SERVICE_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -166,9 +166,9 @@ _ol_format_WMSCapabilities_.readService_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} Contact information object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readContactInformation_ = function(node, objectStack) {
|
||||
WMSCapabilities.readContactInformation_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.CONTACT_INFORMATION_PARSERS_,
|
||||
{}, WMSCapabilities.CONTACT_INFORMATION_PARSERS_,
|
||||
node, objectStack);
|
||||
};
|
||||
|
||||
@@ -179,9 +179,9 @@ _ol_format_WMSCapabilities_.readContactInformation_ = function(node, objectStack
|
||||
* @private
|
||||
* @return {Object|undefined} Contact person object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readContactPersonPrimary_ = function(node, objectStack) {
|
||||
WMSCapabilities.readContactPersonPrimary_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.CONTACT_PERSON_PARSERS_,
|
||||
{}, WMSCapabilities.CONTACT_PERSON_PARSERS_,
|
||||
node, objectStack);
|
||||
};
|
||||
|
||||
@@ -192,9 +192,9 @@ _ol_format_WMSCapabilities_.readContactPersonPrimary_ = function(node, objectSta
|
||||
* @private
|
||||
* @return {Object|undefined} Contact address object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readContactAddress_ = function(node, objectStack) {
|
||||
WMSCapabilities.readContactAddress_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.CONTACT_ADDRESS_PARSERS_,
|
||||
{}, WMSCapabilities.CONTACT_ADDRESS_PARSERS_,
|
||||
node, objectStack);
|
||||
};
|
||||
|
||||
@@ -205,9 +205,9 @@ _ol_format_WMSCapabilities_.readContactAddress_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Array.<string>|undefined} Format array.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readException_ = function(node, objectStack) {
|
||||
WMSCapabilities.readException_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
[], _ol_format_WMSCapabilities_.EXCEPTION_PARSERS_, node, objectStack);
|
||||
[], WMSCapabilities.EXCEPTION_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -217,9 +217,9 @@ _ol_format_WMSCapabilities_.readException_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readCapabilityLayer_ = function(node, objectStack) {
|
||||
WMSCapabilities.readCapabilityLayer_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.LAYER_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -229,52 +229,52 @@ _ol_format_WMSCapabilities_.readCapabilityLayer_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readLayer_ = function(node, objectStack) {
|
||||
WMSCapabilities.readLayer_ = function(node, objectStack) {
|
||||
var parentLayerObject = /** @type {Object.<string,*>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
|
||||
var layerObject = _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.LAYER_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.LAYER_PARSERS_, node, objectStack);
|
||||
|
||||
if (!layerObject) {
|
||||
return undefined;
|
||||
}
|
||||
var queryable =
|
||||
_ol_format_XSD_.readBooleanString(node.getAttribute('queryable'));
|
||||
XSD.readBooleanString(node.getAttribute('queryable'));
|
||||
if (queryable === undefined) {
|
||||
queryable = parentLayerObject['queryable'];
|
||||
}
|
||||
layerObject['queryable'] = queryable !== undefined ? queryable : false;
|
||||
|
||||
var cascaded = _ol_format_XSD_.readNonNegativeIntegerString(
|
||||
var cascaded = XSD.readNonNegativeIntegerString(
|
||||
node.getAttribute('cascaded'));
|
||||
if (cascaded === undefined) {
|
||||
cascaded = parentLayerObject['cascaded'];
|
||||
}
|
||||
layerObject['cascaded'] = cascaded;
|
||||
|
||||
var opaque = _ol_format_XSD_.readBooleanString(node.getAttribute('opaque'));
|
||||
var opaque = XSD.readBooleanString(node.getAttribute('opaque'));
|
||||
if (opaque === undefined) {
|
||||
opaque = parentLayerObject['opaque'];
|
||||
}
|
||||
layerObject['opaque'] = opaque !== undefined ? opaque : false;
|
||||
|
||||
var noSubsets =
|
||||
_ol_format_XSD_.readBooleanString(node.getAttribute('noSubsets'));
|
||||
XSD.readBooleanString(node.getAttribute('noSubsets'));
|
||||
if (noSubsets === undefined) {
|
||||
noSubsets = parentLayerObject['noSubsets'];
|
||||
}
|
||||
layerObject['noSubsets'] = noSubsets !== undefined ? noSubsets : false;
|
||||
|
||||
var fixedWidth =
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('fixedWidth'));
|
||||
XSD.readDecimalString(node.getAttribute('fixedWidth'));
|
||||
if (!fixedWidth) {
|
||||
fixedWidth = parentLayerObject['fixedWidth'];
|
||||
}
|
||||
layerObject['fixedWidth'] = fixedWidth;
|
||||
|
||||
var fixedHeight =
|
||||
_ol_format_XSD_.readDecimalString(node.getAttribute('fixedHeight'));
|
||||
XSD.readDecimalString(node.getAttribute('fixedHeight'));
|
||||
if (!fixedHeight) {
|
||||
fixedHeight = parentLayerObject['fixedHeight'];
|
||||
}
|
||||
@@ -308,18 +308,18 @@ _ol_format_WMSCapabilities_.readLayer_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object} Dimension object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readDimension_ = function(node, objectStack) {
|
||||
WMSCapabilities.readDimension_ = function(node, objectStack) {
|
||||
var dimensionObject = {
|
||||
'name': node.getAttribute('name'),
|
||||
'units': node.getAttribute('units'),
|
||||
'unitSymbol': node.getAttribute('unitSymbol'),
|
||||
'default': node.getAttribute('default'),
|
||||
'multipleValues': _ol_format_XSD_.readBooleanString(
|
||||
'multipleValues': XSD.readBooleanString(
|
||||
node.getAttribute('multipleValues')),
|
||||
'nearestValue': _ol_format_XSD_.readBooleanString(
|
||||
'nearestValue': XSD.readBooleanString(
|
||||
node.getAttribute('nearestValue')),
|
||||
'current': _ol_format_XSD_.readBooleanString(node.getAttribute('current')),
|
||||
'values': _ol_format_XSD_.readString(node)
|
||||
'current': XSD.readBooleanString(node.getAttribute('current')),
|
||||
'values': XSD.readString(node)
|
||||
};
|
||||
return dimensionObject;
|
||||
};
|
||||
@@ -331,9 +331,9 @@ _ol_format_WMSCapabilities_.readDimension_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_ = function(node, objectStack) {
|
||||
WMSCapabilities.readFormatOnlineresource_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.FORMAT_ONLINERESOURCE_PARSERS_,
|
||||
{}, WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_,
|
||||
node, objectStack);
|
||||
};
|
||||
|
||||
@@ -344,9 +344,9 @@ _ol_format_WMSCapabilities_.readFormatOnlineresource_ = function(node, objectSta
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Request object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readRequest_ = function(node, objectStack) {
|
||||
WMSCapabilities.readRequest_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.REQUEST_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.REQUEST_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -356,9 +356,9 @@ _ol_format_WMSCapabilities_.readRequest_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} DCP type object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readDCPType_ = function(node, objectStack) {
|
||||
WMSCapabilities.readDCPType_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.DCPTYPE_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.DCPTYPE_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -368,9 +368,9 @@ _ol_format_WMSCapabilities_.readDCPType_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} HTTP object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readHTTP_ = function(node, objectStack) {
|
||||
WMSCapabilities.readHTTP_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.HTTP_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.HTTP_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -380,9 +380,9 @@ _ol_format_WMSCapabilities_.readHTTP_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Operation type object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readOperationType_ = function(node, objectStack) {
|
||||
WMSCapabilities.readOperationType_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.OPERATIONTYPE_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.OPERATIONTYPE_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -392,13 +392,13 @@ _ol_format_WMSCapabilities_.readOperationType_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
||||
WMSCapabilities.readSizedFormatOnlineresource_ = function(node, objectStack) {
|
||||
var formatOnlineresource =
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
|
||||
WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||
if (formatOnlineresource) {
|
||||
var size = [
|
||||
_ol_format_XSD_.readNonNegativeIntegerString(node.getAttribute('width')),
|
||||
_ol_format_XSD_.readNonNegativeIntegerString(node.getAttribute('height'))
|
||||
XSD.readNonNegativeIntegerString(node.getAttribute('width')),
|
||||
XSD.readNonNegativeIntegerString(node.getAttribute('height'))
|
||||
];
|
||||
formatOnlineresource['size'] = size;
|
||||
return formatOnlineresource;
|
||||
@@ -413,9 +413,9 @@ _ol_format_WMSCapabilities_.readSizedFormatOnlineresource_ = function(node, obje
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Authority URL object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readAuthorityURL_ = function(node, objectStack) {
|
||||
WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
|
||||
var authorityObject =
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
|
||||
WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||
if (authorityObject) {
|
||||
authorityObject['name'] = node.getAttribute('name');
|
||||
return authorityObject;
|
||||
@@ -430,9 +430,9 @@ _ol_format_WMSCapabilities_.readAuthorityURL_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Metadata URL object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readMetadataURL_ = function(node, objectStack) {
|
||||
WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
|
||||
var metadataObject =
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_(node, objectStack);
|
||||
WMSCapabilities.readFormatOnlineresource_(node, objectStack);
|
||||
if (metadataObject) {
|
||||
metadataObject['type'] = node.getAttribute('type');
|
||||
return metadataObject;
|
||||
@@ -447,9 +447,9 @@ _ol_format_WMSCapabilities_.readMetadataURL_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readStyle_ = function(node, objectStack) {
|
||||
WMSCapabilities.readStyle_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
{}, _ol_format_WMSCapabilities_.STYLE_PARSERS_, node, objectStack);
|
||||
{}, WMSCapabilities.STYLE_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -459,9 +459,9 @@ _ol_format_WMSCapabilities_.readStyle_ = function(node, objectStack) {
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Keyword list.
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.readKeywordList_ = function(node, objectStack) {
|
||||
WMSCapabilities.readKeywordList_ = function(node, objectStack) {
|
||||
return _ol_xml_.pushParseAndPop(
|
||||
[], _ol_format_WMSCapabilities_.KEYWORDLIST_PARSERS_, node, objectStack);
|
||||
[], WMSCapabilities.KEYWORDLIST_PARSERS_, node, objectStack);
|
||||
};
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ _ol_format_WMSCapabilities_.readKeywordList_ = function(node, objectStack) {
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_ = [
|
||||
WMSCapabilities.NAMESPACE_URIS_ = [
|
||||
null,
|
||||
'http://www.opengis.net/wms'
|
||||
];
|
||||
@@ -481,12 +481,12 @@ _ol_format_WMSCapabilities_.NAMESPACE_URIS_ = [
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Service': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readService_),
|
||||
WMSCapabilities.readService_),
|
||||
'Capability': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readCapability_)
|
||||
WMSCapabilities.readCapability_)
|
||||
});
|
||||
|
||||
|
||||
@@ -495,14 +495,14 @@ _ol_format_WMSCapabilities_.PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.CAPABILITY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.CAPABILITY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Request': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readRequest_),
|
||||
WMSCapabilities.readRequest_),
|
||||
'Exception': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readException_),
|
||||
WMSCapabilities.readException_),
|
||||
'Layer': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readCapabilityLayer_)
|
||||
WMSCapabilities.readCapabilityLayer_)
|
||||
});
|
||||
|
||||
|
||||
@@ -511,26 +511,26 @@ _ol_format_WMSCapabilities_.CAPABILITY_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.SERVICE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.SERVICE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'KeywordList': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readKeywordList_),
|
||||
WMSCapabilities.readKeywordList_),
|
||||
'OnlineResource': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XLink_.readHref),
|
||||
XLink.readHref),
|
||||
'ContactInformation': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readContactInformation_),
|
||||
'Fees': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.readContactInformation_),
|
||||
'Fees': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'AccessConstraints': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'LayerLimit': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MaxWidth': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MaxHeight': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger)
|
||||
XSD.readNonNegativeInteger)
|
||||
});
|
||||
|
||||
|
||||
@@ -539,20 +539,20 @@ _ol_format_WMSCapabilities_.SERVICE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.CONTACT_INFORMATION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.CONTACT_INFORMATION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'ContactPersonPrimary': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readContactPersonPrimary_),
|
||||
WMSCapabilities.readContactPersonPrimary_),
|
||||
'ContactPosition': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'ContactAddress': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readContactAddress_),
|
||||
WMSCapabilities.readContactAddress_),
|
||||
'ContactVoiceTelephone': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'ContactFacsimileTelephone': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'ContactElectronicMailAddress': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -561,12 +561,12 @@ _ol_format_WMSCapabilities_.CONTACT_INFORMATION_PARSERS_ = _ol_xml_.makeStructur
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'ContactPerson': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'ContactOrganization': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -575,15 +575,15 @@ _ol_format_WMSCapabilities_.CONTACT_PERSON_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'AddressType': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Address': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'City': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'AddressType': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Address': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'City': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'StateOrProvince': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
'PostCode': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Country': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString)
|
||||
XSD.readString),
|
||||
'PostCode': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Country': _ol_xml_.makeObjectPropertySetter(XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -592,9 +592,9 @@ _ol_format_WMSCapabilities_.CONTACT_ADDRESS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeArrayPusher(_ol_format_XSD_.readString)
|
||||
WMSCapabilities.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeArrayPusher(XSD.readString)
|
||||
});
|
||||
|
||||
|
||||
@@ -603,39 +603,39 @@ _ol_format_WMSCapabilities_.EXCEPTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'KeywordList': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readKeywordList_),
|
||||
'CRS': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.readKeywordList_),
|
||||
'CRS': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
|
||||
'EX_GeographicBoundingBox': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readEXGeographicBoundingBox_),
|
||||
WMSCapabilities.readEXGeographicBoundingBox_),
|
||||
'BoundingBox': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readBoundingBox_),
|
||||
WMSCapabilities.readBoundingBox_),
|
||||
'Dimension': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readDimension_),
|
||||
WMSCapabilities.readDimension_),
|
||||
'Attribution': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readAttribution_),
|
||||
WMSCapabilities.readAttribution_),
|
||||
'AuthorityURL': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readAuthorityURL_),
|
||||
'Identifier': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.readAuthorityURL_),
|
||||
'Identifier': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
|
||||
'MetadataURL': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readMetadataURL_),
|
||||
WMSCapabilities.readMetadataURL_),
|
||||
'DataURL': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_),
|
||||
WMSCapabilities.readFormatOnlineresource_),
|
||||
'FeatureListURL': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_),
|
||||
WMSCapabilities.readFormatOnlineresource_),
|
||||
'Style': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readStyle_),
|
||||
WMSCapabilities.readStyle_),
|
||||
'MinScaleDenominator': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'MaxScaleDenominator': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'Layer': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readLayer_)
|
||||
WMSCapabilities.readLayer_)
|
||||
});
|
||||
|
||||
|
||||
@@ -644,13 +644,13 @@ _ol_format_WMSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'OnlineResource': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XLink_.readHref),
|
||||
XLink.readHref),
|
||||
'LogoURL': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_)
|
||||
WMSCapabilities.readSizedFormatOnlineresource_)
|
||||
});
|
||||
|
||||
|
||||
@@ -659,16 +659,16 @@ _ol_format_WMSCapabilities_.ATTRIBUTION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'westBoundLongitude': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'eastBoundLongitude': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'southBoundLatitude': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'northBoundLatitude': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal)
|
||||
XSD.readDecimal)
|
||||
});
|
||||
|
||||
|
||||
@@ -677,14 +677,14 @@ _ol_format_WMSCapabilities_.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.REQUEST_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.REQUEST_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'GetCapabilities': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readOperationType_),
|
||||
WMSCapabilities.readOperationType_),
|
||||
'GetMap': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readOperationType_),
|
||||
WMSCapabilities.readOperationType_),
|
||||
'GetFeatureInfo': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readOperationType_)
|
||||
WMSCapabilities.readOperationType_)
|
||||
});
|
||||
|
||||
|
||||
@@ -693,11 +693,11 @@ _ol_format_WMSCapabilities_.REQUEST_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.OPERATIONTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeObjectPropertyPusher(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.OPERATIONTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeObjectPropertyPusher(XSD.readString),
|
||||
'DCPType': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readDCPType_)
|
||||
WMSCapabilities.readDCPType_)
|
||||
});
|
||||
|
||||
|
||||
@@ -706,10 +706,10 @@ _ol_format_WMSCapabilities_.OPERATIONTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.DCPTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.DCPTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'HTTP': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readHTTP_)
|
||||
WMSCapabilities.readHTTP_)
|
||||
});
|
||||
|
||||
|
||||
@@ -718,12 +718,12 @@ _ol_format_WMSCapabilities_.DCPTYPE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
WMSCapabilities.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Get': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_),
|
||||
WMSCapabilities.readFormatOnlineresource_),
|
||||
'Post': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_)
|
||||
WMSCapabilities.readFormatOnlineresource_)
|
||||
});
|
||||
|
||||
|
||||
@@ -732,17 +732,17 @@ _ol_format_WMSCapabilities_.HTTP_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Name': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'LegendURL': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMSCapabilities_.readSizedFormatOnlineresource_),
|
||||
WMSCapabilities.readSizedFormatOnlineresource_),
|
||||
'StyleSheetURL': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_),
|
||||
WMSCapabilities.readFormatOnlineresource_),
|
||||
'StyleURL': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMSCapabilities_.readFormatOnlineresource_)
|
||||
WMSCapabilities.readFormatOnlineresource_)
|
||||
});
|
||||
|
||||
|
||||
@@ -751,11 +751,11 @@ _ol_format_WMSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.FORMAT_ONLINERESOURCE_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeObjectPropertySetter(_ol_format_XSD_.readString),
|
||||
WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ =
|
||||
_ol_xml_.makeStructureNS(WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Format': _ol_xml_.makeObjectPropertySetter(XSD.readString),
|
||||
'OnlineResource': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XLink_.readHref)
|
||||
XLink.readHref)
|
||||
});
|
||||
|
||||
|
||||
@@ -764,8 +764,8 @@ _ol_format_WMSCapabilities_.FORMAT_ONLINERESOURCE_PARSERS_ =
|
||||
* @type {Object.<string, Object.<string, ol.XmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSCapabilities_.KEYWORDLIST_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Keyword': _ol_xml_.makeArrayPusher(_ol_format_XSD_.readString)
|
||||
WMSCapabilities.KEYWORDLIST_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
WMSCapabilities.NAMESPACE_URIS_, {
|
||||
'Keyword': _ol_xml_.makeArrayPusher(XSD.readString)
|
||||
});
|
||||
export default _ol_format_WMSCapabilities_;
|
||||
export default WMSCapabilities;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_format_GML2_ from '../format/GML2.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import GML2 from '../format/GML2.js';
|
||||
import XMLFeature from '../format/XMLFeature.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
@@ -18,7 +18,7 @@ import _ol_xml_ from '../xml.js';
|
||||
* @param {olx.format.WMSGetFeatureInfoOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_WMSGetFeatureInfo_ = function(opt_options) {
|
||||
var WMSGetFeatureInfo = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -33,7 +33,7 @@ var _ol_format_WMSGetFeatureInfo_ = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.format.GML2}
|
||||
*/
|
||||
this.gmlFormat_ = new _ol_format_GML2_();
|
||||
this.gmlFormat_ = new GML2();
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,10 +42,10 @@ var _ol_format_WMSGetFeatureInfo_ = function(opt_options) {
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
_ol_format_XMLFeature_.call(this);
|
||||
XMLFeature.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_WMSGetFeatureInfo_, _ol_format_XMLFeature_);
|
||||
inherits(WMSGetFeatureInfo, XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ inherits(_ol_format_WMSGetFeatureInfo_, _ol_format_XMLFeature_);
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.featureIdentifier_ = '_feature';
|
||||
WMSGetFeatureInfo.featureIdentifier_ = '_feature';
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,13 +61,13 @@ _ol_format_WMSGetFeatureInfo_.featureIdentifier_ = '_feature';
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.layerIdentifier_ = '_layer';
|
||||
WMSGetFeatureInfo.layerIdentifier_ = '_layer';
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<string>} layers
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.getLayers = function() {
|
||||
WMSGetFeatureInfo.prototype.getLayers = function() {
|
||||
return this.layers_;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ _ol_format_WMSGetFeatureInfo_.prototype.getLayers = function() {
|
||||
/**
|
||||
* @param {Array.<string>} layers Layers to parse.
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.setLayers = function(layers) {
|
||||
WMSGetFeatureInfo.prototype.setLayers = function(layers) {
|
||||
this.layers_ = layers;
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ _ol_format_WMSGetFeatureInfo_.prototype.setLayers = function(layers) {
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.readFeatures_ = function(node, objectStack) {
|
||||
WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack) {
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
var localName = node.localName;
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
@@ -102,7 +102,7 @@ _ol_format_WMSGetFeatureInfo_.prototype.readFeatures_ = function(node, objectSta
|
||||
}
|
||||
var context = objectStack[0];
|
||||
|
||||
var toRemove = _ol_format_WMSGetFeatureInfo_.layerIdentifier_;
|
||||
var toRemove = WMSGetFeatureInfo.layerIdentifier_;
|
||||
var layerName = layer.localName.replace(toRemove, '');
|
||||
|
||||
if (this.layers_ && !_ol_array_.includes(this.layers_, layerName)) {
|
||||
@@ -110,7 +110,7 @@ _ol_format_WMSGetFeatureInfo_.prototype.readFeatures_ = function(node, objectSta
|
||||
}
|
||||
|
||||
var featureType = layerName +
|
||||
_ol_format_WMSGetFeatureInfo_.featureIdentifier_;
|
||||
WMSGetFeatureInfo.featureIdentifier_;
|
||||
|
||||
context['featureType'] = featureType;
|
||||
context['featureNS'] = this.featureNS_;
|
||||
@@ -149,13 +149,13 @@ _ol_format_WMSGetFeatureInfo_.prototype.readFeatures_ = function(node, objectSta
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.readFeatures;
|
||||
WMSGetFeatureInfo.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
WMSGetFeatureInfo.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var options = {};
|
||||
if (opt_options) {
|
||||
_ol_obj_.assign(options, this.getReadOptions(node, opt_options));
|
||||
@@ -168,19 +168,19 @@ _ol_format_WMSGetFeatureInfo_.prototype.readFeaturesFromNode = function(node, op
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.writeFeatureNode = function(feature, opt_options) {};
|
||||
WMSGetFeatureInfo.prototype.writeFeatureNode = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.writeFeaturesNode = function(features, opt_options) {};
|
||||
WMSGetFeatureInfo.prototype.writeFeaturesNode = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* Not implemented.
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_WMSGetFeatureInfo_.prototype.writeGeometryNode = function(geometry, opt_options) {};
|
||||
export default _ol_format_WMSGetFeatureInfo_;
|
||||
WMSGetFeatureInfo.prototype.writeGeometryNode = function(geometry, opt_options) {};
|
||||
export default WMSGetFeatureInfo;
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import {boundingExtent} from '../extent.js';
|
||||
import _ol_format_OWS_ from '../format/OWS.js';
|
||||
import _ol_format_XLink_ from '../format/XLink.js';
|
||||
import _ol_format_XML_ from '../format/XML.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import OWS from '../format/OWS.js';
|
||||
import XLink from '../format/XLink.js';
|
||||
import XML from '../format/XML.js';
|
||||
import XSD from '../format/XSD.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
/**
|
||||
@@ -18,16 +18,16 @@ import _ol_xml_ from '../xml.js';
|
||||
* @api
|
||||
*/
|
||||
var _ol_format_WMTSCapabilities_ = function() {
|
||||
_ol_format_XML_.call(this);
|
||||
XML.call(this);
|
||||
|
||||
/**
|
||||
* @type {ol.format.OWS}
|
||||
* @private
|
||||
*/
|
||||
this.owsParser_ = new _ol_format_OWS_();
|
||||
this.owsParser_ = new OWS();
|
||||
};
|
||||
|
||||
inherits(_ol_format_WMTSCapabilities_, _ol_format_XML_);
|
||||
inherits(_ol_format_WMTSCapabilities_, XML);
|
||||
|
||||
|
||||
/**
|
||||
@@ -199,7 +199,7 @@ _ol_format_WMTSCapabilities_.readWgs84BoundingBox_ = function(node, objectStack)
|
||||
_ol_format_WMTSCapabilities_.readLegendUrl_ = function(node, objectStack) {
|
||||
var legend = {};
|
||||
legend['format'] = node.getAttribute('format');
|
||||
legend['href'] = _ol_format_XLink_.readHref(node);
|
||||
legend['href'] = XLink.readHref(node);
|
||||
return legend;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ _ol_format_WMTSCapabilities_.readLegendUrl_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} Coordinates object.
|
||||
*/
|
||||
_ol_format_WMTSCapabilities_.readCoordinates_ = function(node, objectStack) {
|
||||
var coordinates = _ol_format_XSD_.readString(node).split(' ');
|
||||
var coordinates = XSD.readString(node).split(' ');
|
||||
if (!coordinates || coordinates.length != 2) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ _ol_format_WMTSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
'Style': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMTSCapabilities_.readStyle_),
|
||||
'Format': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'TileMatrixSetLink': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMTSCapabilities_.readTileMatrixSetLink_),
|
||||
'Dimension': _ol_xml_.makeObjectPropertyPusher(
|
||||
@@ -329,13 +329,13 @@ _ol_format_WMTSCapabilities_.LAYER_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.readResourceUrl_)
|
||||
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'Abstract': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'WGS84BoundingBox': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMTSCapabilities_.readWgs84BoundingBox_),
|
||||
'Identifier': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
@@ -350,9 +350,9 @@ _ol_format_WMTSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.readLegendUrl_)
|
||||
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
|
||||
'Title': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'Identifier': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ _ol_format_WMTSCapabilities_.STYLE_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.TMS_LINKS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
|
||||
'TileMatrixSet': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'TileMatrixSetLimits': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMTSCapabilities_.readTileMatrixLimitsList_)
|
||||
});
|
||||
@@ -389,15 +389,15 @@ _ol_format_WMTSCapabilities_.TMS_LIMITS_LIST_PARSERS_ = _ol_xml_.makeStructureNS
|
||||
_ol_format_WMTSCapabilities_.TMS_LIMITS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
|
||||
'TileMatrix': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'MinTileRow': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MaxTileRow': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MinTileCol': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MaxTileCol': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger)
|
||||
XSD.readNonNegativeInteger)
|
||||
});
|
||||
|
||||
|
||||
@@ -409,12 +409,12 @@ _ol_format_WMTSCapabilities_.TMS_LIMITS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.DIMENSION_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
|
||||
'Default': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'Value': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
|
||||
'Identifier': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
@@ -440,14 +440,14 @@ _ol_format_WMTSCapabilities_.WGS84_BBOX_READERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.TMS_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
_ol_format_WMTSCapabilities_.NAMESPACE_URIS_, {
|
||||
'WellKnownScaleSet': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'TileMatrix': _ol_xml_.makeObjectPropertyPusher(
|
||||
_ol_format_WMTSCapabilities_.readTileMatrix_)
|
||||
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
|
||||
'SupportedCRS': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString),
|
||||
XSD.readString),
|
||||
'Identifier': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}));
|
||||
|
||||
|
||||
@@ -461,17 +461,17 @@ _ol_format_WMTSCapabilities_.TM_PARSERS_ = _ol_xml_.makeStructureNS(
|
||||
'TopLeftCorner': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_WMTSCapabilities_.readCoordinates_),
|
||||
'ScaleDenominator': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readDecimal),
|
||||
XSD.readDecimal),
|
||||
'TileWidth': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'TileHeight': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MatrixWidth': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger),
|
||||
XSD.readNonNegativeInteger),
|
||||
'MatrixHeight': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readNonNegativeInteger)
|
||||
XSD.readNonNegativeInteger)
|
||||
}, _ol_xml_.makeStructureNS(_ol_format_WMTSCapabilities_.OWS_NAMESPACE_URIS_, {
|
||||
'Identifier': _ol_xml_.makeObjectPropertySetter(
|
||||
_ol_format_XSD_.readString)
|
||||
XSD.readString)
|
||||
}));
|
||||
export default _ol_format_WMTSCapabilities_;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/**
|
||||
* @module ol/format/XLink
|
||||
*/
|
||||
var _ol_format_XLink_ = {};
|
||||
var XLink = {};
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_XLink_.NAMESPACE_URI = 'http://www.w3.org/1999/xlink';
|
||||
XLink.NAMESPACE_URI = 'http://www.w3.org/1999/xlink';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {boolean|undefined} Boolean.
|
||||
*/
|
||||
_ol_format_XLink_.readHref = function(node) {
|
||||
return node.getAttributeNS(_ol_format_XLink_.NAMESPACE_URI, 'href');
|
||||
XLink.readHref = function(node) {
|
||||
return node.getAttributeNS(XLink.NAMESPACE_URI, 'href');
|
||||
};
|
||||
export default _ol_format_XLink_;
|
||||
export default XLink;
|
||||
|
||||
@@ -11,7 +11,7 @@ import _ol_xml_ from '../xml.js';
|
||||
* @abstract
|
||||
* @struct
|
||||
*/
|
||||
var _ol_format_XML_ = function() {
|
||||
var XML = function() {
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ var _ol_format_XML_ = function() {
|
||||
* @param {Document|Node|string} source Source.
|
||||
* @return {Object} The parsed result.
|
||||
*/
|
||||
_ol_format_XML_.prototype.read = function(source) {
|
||||
XML.prototype.read = function(source) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readFromDocument(/** @type {Document} */ (source));
|
||||
} else if (_ol_xml_.isNode(source)) {
|
||||
@@ -38,7 +38,7 @@ _ol_format_XML_.prototype.read = function(source) {
|
||||
* @param {Document} doc Document.
|
||||
* @return {Object} Object
|
||||
*/
|
||||
_ol_format_XML_.prototype.readFromDocument = function(doc) {};
|
||||
XML.prototype.readFromDocument = function(doc) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -46,5 +46,5 @@ _ol_format_XML_.prototype.readFromDocument = function(doc) {};
|
||||
* @param {Node} node Node.
|
||||
* @return {Object} Object
|
||||
*/
|
||||
_ol_format_XML_.prototype.readFromNode = function(node) {};
|
||||
export default _ol_format_XML_;
|
||||
XML.prototype.readFromNode = function(node) {};
|
||||
export default XML;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import FeatureFormat from '../format/Feature.js';
|
||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
|
||||
@@ -17,7 +17,7 @@ import _ol_xml_ from '../xml.js';
|
||||
* @abstract
|
||||
* @extends {ol.format.Feature}
|
||||
*/
|
||||
var _ol_format_XMLFeature_ = function() {
|
||||
var XMLFeature = function() {
|
||||
|
||||
/**
|
||||
* @type {XMLSerializer}
|
||||
@@ -25,16 +25,16 @@ var _ol_format_XMLFeature_ = function() {
|
||||
*/
|
||||
this.xmlSerializer_ = new XMLSerializer();
|
||||
|
||||
_ol_format_Feature_.call(this);
|
||||
FeatureFormat.call(this);
|
||||
};
|
||||
|
||||
inherits(_ol_format_XMLFeature_, _ol_format_Feature_);
|
||||
inherits(XMLFeature, FeatureFormat);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.getType = function() {
|
||||
XMLFeature.prototype.getType = function() {
|
||||
return _ol_format_FormatType_.XML;
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ _ol_format_XMLFeature_.prototype.getType = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
XMLFeature.prototype.readFeature = function(source, opt_options) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readFeatureFromDocument(
|
||||
/** @type {Document} */ (source), opt_options);
|
||||
@@ -62,7 +62,7 @@ _ol_format_XMLFeature_.prototype.readFeature = function(source, opt_options) {
|
||||
* @param {olx.format.ReadOptions=} opt_options Options.
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeatureFromDocument = function(
|
||||
XMLFeature.prototype.readFeatureFromDocument = function(
|
||||
doc, opt_options) {
|
||||
var features = this.readFeaturesFromDocument(doc, opt_options);
|
||||
if (features.length > 0) {
|
||||
@@ -78,7 +78,7 @@ _ol_format_XMLFeature_.prototype.readFeatureFromDocument = function(
|
||||
* @param {olx.format.ReadOptions=} opt_options Options.
|
||||
* @return {ol.Feature} Feature.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
XMLFeature.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ _ol_format_XMLFeature_.prototype.readFeatureFromNode = function(node, opt_option
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
XMLFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readFeaturesFromDocument(
|
||||
/** @type {Document} */ (source), opt_options);
|
||||
@@ -107,7 +107,7 @@ _ol_format_XMLFeature_.prototype.readFeatures = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeaturesFromDocument = function(
|
||||
XMLFeature.prototype.readFeaturesFromDocument = function(
|
||||
doc, opt_options) {
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
@@ -128,13 +128,13 @@ _ol_format_XMLFeature_.prototype.readFeaturesFromDocument = function(
|
||||
* @protected
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readFeaturesFromNode = function(node, opt_options) {};
|
||||
XMLFeature.prototype.readFeaturesFromNode = function(node, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
XMLFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readGeometryFromDocument(
|
||||
/** @type {Document} */ (source), opt_options);
|
||||
@@ -155,7 +155,7 @@ _ol_format_XMLFeature_.prototype.readGeometry = function(source, opt_options) {
|
||||
* @protected
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readGeometryFromDocument = function(doc, opt_options) {
|
||||
XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
|
||||
@@ -166,7 +166,7 @@ _ol_format_XMLFeature_.prototype.readGeometryFromDocument = function(doc, opt_op
|
||||
* @protected
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readGeometryFromNode = function(node, opt_options) {
|
||||
XMLFeature.prototype.readGeometryFromNode = function(node, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ _ol_format_XMLFeature_.prototype.readGeometryFromNode = function(node, opt_optio
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readProjection = function(source) {
|
||||
XMLFeature.prototype.readProjection = function(source) {
|
||||
if (_ol_xml_.isDocument(source)) {
|
||||
return this.readProjectionFromDocument(/** @type {Document} */ (source));
|
||||
} else if (_ol_xml_.isNode(source)) {
|
||||
@@ -193,7 +193,7 @@ _ol_format_XMLFeature_.prototype.readProjection = function(source) {
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readProjectionFromDocument = function(doc) {
|
||||
XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -203,7 +203,7 @@ _ol_format_XMLFeature_.prototype.readProjectionFromDocument = function(doc) {
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.readProjectionFromNode = function(node) {
|
||||
XMLFeature.prototype.readProjectionFromNode = function(node) {
|
||||
return this.defaultDataProjection;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ _ol_format_XMLFeature_.prototype.readProjectionFromNode = function(node) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeFeature = function(feature, opt_options) {
|
||||
XMLFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
var node = this.writeFeatureNode(feature, opt_options);
|
||||
return this.xmlSerializer_.serializeToString(node);
|
||||
};
|
||||
@@ -223,7 +223,7 @@ _ol_format_XMLFeature_.prototype.writeFeature = function(feature, opt_options) {
|
||||
* @protected
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeFeatureNode = function(feature, opt_options) {
|
||||
XMLFeature.prototype.writeFeatureNode = function(feature, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
|
||||
@@ -231,7 +231,7 @@ _ol_format_XMLFeature_.prototype.writeFeatureNode = function(feature, opt_option
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeFeatures = function(features, opt_options) {
|
||||
XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||
var node = this.writeFeaturesNode(features, opt_options);
|
||||
return this.xmlSerializer_.serializeToString(node);
|
||||
};
|
||||
@@ -242,7 +242,7 @@ _ol_format_XMLFeature_.prototype.writeFeatures = function(features, opt_options)
|
||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
XMLFeature.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
|
||||
@@ -250,7 +250,7 @@ _ol_format_XMLFeature_.prototype.writeFeaturesNode = function(features, opt_opti
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
var node = this.writeGeometryNode(geometry, opt_options);
|
||||
return this.xmlSerializer_.serializeToString(node);
|
||||
};
|
||||
@@ -261,7 +261,7 @@ _ol_format_XMLFeature_.prototype.writeGeometry = function(geometry, opt_options)
|
||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
_ol_format_XMLFeature_.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
XMLFeature.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
return null; // not implemented
|
||||
};
|
||||
export default _ol_format_XMLFeature_;
|
||||
export default XMLFeature;
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
*/
|
||||
import _ol_xml_ from '../xml.js';
|
||||
import _ol_string_ from '../string.js';
|
||||
var _ol_format_XSD_ = {};
|
||||
var XSD = {};
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
_ol_format_XSD_.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema';
|
||||
XSD.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {boolean|undefined} Boolean.
|
||||
*/
|
||||
_ol_format_XSD_.readBoolean = function(node) {
|
||||
XSD.readBoolean = function(node) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false);
|
||||
return _ol_format_XSD_.readBooleanString(s);
|
||||
return XSD.readBooleanString(s);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ _ol_format_XSD_.readBoolean = function(node) {
|
||||
* @param {string} string String.
|
||||
* @return {boolean|undefined} Boolean.
|
||||
*/
|
||||
_ol_format_XSD_.readBooleanString = function(string) {
|
||||
XSD.readBooleanString = function(string) {
|
||||
var m = /^\s*(true|1)|(false|0)\s*$/.exec(string);
|
||||
if (m) {
|
||||
return m[1] !== undefined || false;
|
||||
@@ -41,7 +41,7 @@ _ol_format_XSD_.readBooleanString = function(string) {
|
||||
* @param {Node} node Node.
|
||||
* @return {number|undefined} DateTime in seconds.
|
||||
*/
|
||||
_ol_format_XSD_.readDateTime = function(node) {
|
||||
XSD.readDateTime = function(node) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false);
|
||||
var dateTime = Date.parse(s);
|
||||
return isNaN(dateTime) ? undefined : dateTime / 1000;
|
||||
@@ -52,9 +52,9 @@ _ol_format_XSD_.readDateTime = function(node) {
|
||||
* @param {Node} node Node.
|
||||
* @return {number|undefined} Decimal.
|
||||
*/
|
||||
_ol_format_XSD_.readDecimal = function(node) {
|
||||
XSD.readDecimal = function(node) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false);
|
||||
return _ol_format_XSD_.readDecimalString(s);
|
||||
return XSD.readDecimalString(s);
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ _ol_format_XSD_.readDecimal = function(node) {
|
||||
* @param {string} string String.
|
||||
* @return {number|undefined} Decimal.
|
||||
*/
|
||||
_ol_format_XSD_.readDecimalString = function(string) {
|
||||
XSD.readDecimalString = function(string) {
|
||||
// FIXME check spec
|
||||
var m = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(string);
|
||||
if (m) {
|
||||
@@ -77,9 +77,9 @@ _ol_format_XSD_.readDecimalString = function(string) {
|
||||
* @param {Node} node Node.
|
||||
* @return {number|undefined} Non negative integer.
|
||||
*/
|
||||
_ol_format_XSD_.readNonNegativeInteger = function(node) {
|
||||
XSD.readNonNegativeInteger = function(node) {
|
||||
var s = _ol_xml_.getAllTextContent(node, false);
|
||||
return _ol_format_XSD_.readNonNegativeIntegerString(s);
|
||||
return XSD.readNonNegativeIntegerString(s);
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ _ol_format_XSD_.readNonNegativeInteger = function(node) {
|
||||
* @param {string} string String.
|
||||
* @return {number|undefined} Non negative integer.
|
||||
*/
|
||||
_ol_format_XSD_.readNonNegativeIntegerString = function(string) {
|
||||
XSD.readNonNegativeIntegerString = function(string) {
|
||||
var m = /^\s*(\d+)\s*$/.exec(string);
|
||||
if (m) {
|
||||
return parseInt(m[1], 10);
|
||||
@@ -101,7 +101,7 @@ _ol_format_XSD_.readNonNegativeIntegerString = function(string) {
|
||||
* @param {Node} node Node.
|
||||
* @return {string|undefined} String.
|
||||
*/
|
||||
_ol_format_XSD_.readString = function(node) {
|
||||
XSD.readString = function(node) {
|
||||
return _ol_xml_.getAllTextContent(node, false).trim();
|
||||
};
|
||||
|
||||
@@ -110,8 +110,8 @@ _ol_format_XSD_.readString = function(node) {
|
||||
* @param {Node} node Node to append a TextNode with the boolean to.
|
||||
* @param {boolean} bool Boolean.
|
||||
*/
|
||||
_ol_format_XSD_.writeBooleanTextNode = function(node, bool) {
|
||||
_ol_format_XSD_.writeStringTextNode(node, (bool) ? '1' : '0');
|
||||
XSD.writeBooleanTextNode = function(node, bool) {
|
||||
XSD.writeStringTextNode(node, (bool) ? '1' : '0');
|
||||
};
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ _ol_format_XSD_.writeBooleanTextNode = function(node, bool) {
|
||||
* @param {Node} node Node to append a CDATA Section with the string to.
|
||||
* @param {string} string String.
|
||||
*/
|
||||
_ol_format_XSD_.writeCDATASection = function(node, string) {
|
||||
XSD.writeCDATASection = function(node, string) {
|
||||
node.appendChild(_ol_xml_.DOCUMENT.createCDATASection(string));
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ _ol_format_XSD_.writeCDATASection = function(node, string) {
|
||||
* @param {Node} node Node to append a TextNode with the dateTime to.
|
||||
* @param {number} dateTime DateTime in seconds.
|
||||
*/
|
||||
_ol_format_XSD_.writeDateTimeTextNode = function(node, dateTime) {
|
||||
XSD.writeDateTimeTextNode = function(node, dateTime) {
|
||||
var date = new Date(dateTime * 1000);
|
||||
var string = date.getUTCFullYear() + '-' +
|
||||
_ol_string_.padNumber(date.getUTCMonth() + 1, 2) + '-' +
|
||||
@@ -144,7 +144,7 @@ _ol_format_XSD_.writeDateTimeTextNode = function(node, dateTime) {
|
||||
* @param {Node} node Node to append a TextNode with the decimal to.
|
||||
* @param {number} decimal Decimal.
|
||||
*/
|
||||
_ol_format_XSD_.writeDecimalTextNode = function(node, decimal) {
|
||||
XSD.writeDecimalTextNode = function(node, decimal) {
|
||||
var string = decimal.toPrecision();
|
||||
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
|
||||
};
|
||||
@@ -154,7 +154,7 @@ _ol_format_XSD_.writeDecimalTextNode = function(node, decimal) {
|
||||
* @param {Node} node Node to append a TextNode with the decimal to.
|
||||
* @param {number} nonNegativeInteger Non negative integer.
|
||||
*/
|
||||
_ol_format_XSD_.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) {
|
||||
XSD.writeNonNegativeIntegerTextNode = function(node, nonNegativeInteger) {
|
||||
var string = nonNegativeInteger.toString();
|
||||
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
|
||||
};
|
||||
@@ -164,7 +164,7 @@ _ol_format_XSD_.writeNonNegativeIntegerTextNode = function(node, nonNegativeInte
|
||||
* @param {Node} node Node to append a TextNode with the string to.
|
||||
* @param {string} string String.
|
||||
*/
|
||||
_ol_format_XSD_.writeStringTextNode = function(node, string) {
|
||||
XSD.writeStringTextNode = function(node, string) {
|
||||
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
|
||||
};
|
||||
export default _ol_format_XSD_;
|
||||
export default XSD;
|
||||
|
||||
Reference in New Issue
Block a user