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:
@@ -36,9 +36,9 @@
|
||||
<form class="form-inline">
|
||||
<label>Geometry type </label>
|
||||
<select id="type">
|
||||
<option value="polygon">Polygon</option>
|
||||
<option value="linestring">Linestring</option>
|
||||
<option value="point">Point</option>
|
||||
<option value="Polygon">Polygon</option>
|
||||
<option value="LineString">Linestring</option>
|
||||
<option value="Point">Point</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ var style = new ol.style.Style({rules: [
|
||||
]
|
||||
}),
|
||||
new ol.style.Rule({
|
||||
filter: 'geometryType("point")',
|
||||
filter: 'geometryType("Point")',
|
||||
symbolizers: [
|
||||
new ol.style.Shape({
|
||||
size: 40,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
@@ -12,13 +13,19 @@ var raster = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var parser = new ol.parser.WKT();
|
||||
var transform = ol.proj.getTransform('EPSG:4326', 'EPSG:3857');
|
||||
var geom = parser.read(
|
||||
'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' +
|
||||
'-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' +
|
||||
'-39.1552734375, 10.689697265625 -25.0927734375))');
|
||||
geom.transform(transform);
|
||||
var feature = new ol.Feature();
|
||||
feature.setGeometry(geom);
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
parser: new ol.parser.WKT(),
|
||||
projection: ol.proj.get('EPSG:4326'),
|
||||
data: 'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' +
|
||||
'-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' +
|
||||
'-39.1552734375, 10.689697265625 -25.0927734375))'
|
||||
features: [feature]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@exportSymbol ol.geom.GeometryType
|
||||
@exportProperty ol.geom.GeometryType.POINT
|
||||
@exportProperty ol.geom.GeometryType.LINEARRING
|
||||
@exportProperty ol.geom.GeometryType.LINESTRING
|
||||
@exportProperty ol.geom.GeometryType.LINEAR_RING
|
||||
@exportProperty ol.geom.GeometryType.LINE_STRING
|
||||
@exportProperty ol.geom.GeometryType.POLYGON
|
||||
@exportProperty ol.geom.GeometryType.MULTIPOINT
|
||||
@exportProperty ol.geom.GeometryType.MULTILINESTRING
|
||||
@exportProperty ol.geom.GeometryType.MULTIPOLYGON
|
||||
@exportProperty ol.geom.GeometryType.GEOMETRYCOLLECTION
|
||||
@exportProperty ol.geom.GeometryType.MULTI_POINT
|
||||
@exportProperty ol.geom.GeometryType.MULTI_LINE_STRING
|
||||
@exportProperty ol.geom.GeometryType.MULTI_POLYGON
|
||||
@exportProperty ol.geom.GeometryType.GEOMETRY_COLLECTION
|
||||
|
||||
@exportSymbol ol.geom.Geometry
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
@exportClass ol.interaction.Draw ol.interaction.DrawOptions
|
||||
@exportSymbol ol.interaction.Draw
|
||||
|
||||
@@ -23,7 +23,7 @@ goog.require('ol.source.Vector');
|
||||
|
||||
/**
|
||||
* Interaction that allows drawing geometries.
|
||||
* @param {ol.interaction.DrawOptions} options Options.
|
||||
* @param {olx.interaction.DrawOptions} options Options.
|
||||
* @constructor
|
||||
* @extends {ol.interaction.Interaction}
|
||||
*/
|
||||
@@ -337,11 +337,11 @@ ol.interaction.Draw.prototype.finishDrawing_ = function(event) {
|
||||
sketchFeature.setGeometry(new ol.geom.Polygon(coordinates));
|
||||
}
|
||||
// cast multi-part geometries
|
||||
if (this.type_ === ol.geom.GeometryType.MULTIPOINT) {
|
||||
if (this.type_ === ol.geom.GeometryType.MULTI_POINT) {
|
||||
sketchFeature.setGeometry(new ol.geom.MultiPoint([coordinates]));
|
||||
} else if (this.type_ === ol.geom.GeometryType.MULTILINESTRING) {
|
||||
} else if (this.type_ === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
sketchFeature.setGeometry(new ol.geom.MultiLineString([coordinates]));
|
||||
} else if (this.type_ === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
} else if (this.type_ === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
sketchFeature.setGeometry(new ol.geom.MultiPolygon([coordinates]));
|
||||
}
|
||||
this.layer_.getVectorSource().addFeatures([sketchFeature]);
|
||||
@@ -379,13 +379,13 @@ ol.interaction.Draw.prototype.abortDrawing_ = function() {
|
||||
ol.interaction.Draw.getMode_ = function(type) {
|
||||
var mode;
|
||||
if (type === ol.geom.GeometryType.POINT ||
|
||||
type === ol.geom.GeometryType.MULTIPOINT) {
|
||||
type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
mode = ol.interaction.DrawMode.POINT;
|
||||
} else if (type === ol.geom.GeometryType.LINESTRING ||
|
||||
type === ol.geom.GeometryType.MULTILINESTRING) {
|
||||
} else if (type === ol.geom.GeometryType.LINE_STRING ||
|
||||
type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
mode = ol.interaction.DrawMode.LINESTRING;
|
||||
} else if (type === ol.geom.GeometryType.POLYGON ||
|
||||
type === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
mode = ol.interaction.DrawMode.POLYGON;
|
||||
}
|
||||
goog.asserts.assert(goog.isDef(mode));
|
||||
|
||||
@@ -1 +1 @@
|
||||
@exportClass ol.interaction.Modify ol.interaction.ModifyOptions
|
||||
@exportSymbol ol.interaction.Modify
|
||||
|
||||
@@ -38,7 +38,7 @@ ol.interaction.SegmentDataType;
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.interaction.Drag}
|
||||
* @param {ol.interaction.ModifyOptions=} opt_options Options.
|
||||
* @param {olx.interaction.ModifyOptions=} opt_options Options.
|
||||
*/
|
||||
ol.interaction.Modify = function(opt_options) {
|
||||
goog.base(this);
|
||||
@@ -243,18 +243,18 @@ ol.interaction.Modify.prototype.addIndex_ = function(features, layer) {
|
||||
*/
|
||||
ol.interaction.Modify.prototype.removeIndex_ = function(features) {
|
||||
var rBush = this.rBush_;
|
||||
var i, feature, nodesToRemove;
|
||||
var nodesToRemove = [];
|
||||
var i, feature;
|
||||
for (i = features.length - 1; i >= 0; --i) {
|
||||
feature = features[i];
|
||||
nodesToRemove = [];
|
||||
rBush.forEachInExtent(feature.getGeometry().getBounds(), function(node) {
|
||||
if (feature === node.feature) {
|
||||
nodesToRemove.push(node);
|
||||
}
|
||||
});
|
||||
for (i = nodesToRemove.length - 1; i >= 0; --i) {
|
||||
rBush.remove(nodesToRemove[i]);
|
||||
}
|
||||
}
|
||||
for (i = nodesToRemove.length - 1; i >= 0; --i) {
|
||||
rBush.remove(nodesToRemove[i]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
@exportClass ol.interaction.Select ol.interaction.SelectOptions
|
||||
@exportSymbol ol.interaction.Select
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.layer.Vector');
|
||||
* Allows the user to select features on the map.
|
||||
* @constructor
|
||||
* @extends {ol.interaction.Interaction}
|
||||
* @param {ol.interaction.SelectOptions=} opt_options Options.
|
||||
* @param {olx.interaction.SelectOptions=} opt_options Options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.interaction.Select = function(opt_options) {
|
||||
|
||||
@@ -410,10 +410,10 @@ ol.parser.GeoJSON.prototype.write = function(obj) {
|
||||
*/
|
||||
ol.parser.GeoJSON.GeometryType = {
|
||||
'Point': ol.geom.GeometryType.POINT,
|
||||
'LineString': ol.geom.GeometryType.LINESTRING,
|
||||
'LineString': ol.geom.GeometryType.LINE_STRING,
|
||||
'Polygon': ol.geom.GeometryType.POLYGON,
|
||||
'MultiPoint': ol.geom.GeometryType.MULTIPOINT,
|
||||
'MultiLineString': ol.geom.GeometryType.MULTILINESTRING,
|
||||
'MultiPolygon': ol.geom.GeometryType.MULTIPOLYGON,
|
||||
'GeometryCollection': ol.geom.GeometryType.GEOMETRYCOLLECTION
|
||||
'MultiPoint': ol.geom.GeometryType.MULTI_POINT,
|
||||
'MultiLineString': ol.geom.GeometryType.MULTI_LINE_STRING,
|
||||
'MultiPolygon': ol.geom.GeometryType.MULTI_POLYGON,
|
||||
'GeometryCollection': ol.geom.GeometryType.GEOMETRY_COLLECTION
|
||||
};
|
||||
|
||||
@@ -21,12 +21,12 @@ goog.require('ol.parser.XML');
|
||||
* @implements {ol.parser.DomFeatureParser}
|
||||
* @implements {ol.parser.StringFeatureParser}
|
||||
* @implements {ol.parser.ObjectFeatureParser}
|
||||
* @param {ol.parser.GPXOptions=} opt_options Optional configuration object.
|
||||
* @param {olx.parser.GPXOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.XML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.GPX = function(opt_options) {
|
||||
var options = /** @type {ol.parser.GPXOptions} */
|
||||
var options = /** @type {olx.parser.GPXOptions} */
|
||||
(goog.isDef(opt_options) ? opt_options : {});
|
||||
this.extractAttributes = goog.isDef(options.extractAttributes) ?
|
||||
options.extractAttributes : true;
|
||||
@@ -65,7 +65,7 @@ ol.parser.GPX = function(opt_options) {
|
||||
},
|
||||
'rte': function(node, obj) {
|
||||
if (this.extractRoutes || obj.force) {
|
||||
var type = ol.geom.GeometryType.LINESTRING;
|
||||
var type = ol.geom.GeometryType.LINE_STRING;
|
||||
var container = {
|
||||
properties: {},
|
||||
geometry: {
|
||||
@@ -269,7 +269,7 @@ ol.parser.GPX.prototype.readFeaturesFromObject = function(obj) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.parser.GPXWriteOptions} obj Object structure to write out
|
||||
* @param {olx.parser.GPXWriteOptions} obj Object structure to write out
|
||||
* as GPX.
|
||||
* @return {string} An string representing the GPX document.
|
||||
*/
|
||||
|
||||
@@ -40,12 +40,12 @@ goog.require('ol.style.Stroke');
|
||||
* @implements {ol.parser.StringFeatureParser}
|
||||
* @implements {ol.parser.AsyncObjectFeatureParser}
|
||||
* @implements {ol.parser.AsyncStringFeatureParser}
|
||||
* @param {ol.parser.KMLOptions=} opt_options Optional configuration object.
|
||||
* @param {olx.parser.KMLOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.XML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.parser.KML = function(opt_options) {
|
||||
var options = /** @type {ol.parser.KMLOptions} */
|
||||
var options = /** @type {olx.parser.KMLOptions} */
|
||||
(goog.isDef(opt_options) ? opt_options : {});
|
||||
this.extractAttributes = goog.isDef(options.extractAttributes) ?
|
||||
options.extractAttributes : true;
|
||||
@@ -185,19 +185,19 @@ ol.parser.KML = function(opt_options) {
|
||||
switch (type) {
|
||||
case ol.geom.GeometryType.POINT:
|
||||
obj.geometry = {
|
||||
type: ol.geom.GeometryType.MULTIPOINT,
|
||||
type: ol.geom.GeometryType.MULTI_POINT,
|
||||
parts: parts
|
||||
};
|
||||
break;
|
||||
case ol.geom.GeometryType.LINESTRING:
|
||||
case ol.geom.GeometryType.LINE_STRING:
|
||||
obj.geometry = {
|
||||
type: ol.geom.GeometryType.MULTILINESTRING,
|
||||
type: ol.geom.GeometryType.MULTI_LINE_STRING,
|
||||
parts: parts
|
||||
};
|
||||
break;
|
||||
case ol.geom.GeometryType.POLYGON:
|
||||
obj.geometry = {
|
||||
type: ol.geom.GeometryType.MULTIPOLYGON,
|
||||
type: ol.geom.GeometryType.MULTI_POLYGON,
|
||||
parts: parts
|
||||
};
|
||||
break;
|
||||
@@ -207,7 +207,7 @@ ol.parser.KML = function(opt_options) {
|
||||
} else {
|
||||
// mixed collection
|
||||
obj.geometry = {
|
||||
type: ol.geom.GeometryType.GEOMETRYCOLLECTION,
|
||||
type: ol.geom.GeometryType.GEOMETRY_COLLECTION,
|
||||
parts: parts
|
||||
};
|
||||
}
|
||||
@@ -250,7 +250,7 @@ ol.parser.KML = function(opt_options) {
|
||||
var coordinates = [];
|
||||
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
|
||||
@@ -730,7 +730,7 @@ ol.parser.KML = function(opt_options) {
|
||||
this.setAttributeNS(node, null, 'id', obj.id);
|
||||
}
|
||||
var literal = obj.symbolizer.createLiteral(
|
||||
ol.geom.GeometryType.LINESTRING);
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
this.writeNode('color', {
|
||||
color: literal.color.substring(1),
|
||||
opacity: literal.opacity
|
||||
@@ -1111,34 +1111,34 @@ ol.parser.KML.prototype.createGeometry_ = function(container) {
|
||||
case ol.geom.GeometryType.POINT:
|
||||
geometry = new ol.geom.Point(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_({
|
||||
|
||||
@@ -649,6 +649,6 @@ ol.parser.ogc.Filter_v1.prototype.setSrsName = function(srsName) {
|
||||
this.srsName = srsName;
|
||||
if (goog.isDefAndNotNull(this.gmlParser_)) {
|
||||
this.gmlParser_.applyWriteOptions({},
|
||||
/** @type {ol.parser.GMLWriteOptions} */ ({srsName: srsName}));
|
||||
/** @type {olx.parser.GMLWriteOptions} */ ({srsName: srsName}));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,7 +11,7 @@ goog.require('ol.parser.ogc.GML');
|
||||
* version 2.1.2
|
||||
*
|
||||
* @constructor
|
||||
* @param {ol.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @param {olx.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.ogc.GML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
@@ -127,7 +127,7 @@ goog.inherits(ol.parser.ogc.GML_v2, ol.parser.ogc.GML);
|
||||
/**
|
||||
* @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.
|
||||
* @return {string} A string representing the GML document.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.parser.ogc.GML');
|
||||
* version 3.1.1
|
||||
*
|
||||
* @constructor
|
||||
* @param {ol.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @param {olx.parser.GMLOptions=} opt_options Optional configuration object.
|
||||
* @extends {ol.parser.ogc.GML}
|
||||
* @todo stability experimental
|
||||
*/
|
||||
@@ -29,18 +29,18 @@ ol.parser.ogc.GML_v3 = 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.LINESTRING) {
|
||||
} else if (type === ol.geom.GeometryType.LINE_STRING) {
|
||||
if (this.curve === true) {
|
||||
child = this.writeNode('Curve', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('LineString', 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.MULTILINESTRING) {
|
||||
} else if (type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
if (this.multiCurve === false) {
|
||||
child = this.writeNode('MultiLineString', geometry, null, node);
|
||||
} else {
|
||||
@@ -52,13 +52,13 @@ ol.parser.ogc.GML_v3 = function(opt_options) {
|
||||
} else {
|
||||
child = this.writeNode('Polygon', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
} else if (type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
if (this.multiSurface === false) {
|
||||
child = this.writeNode('MultiPolygon', geometry, null, node);
|
||||
} else {
|
||||
child = this.writeNode('MultiSurface', geometry, null, node);
|
||||
}
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRYCOLLECTION) {
|
||||
} else if (type === ol.geom.GeometryType.GEOMETRY_COLLECTION) {
|
||||
child = this.writeNode('MultiGeometry', geometry, null, node);
|
||||
}
|
||||
if (goog.isDefAndNotNull(this.srsName)) {
|
||||
@@ -86,7 +86,7 @@ ol.parser.ogc.GML_v3 = 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
|
||||
@@ -176,7 +176,7 @@ ol.parser.ogc.GML_v3 = 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
|
||||
};
|
||||
},
|
||||
@@ -189,7 +189,7 @@ ol.parser.ogc.GML_v3 = 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
|
||||
};
|
||||
},
|
||||
@@ -425,7 +425,7 @@ goog.inherits(ol.parser.ogc.GML_v3, ol.parser.ogc.GML);
|
||||
/**
|
||||
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
|
||||
* XML.
|
||||
* @param {ol.parser.GMLWriteOptions=} opt_options Write options.
|
||||
* @param {olx.parser.GMLWriteOptions=} opt_options Write options.
|
||||
* @return {string} An string representing the XML document.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ ol.parser.ogc.SLD_v1 = function() {
|
||||
delete config.fill;
|
||||
config.zIndex = this.featureTypeCounter;
|
||||
rule.symbolizers.push(
|
||||
new ol.style.Text(/** @type {ol.style.TextOptions} */(config))
|
||||
new ol.style.Text(/** @type {olx.style.TextOptions} */(config))
|
||||
);
|
||||
},
|
||||
'Label': function(node, symbolizer) {
|
||||
@@ -197,7 +197,7 @@ ol.parser.ogc.SLD_v1 = function() {
|
||||
if (goog.isDef(config.externalGraphic)) {
|
||||
config.width = config.height = config.size;
|
||||
symbolizer = new ol.style.Icon(
|
||||
/** @type {ol.style.IconOptions} */(config));
|
||||
/** @type {olx.style.IconOptions} */(config));
|
||||
} else {
|
||||
symbolizer = new ol.style.Shape(config);
|
||||
}
|
||||
@@ -689,7 +689,7 @@ ol.parser.ogc.SLD_v1.prototype.getScaleDenominatorFromResolution_ =
|
||||
|
||||
/**
|
||||
* @param {string|Document|Element} data Data to read.
|
||||
* @param {ol.parser.SLDReadOptions=} opt_options Read options.
|
||||
* @param {olx.parser.SLDReadOptions=} opt_options Read options.
|
||||
* @return {Object} An object representing the document.
|
||||
*/
|
||||
ol.parser.ogc.SLD_v1.prototype.read = function(data, opt_options) {
|
||||
@@ -713,7 +713,7 @@ ol.parser.ogc.SLD_v1.prototype.read = function(data, opt_options) {
|
||||
|
||||
/**
|
||||
* @param {Object} style The style to write out.
|
||||
* @param {ol.parser.SLDWriteOptions=} opt_options Write options.
|
||||
* @param {olx.parser.SLDWriteOptions=} opt_options Write options.
|
||||
* @return {string} The serialized SLD.
|
||||
*/
|
||||
ol.parser.ogc.SLD_v1.prototype.write = function(style, opt_options) {
|
||||
|
||||
@@ -28,9 +28,9 @@ ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
this.writers = {};
|
||||
this.writers[this.defaultNamespaceURI] = {
|
||||
/**
|
||||
* @param {ol.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @param {olx.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @return {{node: Node,
|
||||
* options: ol.parser.WFSWriteGetFeatureOptions}} Object.
|
||||
* options: olx.parser.WFSWriteGetFeatureOptions}} Object.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
'GetFeature': function(options) {
|
||||
@@ -64,7 +64,7 @@ ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
* @param {{inserts: Array.<ol.Feature>,
|
||||
* updates: Array.<ol.Feature>,
|
||||
* deletes: Array.<ol.Feature>,
|
||||
* options: ol.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
@@ -120,7 +120,7 @@ ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: ol.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
@@ -140,7 +140,7 @@ ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: ol.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
@@ -213,7 +213,7 @@ ol.parser.ogc.WFS_v1 = function(opt_options) {
|
||||
},
|
||||
/**
|
||||
* @param {{feature: ol.Feature,
|
||||
* options: ol.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* options: olx.parser.WFSWriteTransactionOptions}} obj Object.
|
||||
* @return {Element} Node.
|
||||
* @this {ol.parser.XML}
|
||||
*/
|
||||
@@ -338,7 +338,7 @@ ol.parser.ogc.WFS_v1.prototype.read = function(data) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @param {olx.parser.WFSWriteGetFeatureOptions} options Options.
|
||||
* @return {string} A serialized WFS GetFeature query.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.writeGetFeature = function(options) {
|
||||
@@ -352,7 +352,7 @@ ol.parser.ogc.WFS_v1.prototype.writeGetFeature = function(options) {
|
||||
* @param {Array.<ol.Feature>} inserts The features to insert.
|
||||
* @param {Array.<ol.Feature>} updates The features to update.
|
||||
* @param {Array.<ol.Feature>} deletes The features to delete.
|
||||
* @param {ol.parser.WFSWriteTransactionOptions} options Write options.
|
||||
* @param {olx.parser.WFSWriteTransactionOptions} options Write options.
|
||||
* @return {string} A serialized WFS transaction.
|
||||
*/
|
||||
ol.parser.ogc.WFS_v1.prototype.writeTransaction =
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@exportClass ol.style.Fill ol.style.FillOptions
|
||||
@exportClass ol.style.Icon ol.style.IconOptions
|
||||
@exportClass ol.style.Rule ol.style.RuleOptions
|
||||
@exportClass ol.style.Shape ol.style.ShapeOptions
|
||||
@exportClass ol.style.Stroke ol.style.StrokeOptions
|
||||
@exportClass ol.style.Style ol.style.StyleOptions
|
||||
@exportClass ol.style.Text ol.style.TextOptions
|
||||
@exportSymbol ol.style.Fill
|
||||
@exportSymbol ol.style.Icon
|
||||
@exportSymbol ol.style.Rule
|
||||
@exportSymbol ol.style.Shape
|
||||
@exportSymbol ol.style.Stroke
|
||||
@exportSymbol ol.style.Style
|
||||
@exportSymbol ol.style.Text
|
||||
@exportSymbol ol.style.ShapeType
|
||||
@exportProperty ol.style.ShapeType.CIRCLE
|
||||
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.style.Symbolizer');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.style.Symbolizer}
|
||||
* @param {ol.style.FillOptions=} opt_options Polygon options.
|
||||
* @param {olx.style.FillOptions=} opt_options Polygon options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.style.Fill = function(opt_options) {
|
||||
@@ -68,7 +68,7 @@ ol.style.Fill.prototype.createLiteral = function(featureOrType) {
|
||||
var literal = null;
|
||||
|
||||
if (type === ol.geom.GeometryType.POLYGON ||
|
||||
type === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
|
||||
var color = ol.expr.evaluateFeature(this.color_, feature);
|
||||
goog.asserts.assertString(
|
||||
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.style.Point');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.style.Point}
|
||||
* @param {ol.style.IconOptions} options Icon options.
|
||||
* @param {olx.style.IconOptions} options Icon options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.style.Icon = function(options) {
|
||||
@@ -112,7 +112,7 @@ ol.style.Icon.prototype.createLiteral = function(featureOrType) {
|
||||
|
||||
var literal = null;
|
||||
if (type === ol.geom.GeometryType.POINT ||
|
||||
type === ol.geom.GeometryType.MULTIPOINT) {
|
||||
type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
|
||||
var url = ol.expr.evaluateFeature(this.url_, feature);
|
||||
goog.asserts.assertString(url, 'url must be a string');
|
||||
|
||||
@@ -11,7 +11,7 @@ goog.require('ol.style.Symbolizer');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {ol.style.RuleOptions} options Rule options.
|
||||
* @param {olx.style.RuleOptions} options Rule options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.style.Rule = function(options) {
|
||||
|
||||
@@ -17,7 +17,7 @@ goog.require('ol.style.Stroke');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.style.Point}
|
||||
* @param {ol.style.ShapeOptions} options Shape options.
|
||||
* @param {olx.style.ShapeOptions} options Shape options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.style.Shape = function(options) {
|
||||
@@ -84,7 +84,7 @@ ol.style.Shape.prototype.createLiteral = function(featureOrType) {
|
||||
|
||||
var literal = null;
|
||||
if (type === ol.geom.GeometryType.POINT ||
|
||||
type === ol.geom.GeometryType.MULTIPOINT) {
|
||||
type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
var size = Number(ol.expr.evaluateFeature(this.size_, feature));
|
||||
goog.asserts.assert(!isNaN(size), 'size must be a number');
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ goog.require('ol.style.Symbolizer');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.style.Symbolizer}
|
||||
* @param {ol.style.StrokeOptions=} opt_options Stroke options.
|
||||
* @param {olx.style.StrokeOptions=} opt_options Stroke options.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.style.Stroke = function(opt_options) {
|
||||
@@ -93,8 +93,8 @@ ol.style.Stroke.prototype.createLiteral = function(featureOrType) {
|
||||
goog.asserts.assert(!isNaN(zIndex), 'zIndex must be a number');
|
||||
|
||||
var literal = null;
|
||||
if (type === ol.geom.GeometryType.LINESTRING ||
|
||||
type === ol.geom.GeometryType.MULTILINESTRING) {
|
||||
if (type === ol.geom.GeometryType.LINE_STRING ||
|
||||
type === ol.geom.GeometryType.MULTI_LINE_STRING) {
|
||||
literal = new ol.style.LineLiteral({
|
||||
color: color,
|
||||
opacity: opacity,
|
||||
@@ -102,7 +102,7 @@ ol.style.Stroke.prototype.createLiteral = function(featureOrType) {
|
||||
zIndex: zIndex
|
||||
});
|
||||
} else if (type === ol.geom.GeometryType.POLYGON ||
|
||||
type === ol.geom.GeometryType.MULTIPOLYGON) {
|
||||
type === ol.geom.GeometryType.MULTI_POLYGON) {
|
||||
literal = new ol.style.PolygonLiteral({
|
||||
strokeColor: color,
|
||||
strokeOpacity: opacity,
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.style.TextLiteral');
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.style.Symbolizer}
|
||||
* @param {ol.style.TextOptions} options Text options.
|
||||
* @param {olx.style.TextOptions} options Text options.
|
||||
*/
|
||||
ol.style.Text = function(options) {
|
||||
|
||||
|
||||
@@ -792,10 +792,10 @@ describe('ol.expr.lib', function() {
|
||||
]])
|
||||
});
|
||||
|
||||
var isPoint = parse('geometryType("point")');
|
||||
var isLine = parse('geometryType("linestring")');
|
||||
var isPoly = parse('geometryType("polygon")');
|
||||
var pointOrPoly = parse('geometryType("point") || geometryType("polygon")');
|
||||
var isPoint = parse('geometryType("Point")');
|
||||
var isLine = parse('geometryType("LineString")');
|
||||
var isPoly = parse('geometryType("Polygon")');
|
||||
var pointOrPoly = parse('geometryType("Point") || geometryType("Polygon")');
|
||||
|
||||
it('distinguishes point features', function() {
|
||||
expect(evaluate(isPoint, point)).to.be(true);
|
||||
|
||||
@@ -104,7 +104,7 @@ describe('ol.interaction.Draw', function() {
|
||||
beforeEach(function() {
|
||||
map.addInteraction(new ol.interaction.Draw({
|
||||
layer: layer,
|
||||
type: ol.geom.GeometryType.MULTIPOINT
|
||||
type: ol.geom.GeometryType.MULTI_POINT
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -127,7 +127,7 @@ describe('ol.interaction.Draw', function() {
|
||||
beforeEach(function() {
|
||||
map.addInteraction(new ol.interaction.Draw({
|
||||
layer: layer,
|
||||
type: ol.geom.GeometryType.LINESTRING
|
||||
type: ol.geom.GeometryType.LINE_STRING
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -196,7 +196,7 @@ describe('ol.interaction.Draw', function() {
|
||||
beforeEach(function() {
|
||||
map.addInteraction(new ol.interaction.Draw({
|
||||
layer: layer,
|
||||
type: ol.geom.GeometryType.MULTILINESTRING
|
||||
type: ol.geom.GeometryType.MULTI_LINE_STRING
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -279,7 +279,7 @@ describe('ol.interaction.Draw', function() {
|
||||
beforeEach(function() {
|
||||
map.addInteraction(new ol.interaction.Draw({
|
||||
layer: layer,
|
||||
type: ol.geom.GeometryType.MULTIPOLYGON
|
||||
type: ol.geom.GeometryType.MULTI_POLYGON
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('ol.parser.gpx', function() {
|
||||
feature = obj.features[1];
|
||||
geom = feature.getGeometry();
|
||||
var attributes = feature.getAttributes();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[-0.1829991904, 51.3761803674],
|
||||
[-0.1758887005, 51.3697894659], [-0.1833202965, 51.3639790884],
|
||||
[-0.1751119509, 51.3567607069]]);
|
||||
@@ -29,7 +29,7 @@ describe('ol.parser.gpx', function() {
|
||||
feature = obj.features[2];
|
||||
geom = feature.getGeometry();
|
||||
attributes = feature.getAttributes();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[-0.1721292044, 51.3768216433],
|
||||
[-0.1649230916, 51.370833767], [-0.1736741378, 51.3644368725],
|
||||
[-0.166259525, 51.3576354272]]);
|
||||
|
||||
@@ -198,7 +198,7 @@ describe('ol.parser.KML', function() {
|
||||
var stroke = symbolizers[0];
|
||||
expect(stroke).to.be.a(ol.style.Stroke);
|
||||
|
||||
var literal = stroke.createLiteral(ol.geom.GeometryType.LINESTRING);
|
||||
var literal = stroke.createLiteral(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(literal).to.be.a(ol.style.LineLiteral);
|
||||
expect(literal.color).to.eql('#ff0000');
|
||||
expect(literal.opacity).to.eql(0.5294117647058824);
|
||||
|
||||
@@ -9,7 +9,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/point-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('point');
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
@@ -25,7 +25,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('point');
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
@@ -34,9 +34,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipoint-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multipoint');
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('point');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
|
||||
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
|
||||
@@ -54,9 +54,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipoint');
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('point');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
|
||||
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
|
||||
@@ -67,7 +67,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linestring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('linestring');
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates.length).to.eql(2);
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
@@ -84,7 +84,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('linestring');
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates.length).to.eql(2);
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
@@ -94,9 +94,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multilinestring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
|
||||
done();
|
||||
@@ -113,9 +113,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
|
||||
done();
|
||||
@@ -125,7 +125,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/polygon-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('polygon');
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
expect(obj.geometry.coordinates.length).to.eql(3);
|
||||
expect(obj.geometry.coordinates[0].length).to.eql(4);
|
||||
expect(obj.geometry.coordinates[0]).to.eql([[1, 2], [3, 4],
|
||||
@@ -148,7 +148,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('polygon');
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -156,9 +156,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipolygon-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -173,9 +173,9 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -192,11 +192,11 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('geometrycollection');
|
||||
expect(obj.geometry.type).to.eql('GeometryCollection');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('point');
|
||||
expect(obj.geometry.parts[1].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[2].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[1].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[2].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -220,7 +220,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v2/linearring-coord.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('linearring');
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
@@ -237,7 +237,7 @@ describe('ol.parser.gml_v2', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('linearring');
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('linearring');
|
||||
expect(obj.geometry.type).to.eql('LinearRing');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
|
||||
[1, 2]]);
|
||||
done();
|
||||
@@ -41,7 +41,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('linestring');
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
@@ -51,7 +51,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
// no write test since simple features only does 2D
|
||||
expect(obj.geometry.type).to.eql('linestring');
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2, 3], [4, 5, 6]]);
|
||||
done();
|
||||
});
|
||||
@@ -68,7 +68,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('linestring');
|
||||
expect(obj.geometry.type).to.eql('LineString');
|
||||
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
done();
|
||||
});
|
||||
@@ -78,9 +78,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
afterLoadXml(url, function(xml) {
|
||||
// no write test for plural, we only write singular
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -96,9 +96,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -113,9 +113,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
done();
|
||||
});
|
||||
@@ -132,9 +132,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multilinestring');
|
||||
expect(obj.geometry.type).to.eql('MultiLineString');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('linestring');
|
||||
expect(obj.geometry.parts[0].type).to.eql('LineString');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
|
||||
done();
|
||||
});
|
||||
@@ -143,9 +143,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipoint-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multipoint');
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('point');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
@@ -161,9 +161,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipoint');
|
||||
expect(obj.geometry.type).to.eql('MultiPoint');
|
||||
expect(obj.geometry.parts.length).to.eql(3);
|
||||
expect(obj.geometry.parts[0].type).to.eql('point');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Point');
|
||||
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
@@ -172,9 +172,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipolygon-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -190,9 +190,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -200,9 +200,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
var url = 'spec/ol/parser/ogc/xml/gml_v3/multisurface-plural.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var obj = parser.read(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -217,9 +217,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -235,9 +235,9 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('multipolygon');
|
||||
expect(obj.geometry.type).to.eql('MultiPolygon');
|
||||
expect(obj.geometry.parts.length).to.eql(2);
|
||||
expect(obj.geometry.parts[0].type).to.eql('polygon');
|
||||
expect(obj.geometry.parts[0].type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -252,7 +252,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('point');
|
||||
expect(obj.geometry.type).to.eql('Point');
|
||||
expect(obj.geometry.coordinates).to.eql([1, 2]);
|
||||
done();
|
||||
});
|
||||
@@ -268,7 +268,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete parser.srsName;
|
||||
delete parser.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('polygon');
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -284,7 +284,7 @@ describe('ol.parser.gml_v3', function() {
|
||||
delete p.srsName;
|
||||
delete p.axisOrientation;
|
||||
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
|
||||
expect(obj.geometry.type).to.eql('polygon');
|
||||
expect(obj.geometry.type).to.eql('Polygon');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,13 +40,13 @@ describe('ol.parser.WKT', function() {
|
||||
it('LineString read / written correctly', function() {
|
||||
var wkt = 'LINESTRING(30 10,10 30,40 40)';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
// test whitespace when reading
|
||||
wkt = 'LINESTRING (30 10, 10 30, 40 40)';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
});
|
||||
|
||||
@@ -54,10 +54,10 @@ describe('ol.parser.WKT', function() {
|
||||
var wkt = 'MULTILINESTRING((10 10,20 20,10 40),' +
|
||||
'(40 40,30 30,40 20,30 10))';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTILINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -65,11 +65,11 @@ describe('ol.parser.WKT', function() {
|
||||
wkt = 'MULTILINESTRING ( (10 10, 20 20, 10 40), ' +
|
||||
'(40 40, 30 30, 40 20, 30 10) )';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTILINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(
|
||||
ol.geom.GeometryType.LINESTRING);
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
});
|
||||
@@ -80,7 +80,7 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -91,8 +91,8 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(2);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[1].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[1].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[35, 10], [10, 20], [15, 40], [45, 45], [35, 10]]);
|
||||
expect(rings[1].getCoordinates()).to.eql(
|
||||
@@ -105,7 +105,7 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
});
|
||||
@@ -115,7 +115,7 @@ describe('ol.parser.WKT', function() {
|
||||
var wkt = 'MULTIPOLYGON(((40 40,45 30,20 45,40 40)),' +
|
||||
'((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTIPOLYGON);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
@@ -135,7 +135,7 @@ describe('ol.parser.WKT', function() {
|
||||
'( (20 35, 45 20,30 5,10 10,10 30,20 35), ' +
|
||||
'( 30 20, 20 25,20 15 ,30 20 ) ))';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTIPOLYGON);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
@@ -155,9 +155,9 @@ describe('ol.parser.WKT', function() {
|
||||
var geom = parser.read(wkt);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRYCOLLECTION);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(components[1].getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(components[1].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(components[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -166,10 +166,10 @@ describe('ol.parser.WKT', function() {
|
||||
geom = parser.read(wkt);
|
||||
components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRYCOLLECTION);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(components[1].getType()).to.eql(
|
||||
ol.geom.GeometryType.LINESTRING);
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(components[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('ol.style.Stroke', function() {
|
||||
it('applies the default values', function() {
|
||||
var symbolizer = new ol.style.Stroke({});
|
||||
|
||||
var literal = symbolizer.createLiteral(ol.geom.GeometryType.LINESTRING);
|
||||
var literal = symbolizer.createLiteral(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(literal).to.be.a(ol.style.LineLiteral);
|
||||
expect(literal.color).to.be('#696969');
|
||||
expect(literal.opacity).to.be(0.75);
|
||||
|
||||
Reference in New Issue
Block a user