Merge remote-tracking branch 'upstream/master' into vector-api
Conflicts: src/objectliterals.jsdoc src/ol/attribution.js src/ol/geom/geometry.js src/ol/geom/geometrycollection.js src/ol/geom/linestring.js src/ol/layer/vectorlayer.exports src/ol/layer/vectorlayer.js src/ol/map.js src/ol/proj/proj.js src/ol/renderer/canvas/canvasvectorlayerrenderer.js src/ol/source/imagewmssource.js src/ol/source/tilewmssource.js src/ol/source/vectorsource.exports src/ol/source/vectorsource.js src/ol/source/wmssource.js src/ol/style/style.js src/ol/tilegrid/tilegrid.js src/ol/tilegrid/wmtstilegrid.js src/ol/tilegrid/xyztilegrid.js
This commit is contained in:
@@ -22,12 +22,12 @@ goog.require('ol.proj');
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {ol.parser.StringFeatureParser}
|
||||
* @param {ol.parser.GMLOptions=} opt_options
|
||||
* @param {olx.parser.GMLOptions=} opt_options
|
||||
* Optional configuration object.
|
||||
* @extends {ol.parser.XML}
|
||||
*/
|
||||
ol.parser.ogc.GML = function(opt_options) {
|
||||
var options = /** @type {ol.parser.GMLOptions} */
|
||||
var options = /** @type {olx.parser.GMLOptions} */
|
||||
(goog.isDef(opt_options) ? opt_options : {});
|
||||
this.extractAttributes = goog.isDef(options.extractAttributes) ?
|
||||
options.extractAttributes : true;
|
||||
@@ -102,7 +102,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.GEOMETRYCOLLECTION,
|
||||
type: ol.geom.GeometryType.GEOMETRY_COLLECTION,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
@@ -115,7 +115,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTIPOINT,
|
||||
type: ol.geom.GeometryType.MULTI_POINT,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
@@ -128,7 +128,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTILINESTRING,
|
||||
type: ol.geom.GeometryType.MULTI_LINE_STRING,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
@@ -141,7 +141,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
[node, parts, container]);
|
||||
this.readChildNodes(node, parts);
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.MULTIPOLYGON,
|
||||
type: ol.geom.GeometryType.MULTI_POLYGON,
|
||||
parts: parts
|
||||
};
|
||||
},
|
||||
@@ -173,7 +173,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
[node, coordinates, container]);
|
||||
this.readChildNodes(node, coordinates);
|
||||
var linestring = {
|
||||
type: ol.geom.GeometryType.LINESTRING,
|
||||
type: ol.geom.GeometryType.LINE_STRING,
|
||||
coordinates: coordinates[0]
|
||||
};
|
||||
// in the case of a multi geometry this is parts
|
||||
@@ -209,7 +209,7 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
container.push(coordinates);
|
||||
} else {
|
||||
container.geometry = {
|
||||
type: ol.geom.GeometryType.LINEARRING,
|
||||
type: ol.geom.GeometryType.LINEAR_RING,
|
||||
coordinates: coordinates[0]
|
||||
};
|
||||
}
|
||||
@@ -444,20 +444,20 @@ ol.parser.ogc.GML = function(opt_options) {
|
||||
var type = geometry.getType(), child;
|
||||
if (type === ol.geom.GeometryType.POINT) {
|
||||
child = this.writeNode('Point', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTIPOINT) {
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
child = this.writeNode('MultiPoint', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.LINEARRING) {
|
||||
} else if (type === ol.geom.GeometryType.LINEAR_RING) {
|
||||
child = this.writeNode('LinearRing', geometry.getCoordinates(), null,
|
||||
node);
|
||||
} else if (type === ol.geom.GeometryType.LINESTRING) {
|
||||
} else if (type === ol.geom.GeometryType.LINE_STRING) {
|
||||
child = this.writeNode('LineString', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTILINESTRING) {
|
||||
} else if (type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
child = this.writeNode('MultiLineString', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.POLYGON) {
|
||||
child = this.writeNode('Polygon', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
child = this.writeNode('MultiPolygon', geometry, null, node);
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRYCOLLECTION) {
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRY_COLLECTION) {
|
||||
child = this.writeNode('GeometryCollection', geometry, null, node);
|
||||
}
|
||||
if (goog.isDefAndNotNull(this.srsName)) {
|
||||
@@ -491,7 +491,7 @@ ol.parser.ogc.GML.prototype.writeGeometry = function(geometry) {
|
||||
|
||||
/**
|
||||
* @param {string|Document|Element|Object} data Data to read.
|
||||
* @param {ol.parser.GMLReadOptions=} opt_options Read options.
|
||||
* @param {olx.parser.GMLReadOptions=} opt_options Read options.
|
||||
* @return {ol.parser.ReadFeaturesResult} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.read = function(data, opt_options) {
|
||||
@@ -570,37 +570,37 @@ ol.parser.ogc.GML.prototype.createGeometry = function(container) {
|
||||
case ol.geom.GeometryType.POINT:
|
||||
geometry = new ol.geom.Point(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.LINEARRING:
|
||||
case ol.geom.GeometryType.LINEAR_RING:
|
||||
geometry = new ol.geom.LinearRing(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.LINESTRING:
|
||||
case ol.geom.GeometryType.LINE_STRING:
|
||||
geometry = new ol.geom.LineString(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.POLYGON:
|
||||
geometry = new ol.geom.Polygon(container.geometry.coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTIPOINT:
|
||||
case ol.geom.GeometryType.MULTI_POINT:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiPoint(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTILINESTRING:
|
||||
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiLineString(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.MULTIPOLYGON:
|
||||
case ol.geom.GeometryType.MULTI_POLYGON:
|
||||
coordinates = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
coordinates.push(container.geometry.parts[i].coordinates);
|
||||
}
|
||||
geometry = new ol.geom.MultiPolygon(coordinates);
|
||||
break;
|
||||
case ol.geom.GeometryType.GEOMETRYCOLLECTION:
|
||||
case ol.geom.GeometryType.GEOMETRY_COLLECTION:
|
||||
var geometries = [];
|
||||
for (i = 0, ii = container.geometry.parts.length; i < ii; i++) {
|
||||
geometries.push(this.createGeometry({
|
||||
@@ -630,7 +630,7 @@ ol.parser.ogc.GML.prototype.readFeaturesFromString = function(str) {
|
||||
* Applies the writeOptions passed into the write function.
|
||||
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
|
||||
* GML.
|
||||
* @param {ol.parser.GMLWriteOptions=} opt_options Write options.
|
||||
* @param {olx.parser.GMLWriteOptions=} opt_options Write options.
|
||||
*/
|
||||
ol.parser.ogc.GML.prototype.applyWriteOptions = function(obj, opt_options) {
|
||||
// srsName handling: opt_options -> this.writeOptions -> obj.metadata
|
||||
|
||||
Reference in New Issue
Block a user