Implement clone for simple geometries
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.LinearRing
|
||||
@exportProperty ol.geom.LinearRing.prototype.clone
|
||||
@exportProperty ol.geom.LinearRing.prototype.getArea
|
||||
@exportProperty ol.geom.LinearRing.prototype.getCoordinates
|
||||
@exportProperty ol.geom.LinearRing.prototype.getType
|
||||
|
||||
@@ -36,6 +36,16 @@ ol.geom.LinearRing = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.LinearRing, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LinearRing.prototype.clone = function() {
|
||||
var linearRing = new ol.geom.LinearRing(null);
|
||||
linearRing.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
||||
return linearRing;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.LineString
|
||||
@exportProperty ol.geom.LineString.prototype.clone
|
||||
@exportProperty ol.geom.LineString.prototype.getCoordinates
|
||||
@exportProperty ol.geom.LineString.prototype.getType
|
||||
@exportProperty ol.geom.LineString.prototype.setCoordinates
|
||||
|
||||
@@ -36,6 +36,16 @@ ol.geom.LineString = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.LineString, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.LineString.prototype.clone = function() {
|
||||
var lineString = new ol.geom.LineString(null);
|
||||
lineString.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
||||
return lineString;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.MultiLineString
|
||||
@exportProperty ol.geom.MultiLineString.prototype.clone
|
||||
@exportProperty ol.geom.MultiLineString.prototype.getCoordinates
|
||||
@exportProperty ol.geom.MultiLineString.prototype.getLineStrings
|
||||
@exportProperty ol.geom.MultiLineString.prototype.getType
|
||||
|
||||
@@ -43,6 +43,17 @@ ol.geom.MultiLineString = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.MultiLineString, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiLineString.prototype.clone = function() {
|
||||
var multiLineString = new ol.geom.MultiLineString(null);
|
||||
multiLineString.setFlatCoordinates(
|
||||
this.layout, this.flatCoordinates.slice(), this.ends_.slice());
|
||||
return multiLineString;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.MultiPoint
|
||||
@exportProperty ol.geom.MultiPoint.prototype.clone
|
||||
@exportProperty ol.geom.MultiPoint.prototype.getCoordinates
|
||||
@exportProperty ol.geom.MultiPoint.prototype.getPoints
|
||||
@exportProperty ol.geom.MultiPoint.prototype.getType
|
||||
|
||||
@@ -20,6 +20,16 @@ ol.geom.MultiPoint = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPoint.prototype.clone = function() {
|
||||
var multiPoint = new ol.geom.MultiPoint(null);
|
||||
multiPoint.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
||||
return multiPoint;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.MultiPolygon
|
||||
@exportProperty ol.geom.MultiPolygon.prototype.clone
|
||||
@exportProperty ol.geom.MultiPolygon.prototype.getArea
|
||||
@exportProperty ol.geom.MultiPolygon.prototype.getCoordinates
|
||||
@exportProperty ol.geom.MultiPolygon.prototype.getPolygons
|
||||
|
||||
@@ -55,6 +55,17 @@ ol.geom.MultiPolygon = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.clone = function() {
|
||||
var multiPolygon = new ol.geom.MultiPolygon(null);
|
||||
multiPolygon.setFlatCoordinates(
|
||||
this.layout, this.flatCoordinates.slice(), this.endss_.slice());
|
||||
return multiPolygon;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.Point
|
||||
@exportProperty ol.geom.Point.prototype.clone
|
||||
@exportProperty ol.geom.Point.prototype.getCoordinates
|
||||
@exportProperty ol.geom.Point.prototype.getType
|
||||
@exportProperty ol.geom.Point.prototype.setCoordinates
|
||||
|
||||
@@ -20,6 +20,16 @@ ol.geom.Point = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.Point, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Point.prototype.clone = function() {
|
||||
var point = new ol.geom.Point(null);
|
||||
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
|
||||
return point;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@exportSymbol ol.geom.Polygon
|
||||
@exportProperty ol.geom.Polygon.prototype.clone
|
||||
@exportProperty ol.geom.Polygon.prototype.getArea
|
||||
@exportProperty ol.geom.Polygon.prototype.getCoordinates
|
||||
@exportProperty ol.geom.Polygon.prototype.getLinearRings
|
||||
|
||||
@@ -55,6 +55,17 @@ ol.geom.Polygon = function(coordinates, opt_layout) {
|
||||
goog.inherits(ol.geom.Polygon, ol.geom.SimpleGeometry);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.Polygon.prototype.clone = function() {
|
||||
var polygon = new ol.geom.Polygon(null);
|
||||
polygon.setFlatCoordinates(
|
||||
this.layout, this.flatCoordinates.slice(), this.ends_.slice());
|
||||
return polygon;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user