Using CONSTANT_CASE for geometry type
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ goog.inherits(ol.geom.GeometryEvent, goog.events.Event);
|
||||
*/
|
||||
ol.geom.GeometryType = {
|
||||
POINT: 'point',
|
||||
LINESTRING: 'linestring',
|
||||
LINEARRING: 'linearring',
|
||||
LINE_STRING: 'linestring',
|
||||
LINEAR_RING: 'linearring',
|
||||
POLYGON: 'polygon',
|
||||
MULTIPOINT: 'multipoint',
|
||||
MULTILINESTRING: 'multilinestring',
|
||||
MULTIPOLYGON: 'multipolygon',
|
||||
GEOMETRYCOLLECTION: 'geometrycollection'
|
||||
MULTI_POINT: 'multipoint',
|
||||
MULTI_LINE_STRING: 'multilinestring',
|
||||
MULTI_POLYGON: 'multipolygon',
|
||||
GEOMETRY_COLLECTION: 'geometrycollection'
|
||||
};
|
||||
|
||||
@@ -53,5 +53,5 @@ ol.geom.GeometryCollection.prototype.clone = function() {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.GeometryCollection.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.GEOMETRYCOLLECTION;
|
||||
return ol.geom.GeometryType.GEOMETRY_COLLECTION;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ ol.geom.LinearRing.isClockwise = function(coordinates) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.LINEARRING;
|
||||
return ol.geom.GeometryType.LINEAR_RING;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ ol.geom.LineString.prototype.getBounds = function() {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LineString.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.LINESTRING;
|
||||
return ol.geom.GeometryType.LINE_STRING;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ goog.inherits(ol.geom.MultiLineString, ol.geom.AbstractCollection);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.MULTILINESTRING;
|
||||
return ol.geom.GeometryType.MULTI_LINE_STRING;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ goog.inherits(ol.geom.MultiPoint, ol.geom.AbstractCollection);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.MULTIPOINT;
|
||||
return ol.geom.GeometryType.MULTI_POINT;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ goog.inherits(ol.geom.MultiPolygon, ol.geom.AbstractCollection);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.MULTIPOLYGON;
|
||||
return ol.geom.GeometryType.MULTI_POLYGON;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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_({
|
||||
|
||||
@@ -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)) {
|
||||
@@ -560,37 +560,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({
|
||||
|
||||
@@ -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
|
||||
};
|
||||
},
|
||||
|
||||
@@ -277,7 +277,7 @@ ol.renderer.canvas.VectorLayer.prototype.getFeaturesForPixel =
|
||||
geom = candidate.getGeometry();
|
||||
type = geom.getType();
|
||||
if (type === ol.geom.GeometryType.POINT ||
|
||||
type === ol.geom.GeometryType.MULTIPOINT) {
|
||||
type === ol.geom.GeometryType.MULTI_POINT) {
|
||||
// For points, check if the pixel coordinate is inside the candidate's
|
||||
// symbol
|
||||
uid = goog.getUid(candidate);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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