Merge pull request #2565 from elemoine/apistable5

Add @api stable annotations for ol.Feature and the ol.geom namespace
This commit is contained in:
Éric Lemoine
2014-08-22 07:37:28 +02:00
13 changed files with 127 additions and 186 deletions

View File

@@ -55,7 +55,7 @@ goog.require('ol.style.Style');
* You may pass a Geometry object directly, or an object literal * You may pass a Geometry object directly, or an object literal
* containing properties. If you pass an object literal, you may * containing properties. If you pass an object literal, you may
* include a Geometry associated with a `geometry` key. * include a Geometry associated with a `geometry` key.
* @api * @api stable
*/ */
ol.Feature = function(opt_geometryOrProperties) { ol.Feature = function(opt_geometryOrProperties) {
@@ -117,7 +117,7 @@ goog.inherits(ol.Feature, ol.Object);
* Clone this feature. If the original feature has a geometry it * Clone this feature. If the original feature has a geometry it
* is also cloned. The feature id is not set in the clone. * is also cloned. The feature id is not set in the clone.
* @return {ol.Feature} The clone. * @return {ol.Feature} The clone.
* @api * @api stable
*/ */
ol.Feature.prototype.clone = function() { ol.Feature.prototype.clone = function() {
var clone = new ol.Feature(this.getProperties()); var clone = new ol.Feature(this.getProperties());
@@ -139,7 +139,7 @@ ol.Feature.prototype.clone = function() {
* with this feature using the current geometry name property. By * with this feature using the current geometry name property. By
* default, this is `geometry` but it may be changed by calling * default, this is `geometry` but it may be changed by calling
* `setGeometryName`. * `setGeometryName`.
* @api * @api stable
* @observable * @observable
*/ */
ol.Feature.prototype.getGeometry = function() { ol.Feature.prototype.getGeometry = function() {
@@ -154,7 +154,7 @@ goog.exportProperty(
/** /**
* @return {number|string|undefined} Id. * @return {number|string|undefined} Id.
* @api * @api stable
*/ */
ol.Feature.prototype.getId = function() { ol.Feature.prototype.getId = function() {
return this.id_; return this.id_;
@@ -165,7 +165,7 @@ ol.Feature.prototype.getId = function() {
* @return {string} Get the property name associated with the geometry for * @return {string} Get the property name associated with the geometry for
* this feature. By default, this is `geometry` but it may be changed by * this feature. By default, this is `geometry` but it may be changed by
* calling `setGeometryName`. * calling `setGeometryName`.
* @api * @api stable
*/ */
ol.Feature.prototype.getGeometryName = function() { ol.Feature.prototype.getGeometryName = function() {
return this.geometryName_; return this.geometryName_;
@@ -177,7 +177,7 @@ ol.Feature.prototype.getGeometryName = function() {
* ol.feature.FeatureStyleFunction} Return the style as set by setStyle in * ol.feature.FeatureStyleFunction} Return the style as set by setStyle in
* the same format that it was provided in. If setStyle has not been run, * the same format that it was provided in. If setStyle has not been run,
* return `undefined`. * return `undefined`.
* @api * @api stable
*/ */
ol.Feature.prototype.getStyle = function() { ol.Feature.prototype.getStyle = function() {
return this.style_; return this.style_;
@@ -187,7 +187,7 @@ ol.Feature.prototype.getStyle = function() {
/** /**
* @return {ol.feature.FeatureStyleFunction|undefined} Return a function * @return {ol.feature.FeatureStyleFunction|undefined} Return a function
* representing the current style of this feature. * representing the current style of this feature.
* @api * @api stable
*/ */
ol.Feature.prototype.getStyleFunction = function() { ol.Feature.prototype.getStyleFunction = function() {
return this.styleFunction_; return this.styleFunction_;
@@ -224,7 +224,7 @@ ol.Feature.prototype.handleGeometryChanged_ = function() {
* feature. This will update the property associated with the current * feature. This will update the property associated with the current
* geometry property name. By default, this is `geometry` but it can be * geometry property name. By default, this is `geometry` but it can be
* changed by calling `setGeometryName`. * changed by calling `setGeometryName`.
* @api * @api stable
* @observable * @observable
*/ */
ol.Feature.prototype.setGeometry = function(geometry) { ol.Feature.prototype.setGeometry = function(geometry) {
@@ -239,7 +239,7 @@ goog.exportProperty(
/** /**
* @param {ol.style.Style|Array.<ol.style.Style>| * @param {ol.style.Style|Array.<ol.style.Style>|
* ol.feature.FeatureStyleFunction} style Set the style for this feature. * ol.feature.FeatureStyleFunction} style Set the style for this feature.
* @api * @api stable
*/ */
ol.Feature.prototype.setStyle = function(style) { ol.Feature.prototype.setStyle = function(style) {
this.style_ = style; this.style_ = style;
@@ -252,7 +252,7 @@ ol.Feature.prototype.setStyle = function(style) {
* @param {number|string|undefined} id Set a unique id for this feature. * @param {number|string|undefined} id Set a unique id for this feature.
* The id may be used to retrieve a feature from a vector source with the * The id may be used to retrieve a feature from a vector source with the
* {@link ol.source.Vector#getFeatureById} method. * {@link ol.source.Vector#getFeatureById} method.
* @api * @api stable
*/ */
ol.Feature.prototype.setId = function(id) { ol.Feature.prototype.setId = function(id) {
this.id_ = id; this.id_ = id;
@@ -263,7 +263,7 @@ ol.Feature.prototype.setId = function(id) {
/** /**
* @param {string} name Set the property name from which this feature's * @param {string} name Set the property name from which this feature's
* geometry will be fetched when calling `getGeometry`. * geometry will be fetched when calling `getGeometry`.
* @api * @api stable
*/ */
ol.Feature.prototype.setGeometryName = function(name) { ol.Feature.prototype.setGeometryName = function(name) {
goog.events.unlisten( goog.events.unlisten(
@@ -284,7 +284,7 @@ ol.Feature.prototype.setGeometryName = function(name) {
* {@link ol.Feature} to be styled. * {@link ol.Feature} to be styled.
* *
* @typedef {function(this: ol.Feature, number): Array.<ol.style.Style>} * @typedef {function(this: ol.Feature, number): Array.<ol.style.Style>}
* @api * @api stable
*/ */
ol.feature.FeatureStyleFunction; ol.feature.FeatureStyleFunction;

View File

@@ -14,7 +14,7 @@ goog.require('ol.geom.flat.deflate');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawPoint} center Center. * @param {ol.Coordinate} center Center.
* @param {number=} opt_radius Radius. * @param {number=} opt_radius Radius.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api
@@ -82,7 +82,7 @@ ol.geom.Circle.prototype.containsXY = function(x, y) {
/** /**
* @return {ol.geom.RawPoint} Center. * @return {ol.Coordinate} Center.
* @api * @api
*/ */
ol.geom.Circle.prototype.getCenter = function() { ol.geom.Circle.prototype.getCenter = function() {
@@ -139,7 +139,7 @@ ol.geom.Circle.prototype.getType = function() {
/** /**
* @param {ol.geom.RawPoint} center Center. * @param {ol.Coordinate} center Center.
* @api * @api
*/ */
ol.geom.Circle.prototype.setCenter = function(center) { ol.geom.Circle.prototype.setCenter = function(center) {
@@ -157,7 +157,7 @@ ol.geom.Circle.prototype.setCenter = function(center) {
/** /**
* @param {ol.geom.RawPoint} center Center. * @param {ol.Coordinate} center Center.
* @param {number} radius Radius. * @param {number} radius Radius.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api

View File

@@ -12,7 +12,7 @@ goog.require('ol.proj');
* `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`, * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`,
* `'GeometryCollection'`, `'Circle'`. * `'GeometryCollection'`, `'Circle'`.
* @enum {string} * @enum {string}
* @api * @api stable
*/ */
ol.geom.GeometryType = { ol.geom.GeometryType = {
POINT: 'Point', POINT: 'Point',
@@ -32,7 +32,7 @@ ol.geom.GeometryType = {
* or measure ('M') coordinate is available. Supported values are `'XY'`, * or measure ('M') coordinate is available. Supported values are `'XY'`,
* `'XYZ'`, `'XYM'`, `'XYZM'`. * `'XYZ'`, `'XYM'`, `'XYZM'`.
* @enum {string} * @enum {string}
* @api * @api stable
*/ */
ol.geom.GeometryLayout = { ol.geom.GeometryLayout = {
XY: 'XY', XY: 'XY',
@@ -52,7 +52,7 @@ ol.geom.GeometryLayout = {
* @constructor * @constructor
* @extends {ol.Observable} * @extends {ol.Observable}
* @fires change Triggered when the geometry changes. * @fires change Triggered when the geometry changes.
* @api * @api stable
*/ */
ol.geom.Geometry = function() { ol.geom.Geometry = function() {
@@ -96,7 +96,7 @@ goog.inherits(ol.geom.Geometry, ol.Observable);
* Make a complete copy of the geometry. * Make a complete copy of the geometry.
* @function * @function
* @return {ol.geom.Geometry} Clone. * @return {ol.geom.Geometry} Clone.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.clone = goog.abstractMethod; ol.geom.Geometry.prototype.clone = goog.abstractMethod;
@@ -115,7 +115,7 @@ ol.geom.Geometry.prototype.closestPointXY = goog.abstractMethod;
* @param {ol.Coordinate} point Point. * @param {ol.Coordinate} point Point.
* @param {ol.Coordinate=} opt_closestPoint Closest point. * @param {ol.Coordinate=} opt_closestPoint Closest point.
* @return {ol.Coordinate} Closest point. * @return {ol.Coordinate} Closest point.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) { ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
var closestPoint = goog.isDef(opt_closestPoint) ? var closestPoint = goog.isDef(opt_closestPoint) ?
@@ -147,7 +147,7 @@ ol.geom.Geometry.prototype.containsXY = goog.functions.FALSE;
* @function * @function
* @param {ol.Extent=} opt_extent Extent. * @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} extent Extent. * @return {ol.Extent} extent Extent.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.getExtent = goog.abstractMethod; ol.geom.Geometry.prototype.getExtent = goog.abstractMethod;
@@ -159,7 +159,6 @@ ol.geom.Geometry.prototype.getExtent = goog.abstractMethod;
* @function * @function
* @param {number} squaredTolerance Squared tolerance. * @param {number} squaredTolerance Squared tolerance.
* @return {ol.geom.Geometry} Simplified geometry. * @return {ol.geom.Geometry} Simplified geometry.
* @api
*/ */
ol.geom.Geometry.prototype.getSimplifiedGeometry = goog.abstractMethod; ol.geom.Geometry.prototype.getSimplifiedGeometry = goog.abstractMethod;
@@ -168,7 +167,7 @@ ol.geom.Geometry.prototype.getSimplifiedGeometry = goog.abstractMethod;
* Get the type of this geometry. * Get the type of this geometry.
* @function * @function
* @return {ol.geom.GeometryType} Geometry type. * @return {ol.geom.GeometryType} Geometry type.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.getType = goog.abstractMethod; ol.geom.Geometry.prototype.getType = goog.abstractMethod;
@@ -179,7 +178,7 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod;
* then use this function on the clone. * then use this function on the clone.
* @function * @function
* @param {ol.TransformFunction} transformFn Transform. * @param {ol.TransformFunction} transformFn Transform.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod; ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod;
@@ -196,65 +195,9 @@ ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod;
* string identifier or a {@link ol.proj.Projection} object. * string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Geometry} This geometry. Note that original geometry is * @return {ol.geom.Geometry} This geometry. Note that original geometry is
* modified in place. * modified in place.
* @api * @api stable
*/ */
ol.geom.Geometry.prototype.transform = function(source, destination) { ol.geom.Geometry.prototype.transform = function(source, destination) {
this.applyTransform(ol.proj.getTransform(source, destination)); this.applyTransform(ol.proj.getTransform(source, destination));
return this; return this;
}; };
/**
* Array representation of a point. Example: `[16, 48]`.
* @typedef {ol.Coordinate}
* @api
*/
ol.geom.RawPoint;
/**
* Array representation of a linestring.
* @typedef {Array.<ol.Coordinate>}
* @api
*/
ol.geom.RawLineString;
/**
* Array representation of a linear ring.
* @typedef {Array.<ol.Coordinate>}
* @api
*/
ol.geom.RawLinearRing;
/**
* Array representation of a polygon.
* @typedef {Array.<ol.geom.RawLinearRing>}
* @api
*/
ol.geom.RawPolygon;
/**
* Array representation of a multipoint.
* @typedef {Array.<ol.geom.RawPoint>}
* @api
*/
ol.geom.RawMultiPoint;
/**
* Array representation of a multilinestring.
* @typedef {Array.<ol.geom.RawLineString>}
* @api
*/
ol.geom.RawMultiLineString;
/**
* Array representation of a multipolygon.
* @typedef {Array.<ol.geom.RawPolygon>}
* @api
*/
ol.geom.RawMultiPolygon;

View File

@@ -18,7 +18,7 @@ goog.require('ol.geom.GeometryType');
* @constructor * @constructor
* @extends {ol.geom.Geometry} * @extends {ol.geom.Geometry}
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries. * @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
* @api * @api stable
*/ */
ol.geom.GeometryCollection = function(opt_geometries) { ol.geom.GeometryCollection = function(opt_geometries) {
@@ -84,7 +84,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.GeometryCollection.prototype.clone = function() { ol.geom.GeometryCollection.prototype.clone = function() {
var geometryCollection = new ol.geom.GeometryCollection(null); var geometryCollection = new ol.geom.GeometryCollection(null);
@@ -129,7 +129,7 @@ ol.geom.GeometryCollection.prototype.containsXY = function(x, y) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.GeometryCollection.prototype.getExtent = function(opt_extent) { ol.geom.GeometryCollection.prototype.getExtent = function(opt_extent) {
if (this.extentRevision != this.getRevision()) { if (this.extentRevision != this.getRevision()) {
@@ -149,7 +149,7 @@ ol.geom.GeometryCollection.prototype.getExtent = function(opt_extent) {
/** /**
* @return {Array.<ol.geom.Geometry>} Geometries. * @return {Array.<ol.geom.Geometry>} Geometries.
* @api * @api stable
*/ */
ol.geom.GeometryCollection.prototype.getGeometries = function() { ol.geom.GeometryCollection.prototype.getGeometries = function() {
return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_); return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_);
@@ -166,7 +166,6 @@ ol.geom.GeometryCollection.prototype.getGeometriesArray = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api
*/ */
ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = ol.geom.GeometryCollection.prototype.getSimplifiedGeometry =
function(squaredTolerance) { function(squaredTolerance) {
@@ -211,7 +210,7 @@ ol.geom.GeometryCollection.prototype.getSimplifiedGeometry =
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.GeometryCollection.prototype.getType = function() { ol.geom.GeometryCollection.prototype.getType = function() {
return ol.geom.GeometryType.GEOMETRY_COLLECTION; return ol.geom.GeometryType.GEOMETRY_COLLECTION;
@@ -228,7 +227,7 @@ ol.geom.GeometryCollection.prototype.isEmpty = function() {
/** /**
* @param {Array.<ol.geom.Geometry>} geometries Geometries. * @param {Array.<ol.geom.Geometry>} geometries Geometries.
* @api * @api stable
*/ */
ol.geom.GeometryCollection.prototype.setGeometries = function(geometries) { ol.geom.GeometryCollection.prototype.setGeometries = function(geometries) {
this.setGeometriesArray( this.setGeometriesArray(

View File

@@ -18,9 +18,9 @@ goog.require('ol.geom.flat.simplify');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawLinearRing} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.LinearRing = function(coordinates, opt_layout) { ol.geom.LinearRing = function(coordinates, opt_layout) {
@@ -47,7 +47,7 @@ goog.inherits(ol.geom.LinearRing, ol.geom.SimpleGeometry);
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.LinearRing.prototype.clone = function() { ol.geom.LinearRing.prototype.clone = function() {
var linearRing = new ol.geom.LinearRing(null); var linearRing = new ol.geom.LinearRing(null);
@@ -78,7 +78,7 @@ ol.geom.LinearRing.prototype.closestPointXY =
/** /**
* @return {number} Area (on projected plane). * @return {number} Area (on projected plane).
* @api * @api stable
*/ */
ol.geom.LinearRing.prototype.getArea = function() { ol.geom.LinearRing.prototype.getArea = function() {
return ol.geom.flat.area.linearRing( return ol.geom.flat.area.linearRing(
@@ -87,8 +87,8 @@ ol.geom.LinearRing.prototype.getArea = function() {
/** /**
* @return {ol.geom.RawLinearRing} Coordinates. * @return {Array.<ol.Coordinate>} Coordinates.
* @api * @api stable
*/ */
ol.geom.LinearRing.prototype.getCoordinates = function() { ol.geom.LinearRing.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates( return ol.geom.flat.inflate.coordinates(
@@ -114,7 +114,7 @@ ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal =
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.LinearRing.prototype.getType = function() { ol.geom.LinearRing.prototype.getType = function() {
return ol.geom.GeometryType.LINEAR_RING; return ol.geom.GeometryType.LINEAR_RING;
@@ -122,9 +122,9 @@ ol.geom.LinearRing.prototype.getType = function() {
/** /**
* @param {ol.geom.RawLinearRing} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.LinearRing.prototype.setCoordinates = ol.geom.LinearRing.prototype.setCoordinates =
function(coordinates, opt_layout) { function(coordinates, opt_layout) {

View File

@@ -20,9 +20,9 @@ goog.require('ol.geom.flat.simplify');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawLineString} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.LineString = function(coordinates, opt_layout) { ol.geom.LineString = function(coordinates, opt_layout) {
@@ -61,7 +61,7 @@ goog.inherits(ol.geom.LineString, ol.geom.SimpleGeometry);
/** /**
* @param {ol.Coordinate} coordinate Coordinate. * @param {ol.Coordinate} coordinate Coordinate.
* @api * @api stable
*/ */
ol.geom.LineString.prototype.appendCoordinate = function(coordinate) { ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
goog.asserts.assert(coordinate.length == this.stride); goog.asserts.assert(coordinate.length == this.stride);
@@ -76,7 +76,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.LineString.prototype.clone = function() { ol.geom.LineString.prototype.clone = function() {
var lineString = new ol.geom.LineString(null); var lineString = new ol.geom.LineString(null);
@@ -117,7 +117,7 @@ ol.geom.LineString.prototype.closestPointXY =
* @param {number} m M. * @param {number} m M.
* @param {boolean=} opt_extrapolate Extrapolate. * @param {boolean=} opt_extrapolate Extrapolate.
* @return {ol.Coordinate} Coordinate. * @return {ol.Coordinate} Coordinate.
* @api * @api stable
*/ */
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) { ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
if (this.layout != ol.geom.GeometryLayout.XYM && if (this.layout != ol.geom.GeometryLayout.XYM &&
@@ -131,8 +131,8 @@ ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
/** /**
* @return {ol.geom.RawLineString} Coordinates. * @return {Array.<ol.Coordinate>} Coordinates.
* @api * @api stable
*/ */
ol.geom.LineString.prototype.getCoordinates = function() { ol.geom.LineString.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates( return ol.geom.flat.inflate.coordinates(
@@ -142,7 +142,7 @@ ol.geom.LineString.prototype.getCoordinates = function() {
/** /**
* @return {number} Length (on projected plane). * @return {number} Length (on projected plane).
* @api * @api stable
*/ */
ol.geom.LineString.prototype.getLength = function() { ol.geom.LineString.prototype.getLength = function() {
return ol.geom.flat.length.lineString( return ol.geom.flat.length.lineString(
@@ -182,7 +182,7 @@ ol.geom.LineString.prototype.getSimplifiedGeometryInternal =
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.LineString.prototype.getType = function() { ol.geom.LineString.prototype.getType = function() {
return ol.geom.GeometryType.LINE_STRING; return ol.geom.GeometryType.LINE_STRING;
@@ -190,9 +190,9 @@ ol.geom.LineString.prototype.getType = function() {
/** /**
* @param {ol.geom.RawLineString} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.LineString.prototype.setCoordinates = ol.geom.LineString.prototype.setCoordinates =
function(coordinates, opt_layout) { function(coordinates, opt_layout) {

View File

@@ -20,9 +20,9 @@ goog.require('ol.geom.flat.simplify');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawMultiLineString} coordinates Coordinates. * @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiLineString = function(coordinates, opt_layout) { ol.geom.MultiLineString = function(coordinates, opt_layout) {
@@ -55,7 +55,7 @@ goog.inherits(ol.geom.MultiLineString, ol.geom.SimpleGeometry);
/** /**
* @param {ol.geom.LineString} lineString LineString. * @param {ol.geom.LineString} lineString LineString.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) { ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
goog.asserts.assert(lineString.getLayout() == this.layout); goog.asserts.assert(lineString.getLayout() == this.layout);
@@ -72,7 +72,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.clone = function() { ol.geom.MultiLineString.prototype.clone = function() {
var multiLineString = new ol.geom.MultiLineString(null); var multiLineString = new ol.geom.MultiLineString(null);
@@ -122,7 +122,7 @@ ol.geom.MultiLineString.prototype.closestPointXY =
* @param {boolean=} opt_extrapolate Extrapolate. * @param {boolean=} opt_extrapolate Extrapolate.
* @param {boolean=} opt_interpolate Interpolate. * @param {boolean=} opt_interpolate Interpolate.
* @return {ol.Coordinate} Coordinate. * @return {ol.Coordinate} Coordinate.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.getCoordinateAtM = ol.geom.MultiLineString.prototype.getCoordinateAtM =
function(m, opt_extrapolate, opt_interpolate) { function(m, opt_extrapolate, opt_interpolate) {
@@ -139,8 +139,8 @@ ol.geom.MultiLineString.prototype.getCoordinateAtM =
/** /**
* @return {ol.geom.RawMultiLineString} Coordinates. * @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.getCoordinates = function() { ol.geom.MultiLineString.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinatess( return ol.geom.flat.inflate.coordinatess(
@@ -159,7 +159,7 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
/** /**
* @param {number} index Index. * @param {number} index Index.
* @return {ol.geom.LineString} LineString. * @return {ol.geom.LineString} LineString.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.getLineString = function(index) { ol.geom.MultiLineString.prototype.getLineString = function(index) {
goog.asserts.assert(0 <= index && index < this.ends_.length); goog.asserts.assert(0 <= index && index < this.ends_.length);
@@ -175,7 +175,7 @@ ol.geom.MultiLineString.prototype.getLineString = function(index) {
/** /**
* @return {Array.<ol.geom.LineString>} LineStrings. * @return {Array.<ol.geom.LineString>} LineStrings.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.getLineStrings = function() { ol.geom.MultiLineString.prototype.getLineStrings = function() {
var flatCoordinates = this.flatCoordinates; var flatCoordinates = this.flatCoordinates;
@@ -236,7 +236,7 @@ ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal =
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.getType = function() { ol.geom.MultiLineString.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_LINE_STRING; return ol.geom.GeometryType.MULTI_LINE_STRING;
@@ -244,9 +244,9 @@ ol.geom.MultiLineString.prototype.getType = function() {
/** /**
* @param {ol.geom.RawMultiLineString} coordinates Coordinates. * @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiLineString.prototype.setCoordinates = ol.geom.MultiLineString.prototype.setCoordinates =
function(coordinates, opt_layout) { function(coordinates, opt_layout) {

View File

@@ -18,9 +18,9 @@ goog.require('ol.math');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawMultiPoint} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiPoint = function(coordinates, opt_layout) { ol.geom.MultiPoint = function(coordinates, opt_layout) {
goog.base(this); goog.base(this);
@@ -32,7 +32,7 @@ goog.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
/** /**
* @param {ol.geom.Point} point Point. * @param {ol.geom.Point} point Point.
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.appendPoint = function(point) { ol.geom.MultiPoint.prototype.appendPoint = function(point) {
goog.asserts.assert(point.getLayout() == this.layout); goog.asserts.assert(point.getLayout() == this.layout);
@@ -47,7 +47,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.clone = function() { ol.geom.MultiPoint.prototype.clone = function() {
var multiPoint = new ol.geom.MultiPoint(null); var multiPoint = new ol.geom.MultiPoint(null);
@@ -84,8 +84,8 @@ ol.geom.MultiPoint.prototype.closestPointXY =
/** /**
* @return {ol.geom.RawMultiPoint} Coordinates. * @return {Array.<ol.Coordinate>} Coordinates.
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.getCoordinates = function() { ol.geom.MultiPoint.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates( return ol.geom.flat.inflate.coordinates(
@@ -96,7 +96,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
/** /**
* @param {number} index Index. * @param {number} index Index.
* @return {ol.geom.Point} Point. * @return {ol.geom.Point} Point.
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.getPoint = function(index) { ol.geom.MultiPoint.prototype.getPoint = function(index) {
var n = goog.isNull(this.flatCoordinates) ? var n = goog.isNull(this.flatCoordinates) ?
@@ -114,7 +114,7 @@ ol.geom.MultiPoint.prototype.getPoint = function(index) {
/** /**
* @return {Array.<ol.geom.Point>} Points. * @return {Array.<ol.geom.Point>} Points.
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.getPoints = function() { ol.geom.MultiPoint.prototype.getPoints = function() {
var flatCoordinates = this.flatCoordinates; var flatCoordinates = this.flatCoordinates;
@@ -134,7 +134,7 @@ ol.geom.MultiPoint.prototype.getPoints = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.getType = function() { ol.geom.MultiPoint.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_POINT; return ol.geom.GeometryType.MULTI_POINT;
@@ -142,9 +142,9 @@ ol.geom.MultiPoint.prototype.getType = function() {
/** /**
* @param {ol.geom.RawMultiPoint} coordinates Coordinates. * @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiPoint.prototype.setCoordinates = ol.geom.MultiPoint.prototype.setCoordinates =
function(coordinates, opt_layout) { function(coordinates, opt_layout) {

View File

@@ -25,9 +25,9 @@ goog.require('ol.geom.flat.simplify');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawMultiPolygon} coordinates Coordinates. * @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiPolygon = function(coordinates, opt_layout) { ol.geom.MultiPolygon = function(coordinates, opt_layout) {
@@ -84,7 +84,7 @@ goog.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
/** /**
* @param {ol.geom.Polygon} polygon Polygon. * @param {ol.geom.Polygon} polygon Polygon.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) { ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
goog.asserts.assert(polygon.getLayout() == this.layout); goog.asserts.assert(polygon.getLayout() == this.layout);
@@ -110,7 +110,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.clone = function() { ol.geom.MultiPolygon.prototype.clone = function() {
var multiPolygon = new ol.geom.MultiPolygon(null); var multiPolygon = new ol.geom.MultiPolygon(null);
@@ -151,7 +151,7 @@ ol.geom.MultiPolygon.prototype.containsXY = function(x, y) {
/** /**
* @return {number} Area (on projected plane). * @return {number} Area (on projected plane).
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getArea = function() { ol.geom.MultiPolygon.prototype.getArea = function() {
return ol.geom.flat.area.linearRingss( return ol.geom.flat.area.linearRingss(
@@ -160,8 +160,8 @@ ol.geom.MultiPolygon.prototype.getArea = function() {
/** /**
* @return {ol.geom.RawMultiPolygon} Coordinates. * @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinates.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getCoordinates = function() { ol.geom.MultiPolygon.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinatesss( return ol.geom.flat.inflate.coordinatesss(
@@ -195,7 +195,7 @@ ol.geom.MultiPolygon.prototype.getFlatInteriorPoints = function() {
/** /**
* @return {ol.geom.MultiPoint} Interior points. * @return {ol.geom.MultiPoint} Interior points.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getInteriorPoints = function() { ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
var interiorPoints = new ol.geom.MultiPoint(null); var interiorPoints = new ol.geom.MultiPoint(null);
@@ -247,7 +247,7 @@ ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal =
/** /**
* @param {number} index Index. * @param {number} index Index.
* @return {ol.geom.Polygon} Polygon. * @return {ol.geom.Polygon} Polygon.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getPolygon = function(index) { ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
goog.asserts.assert(0 <= index && index < this.endss_.length); goog.asserts.assert(0 <= index && index < this.endss_.length);
@@ -278,7 +278,7 @@ ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
/** /**
* @return {Array.<ol.geom.Polygon>} Polygons. * @return {Array.<ol.geom.Polygon>} Polygons.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getPolygons = function() { ol.geom.MultiPolygon.prototype.getPolygons = function() {
var layout = this.layout; var layout = this.layout;
@@ -307,7 +307,7 @@ ol.geom.MultiPolygon.prototype.getPolygons = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.getType = function() { ol.geom.MultiPolygon.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_POLYGON; return ol.geom.GeometryType.MULTI_POLYGON;
@@ -315,9 +315,9 @@ ol.geom.MultiPolygon.prototype.getType = function() {
/** /**
* @param {ol.geom.RawMultiPolygon} coordinates Coordinates. * @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.MultiPolygon.prototype.setCoordinates = ol.geom.MultiPolygon.prototype.setCoordinates =
function(coordinates, opt_layout) { function(coordinates, opt_layout) {

View File

@@ -15,9 +15,9 @@ goog.require('ol.math');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawPoint} coordinates Coordinates. * @param {ol.Coordinate} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.Point = function(coordinates, opt_layout) { ol.geom.Point = function(coordinates, opt_layout) {
goog.base(this); goog.base(this);
@@ -29,7 +29,7 @@ goog.inherits(ol.geom.Point, ol.geom.SimpleGeometry);
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.Point.prototype.clone = function() { ol.geom.Point.prototype.clone = function() {
var point = new ol.geom.Point(null); var point = new ol.geom.Point(null);
@@ -61,8 +61,8 @@ ol.geom.Point.prototype.closestPointXY =
/** /**
* @return {ol.geom.RawPoint} Coordinates. * @return {ol.Coordinate} Coordinates.
* @api * @api stable
*/ */
ol.geom.Point.prototype.getCoordinates = function() { ol.geom.Point.prototype.getCoordinates = function() {
return goog.isNull(this.flatCoordinates) ? [] : this.flatCoordinates.slice(); return goog.isNull(this.flatCoordinates) ? [] : this.flatCoordinates.slice();
@@ -85,7 +85,7 @@ ol.geom.Point.prototype.getExtent = function(opt_extent) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.Point.prototype.getType = function() { ol.geom.Point.prototype.getType = function() {
return ol.geom.GeometryType.POINT; return ol.geom.GeometryType.POINT;
@@ -93,9 +93,9 @@ ol.geom.Point.prototype.getType = function() {
/** /**
* @param {ol.geom.RawPoint} coordinates Coordinates. * @param {ol.Coordinate} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) { ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) { if (goog.isNull(coordinates)) {

View File

@@ -25,9 +25,9 @@ goog.require('ol.geom.flat.simplify');
* *
* @constructor * @constructor
* @extends {ol.geom.SimpleGeometry} * @extends {ol.geom.SimpleGeometry}
* @param {ol.geom.RawPolygon} coordinates Coordinates. * @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.Polygon = function(coordinates, opt_layout) { ol.geom.Polygon = function(coordinates, opt_layout) {
@@ -84,7 +84,7 @@ goog.inherits(ol.geom.Polygon, ol.geom.SimpleGeometry);
/** /**
* @param {ol.geom.LinearRing} linearRing Linear ring. * @param {ol.geom.LinearRing} linearRing Linear ring.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) { ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
goog.asserts.assert(linearRing.getLayout() == this.layout); goog.asserts.assert(linearRing.getLayout() == this.layout);
@@ -100,7 +100,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.clone = function() { ol.geom.Polygon.prototype.clone = function() {
var polygon = new ol.geom.Polygon(null); var polygon = new ol.geom.Polygon(null);
@@ -141,7 +141,7 @@ ol.geom.Polygon.prototype.containsXY = function(x, y) {
/** /**
* @return {number} Area (on projected plane). * @return {number} Area (on projected plane).
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getArea = function() { ol.geom.Polygon.prototype.getArea = function() {
return ol.geom.flat.area.linearRings( return ol.geom.flat.area.linearRings(
@@ -150,8 +150,8 @@ ol.geom.Polygon.prototype.getArea = function() {
/** /**
* @return {ol.geom.RawPolygon} Coordinates. * @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getCoordinates = function() { ol.geom.Polygon.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinatess( return ol.geom.flat.inflate.coordinatess(
@@ -184,7 +184,7 @@ ol.geom.Polygon.prototype.getFlatInteriorPoint = function() {
/** /**
* @return {ol.geom.Point} Interior point. * @return {ol.geom.Point} Interior point.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getInteriorPoint = function() { ol.geom.Polygon.prototype.getInteriorPoint = function() {
return new ol.geom.Point(this.getFlatInteriorPoint()); return new ol.geom.Point(this.getFlatInteriorPoint());
@@ -194,7 +194,7 @@ ol.geom.Polygon.prototype.getInteriorPoint = function() {
/** /**
* @param {number} index Index. * @param {number} index Index.
* @return {ol.geom.LinearRing} Linear ring. * @return {ol.geom.LinearRing} Linear ring.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getLinearRing = function(index) { ol.geom.Polygon.prototype.getLinearRing = function(index) {
goog.asserts.assert(0 <= index && index < this.ends_.length); goog.asserts.assert(0 <= index && index < this.ends_.length);
@@ -210,7 +210,7 @@ ol.geom.Polygon.prototype.getLinearRing = function(index) {
/** /**
* @return {Array.<ol.geom.LinearRing>} Linear rings. * @return {Array.<ol.geom.LinearRing>} Linear rings.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getLinearRings = function() { ol.geom.Polygon.prototype.getLinearRings = function() {
var layout = this.layout; var layout = this.layout;
@@ -271,7 +271,7 @@ ol.geom.Polygon.prototype.getSimplifiedGeometryInternal =
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.getType = function() { ol.geom.Polygon.prototype.getType = function() {
return ol.geom.GeometryType.POLYGON; return ol.geom.GeometryType.POLYGON;
@@ -279,9 +279,9 @@ ol.geom.Polygon.prototype.getType = function() {
/** /**
* @param {ol.geom.RawPolygon} coordinates Coordinates. * @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api stable
*/ */
ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) { ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) { if (goog.isNull(coordinates)) {
@@ -326,7 +326,7 @@ ol.geom.Polygon.prototype.setFlatCoordinates =
* @param {number} radius Radius. * @param {number} radius Radius.
* @param {number=} opt_n Optional number of points. Default is `32`. * @param {number=} opt_n Optional number of points. Default is `32`.
* @return {ol.geom.Polygon} Circle geometry. * @return {ol.geom.Polygon} Circle geometry.
* @api * @api stable
*/ */
ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) { ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) {
var n = goog.isDef(opt_n) ? opt_n : 32; var n = goog.isDef(opt_n) ? opt_n : 32;

View File

@@ -16,7 +16,7 @@ goog.require('ol.geom.flat.transform');
* *
* @constructor * @constructor
* @extends {ol.geom.Geometry} * @extends {ol.geom.Geometry}
* @api * @api stable
*/ */
ol.geom.SimpleGeometry = function() { ol.geom.SimpleGeometry = function() {
@@ -90,7 +90,7 @@ ol.geom.SimpleGeometry.prototype.containsXY = goog.functions.FALSE;
/** /**
* @inheritDoc * @inheritDoc
* @api * @api stable
*/ */
ol.geom.SimpleGeometry.prototype.getExtent = function(opt_extent) { ol.geom.SimpleGeometry.prototype.getExtent = function(opt_extent) {
if (this.extentRevision != this.getRevision()) { if (this.extentRevision != this.getRevision()) {
@@ -106,7 +106,7 @@ ol.geom.SimpleGeometry.prototype.getExtent = function(opt_extent) {
/** /**
* @return {ol.Coordinate} First coordinate. * @return {ol.Coordinate} First coordinate.
* @api * @api stable
*/ */
ol.geom.SimpleGeometry.prototype.getFirstCoordinate = function() { ol.geom.SimpleGeometry.prototype.getFirstCoordinate = function() {
return this.flatCoordinates.slice(0, this.stride); return this.flatCoordinates.slice(0, this.stride);
@@ -123,7 +123,7 @@ ol.geom.SimpleGeometry.prototype.getFlatCoordinates = function() {
/** /**
* @return {ol.Coordinate} Last point. * @return {ol.Coordinate} Last point.
* @api * @api stable
*/ */
ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() { ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride); return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);
@@ -132,7 +132,7 @@ ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
/** /**
* @return {ol.geom.GeometryLayout} Layout. * @return {ol.geom.GeometryLayout} Layout.
* @api * @api stable
*/ */
ol.geom.SimpleGeometry.prototype.getLayout = function() { ol.geom.SimpleGeometry.prototype.getLayout = function() {
return this.layout; return this.layout;
@@ -141,7 +141,6 @@ ol.geom.SimpleGeometry.prototype.getLayout = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api
*/ */
ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry = ol.geom.SimpleGeometry.prototype.getSimplifiedGeometry =
function(squaredTolerance) { function(squaredTolerance) {

View File

@@ -166,10 +166,10 @@ ol.interaction.Draw = function(options) {
/** /**
* Sketch polygon. Used when drawing polygon. * Sketch polygon. Used when drawing polygon.
* @type {ol.geom.RawPolygon} * @type {Array.<Array.<ol.Coordinate>>}
* @private * @private
*/ */
this.sketchRawPolygon_ = null; this.sketchPolygonCoords_ = null;
/** /**
* Squared tolerance for handling up events. If the squared distance * Squared tolerance for handling up events. If the squared distance
@@ -331,8 +331,8 @@ ol.interaction.Draw.prototype.atFinish_ = function(event) {
goog.asserts.assertInstanceof(geometry, ol.geom.Polygon); goog.asserts.assertInstanceof(geometry, ol.geom.Polygon);
potentiallyDone = geometry.getCoordinates()[0].length > potentiallyDone = geometry.getCoordinates()[0].length >
this.minPointsPerRing_; this.minPointsPerRing_;
potentiallyFinishCoordinates = [this.sketchRawPolygon_[0][0], potentiallyFinishCoordinates = [this.sketchPolygonCoords_[0][0],
this.sketchRawPolygon_[0][this.sketchRawPolygon_[0].length - 2]]; this.sketchPolygonCoords_[0][this.sketchPolygonCoords_[0].length - 2]];
} }
if (potentiallyDone) { if (potentiallyDone) {
var map = event.map; var map = event.map;
@@ -388,8 +388,8 @@ ol.interaction.Draw.prototype.startDrawing_ = function(event) {
} else if (this.mode_ === ol.interaction.DrawMode.POLYGON) { } else if (this.mode_ === ol.interaction.DrawMode.POLYGON) {
this.sketchLine_ = new ol.Feature(new ol.geom.LineString([start.slice(), this.sketchLine_ = new ol.Feature(new ol.geom.LineString([start.slice(),
start.slice()])); start.slice()]));
this.sketchRawPolygon_ = [[start.slice(), start.slice()]]; this.sketchPolygonCoords_ = [[start.slice(), start.slice()]];
geometry = new ol.geom.Polygon(this.sketchRawPolygon_); geometry = new ol.geom.Polygon(this.sketchPolygonCoords_);
} }
} }
goog.asserts.assert(goog.isDef(geometry)); goog.asserts.assert(goog.isDef(geometry));
@@ -425,7 +425,7 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
coordinates = geometry.getCoordinates(); coordinates = geometry.getCoordinates();
} else if (this.mode_ === ol.interaction.DrawMode.POLYGON) { } else if (this.mode_ === ol.interaction.DrawMode.POLYGON) {
goog.asserts.assertInstanceof(geometry, ol.geom.Polygon); goog.asserts.assertInstanceof(geometry, ol.geom.Polygon);
coordinates = this.sketchRawPolygon_[0]; coordinates = this.sketchPolygonCoords_[0];
} }
if (this.atFinish_(event)) { if (this.atFinish_(event)) {
// snap to finish // snap to finish
@@ -445,7 +445,7 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
goog.asserts.assertInstanceof(sketchLineGeom, ol.geom.LineString); goog.asserts.assertInstanceof(sketchLineGeom, ol.geom.LineString);
sketchLineGeom.setCoordinates(coordinates); sketchLineGeom.setCoordinates(coordinates);
goog.asserts.assertInstanceof(geometry, ol.geom.Polygon); goog.asserts.assertInstanceof(geometry, ol.geom.Polygon);
geometry.setCoordinates(this.sketchRawPolygon_); geometry.setCoordinates(this.sketchPolygonCoords_);
} }
} }
this.updateSketchFeatures_(); this.updateSketchFeatures_();
@@ -468,9 +468,9 @@ ol.interaction.Draw.prototype.addToDrawing_ = function(event) {
coordinates.push(coordinate.slice()); coordinates.push(coordinate.slice());
geometry.setCoordinates(coordinates); geometry.setCoordinates(coordinates);
} else if (this.mode_ === ol.interaction.DrawMode.POLYGON) { } else if (this.mode_ === ol.interaction.DrawMode.POLYGON) {
this.sketchRawPolygon_[0].push(coordinate.slice()); this.sketchPolygonCoords_[0].push(coordinate.slice());
goog.asserts.assertInstanceof(geometry, ol.geom.Polygon); goog.asserts.assertInstanceof(geometry, ol.geom.Polygon);
geometry.setCoordinates(this.sketchRawPolygon_); geometry.setCoordinates(this.sketchPolygonCoords_);
} }
this.updateSketchFeatures_(); this.updateSketchFeatures_();
}; };
@@ -500,9 +500,9 @@ ol.interaction.Draw.prototype.finishDrawing_ = function(event) {
// When we finish drawing a polygon on the last point, // When we finish drawing a polygon on the last point,
// the last coordinate is duplicated as for LineString // the last coordinate is duplicated as for LineString
// we force the replacement by the first point // we force the replacement by the first point
this.sketchRawPolygon_[0].pop(); this.sketchPolygonCoords_[0].pop();
this.sketchRawPolygon_[0].push(this.sketchRawPolygon_[0][0]); this.sketchPolygonCoords_[0].push(this.sketchPolygonCoords_[0][0]);
geometry.setCoordinates(this.sketchRawPolygon_); geometry.setCoordinates(this.sketchPolygonCoords_);
coordinates = geometry.getCoordinates(); coordinates = geometry.getCoordinates();
} }