Geometry type enumeration

This commit is contained in:
Tim Schaub
2013-01-21 17:46:41 -07:00
parent 0fad23970c
commit 6ef2184c83
7 changed files with 74 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ goog.require('ol.Extent');
goog.provide('ol.geom.Coordinate');
goog.provide('ol.geom.CoordinateArray');
goog.provide('ol.geom.Geometry');
goog.provide('ol.geom.GeometryType');
@@ -25,6 +26,13 @@ ol.geom.Geometry.prototype.dimension;
ol.geom.Geometry.prototype.getBounds = goog.abstractMethod;
/**
* Get the geometry type.
* @return {ol.geom.GeometryType} The geometry type.
*/
ol.geom.Geometry.prototype.getType = function() {};
/**
* @typedef {Array.<number>}
*/
@@ -35,3 +43,16 @@ ol.geom.Coordinate;
* @typedef {Array.<ol.geom.Coordinate>}
*/
ol.geom.CoordinateArray;
/**
* @enum {string}
*/
ol.geom.GeometryType = {
POINT: 'point',
LINESTRING: 'linestring',
POLYGON: 'polygon',
MULTIPOINT: 'multipoint',
MULTILINESTRING: 'multilinestring',
MULTIPOLYGON: 'multipolygon'
};