Permalink
Browse files

Types for rings and mixed collections

  • Loading branch information...
1 parent 6ef2184 commit 89bc69ccc1c808c40038e050887fa36418f20361 @tschaub tschaub committed Jan 22, 2013
Showing with 21 additions and 3 deletions.
  1. +3 −1 src/ol/geom/geometry.js
  2. +9 −0 src/ol/geom/geometrycollection.js
  3. +9 −2 src/ol/geom/linearring.js
View
@@ -51,8 +51,10 @@ ol.geom.CoordinateArray;
ol.geom.GeometryType = {
POINT: 'point',
LINESTRING: 'linestring',
+ LINEARRING: 'linearring',
POLYGON: 'polygon',
MULTIPOINT: 'multipoint',
MULTILINESTRING: 'multilinestring',
- MULTIPOLYGON: 'multipolygon'
+ MULTIPOLYGON: 'multipolygon',
+ GEOMETRYCOLLECTION: 'geometrycollection'
};
@@ -3,6 +3,7 @@ goog.provide('ol.geom.GeometryCollection');
goog.require('goog.asserts');
goog.require('ol.Extent');
goog.require('ol.geom.Geometry');
+goog.require('ol.geom.GeometryType');
@@ -57,3 +58,11 @@ ol.geom.GeometryCollection.prototype.getBounds = function() {
}
return this.bounds;
};
+
+
+/**
+ * @inheritDoc
+ */
+ol.geom.GeometryCollection.prototype.getType = function() {
+ return ol.geom.GeometryType.GEOMETRYCOLLECTION;
+};
View
@@ -1,8 +1,7 @@
goog.provide('ol.geom.LinearRing');
-goog.require('goog.asserts');
-goog.require('goog.vec.Float64Array');
goog.require('ol.geom.CoordinateArray');
+goog.require('ol.geom.GeometryType');
goog.require('ol.geom.LineString');
@@ -25,3 +24,11 @@ ol.geom.LinearRing = function(coordinates) {
};
goog.inherits(ol.geom.LinearRing, ol.geom.LineString);
+
+
+/**
+ * @inheritDoc
+ */
+ol.geom.LinearRing.prototype.getType = function() {
+ return ol.geom.GeometryType.GEOMETRYCOLLECTION;
+};

0 comments on commit 89bc69c

Please sign in to comment.