Allow geometries to use a shared vertex array
The ol.geom.SharedVertices structure represents a flattened array of vertex coordinates. This is intended to support optimal WebGL rendering.
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
goog.require('ol.Extent');
|
||||
goog.provide('ol.geom.Coordinate');
|
||||
goog.provide('ol.geom.CoordinateArray');
|
||||
goog.provide('ol.geom.Geometry');
|
||||
goog.provide('ol.geom.GeometryType');
|
||||
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.geom.SharedVertices');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
ol.geom.Geometry = function() {};
|
||||
ol.geom.Geometry = function() {
|
||||
|
||||
/**
|
||||
* @type {ol.geom.SharedVertices}
|
||||
* @protected
|
||||
*/
|
||||
this.vertices = null;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -26,6 +34,21 @@ ol.geom.Geometry.prototype.dimension;
|
||||
ol.geom.Geometry.prototype.getBounds = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array} The GeoJSON style coordinates array for the geometry.
|
||||
*/
|
||||
ol.geom.Geometry.prototype.getCoordinates = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* Get the shared vertices for this geometry.
|
||||
* @return {ol.geom.SharedVertices} The shared vertices.
|
||||
*/
|
||||
ol.geom.Geometry.prototype.getSharedVertices = function() {
|
||||
return this.vertices;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the geometry type.
|
||||
* @return {ol.geom.GeometryType} The geometry type.
|
||||
@@ -33,18 +56,6 @@ ol.geom.Geometry.prototype.getBounds = goog.abstractMethod;
|
||||
ol.geom.Geometry.prototype.getType = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Array.<number>}
|
||||
*/
|
||||
ol.geom.Coordinate;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Array.<ol.geom.Coordinate>}
|
||||
*/
|
||||
ol.geom.CoordinateArray;
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user