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,20 +1,21 @@
|
||||
goog.provide('ol.geom.LinearRing');
|
||||
|
||||
goog.require('ol.geom.CoordinateArray');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.SharedVertices');
|
||||
goog.require('ol.geom.VertexArray');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.geom.LineString}
|
||||
* @param {ol.geom.CoordinateArray} coordinates Coordinates array (e.g.
|
||||
* [[x0, y0], [x1, y1], [x0, y0]]).
|
||||
* @param {ol.geom.VertexArray} coordinates Vertex array (e.g.
|
||||
* [[x0, y0], [x1, y1]]).
|
||||
* @param {ol.geom.SharedVertices=} opt_shared Shared vertices.
|
||||
*/
|
||||
ol.geom.LinearRing = function(coordinates) {
|
||||
|
||||
goog.base(this, coordinates);
|
||||
ol.geom.LinearRing = function(coordinates, opt_shared) {
|
||||
goog.base(this, coordinates, opt_shared);
|
||||
|
||||
/**
|
||||
* We're intentionally not enforcing that rings be closed right now. This
|
||||
@@ -30,5 +31,5 @@ goog.inherits(ol.geom.LinearRing, ol.geom.LineString);
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.getType = function() {
|
||||
return ol.geom.GeometryType.GEOMETRYCOLLECTION;
|
||||
return ol.geom.GeometryType.LINEARRING;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user