Rename _ol_geom_Polygon_ to Polygon
This commit is contained in:
@@ -18,7 +18,7 @@ import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import _ol_interaction_Property_ from '../interaction/Property.js';
|
||||
@@ -156,7 +156,7 @@ var _ol_interaction_Draw_ = function(options) {
|
||||
} else if (mode === _ol_interaction_Draw_.Mode_.LINE_STRING) {
|
||||
Constructor = LineString;
|
||||
} else if (mode === _ol_interaction_Draw_.Mode_.POLYGON) {
|
||||
Constructor = _ol_geom_Polygon_;
|
||||
Constructor = Polygon;
|
||||
}
|
||||
/**
|
||||
* @param {!Array.<ol.Coordinate>} coordinates
|
||||
@@ -555,7 +555,7 @@ _ol_interaction_Draw_.prototype.modifyDrawing_ = function(event) {
|
||||
sketchPointGeom.setCoordinates(coordinate);
|
||||
}
|
||||
var sketchLineGeom;
|
||||
if (geometry instanceof _ol_geom_Polygon_ &&
|
||||
if (geometry instanceof Polygon &&
|
||||
this.mode_ !== _ol_interaction_Draw_.Mode_.POLYGON) {
|
||||
if (!this.sketchLine_) {
|
||||
this.sketchLine_ = new _ol_Feature_(new LineString(null));
|
||||
@@ -798,10 +798,10 @@ _ol_interaction_Draw_.createRegularPolygon = function(opt_sides, opt_angle) {
|
||||
var radius = Math.sqrt(
|
||||
_ol_coordinate_.squaredDistance(center, end));
|
||||
var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) :
|
||||
_ol_geom_Polygon_.fromCircle(new _ol_geom_Circle_(center), opt_sides);
|
||||
Polygon.fromCircle(new _ol_geom_Circle_(center), opt_sides);
|
||||
var angle = opt_angle ? opt_angle :
|
||||
Math.atan((end[1] - center[1]) / (end[0] - center[0]));
|
||||
_ol_geom_Polygon_.makeRegular(geometry, center, radius, angle);
|
||||
Polygon.makeRegular(geometry, center, radius, angle);
|
||||
return geometry;
|
||||
}
|
||||
);
|
||||
@@ -824,7 +824,7 @@ _ol_interaction_Draw_.createBox = function() {
|
||||
*/
|
||||
function(coordinates, opt_geometry) {
|
||||
var extent = boundingExtent(coordinates);
|
||||
var geometry = opt_geometry || new _ol_geom_Polygon_(null);
|
||||
var geometry = opt_geometry || new Polygon(null);
|
||||
geometry.setCoordinates([[
|
||||
getBottomLeft(extent),
|
||||
getBottomRight(extent),
|
||||
|
||||
@@ -10,7 +10,7 @@ import _ol_events_Event_ from '../events/Event.js';
|
||||
import {boundingExtent, getArea} from '../extent.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import _ol_layer_Vector_ from '../layer/Vector.js';
|
||||
@@ -376,7 +376,7 @@ _ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent
|
||||
if (!extent) {
|
||||
extentFeature = new _ol_Feature_({});
|
||||
} else {
|
||||
extentFeature = new _ol_Feature_(_ol_geom_Polygon_.fromExtent(extent));
|
||||
extentFeature = new _ol_Feature_(Polygon.fromExtent(extent));
|
||||
}
|
||||
this.extentFeature_ = extentFeature;
|
||||
this.extentOverlay_.getSource().addFeature(extentFeature);
|
||||
@@ -384,7 +384,7 @@ _ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent
|
||||
if (!extent) {
|
||||
extentFeature.setGeometry(undefined);
|
||||
} else {
|
||||
extentFeature.setGeometry(_ol_geom_Polygon_.fromExtent(extent));
|
||||
extentFeature.setGeometry(Polygon.fromExtent(extent));
|
||||
}
|
||||
}
|
||||
return extentFeature;
|
||||
|
||||
@@ -10,7 +10,7 @@ import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import {boundingExtent, createEmpty} from '../extent.js';
|
||||
import _ol_functions_ from '../functions.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_Polygon_ from '../geom/Polygon.js';
|
||||
import Polygon from '../geom/Polygon.js';
|
||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import _ol_source_Vector_ from '../source/Vector.js';
|
||||
@@ -435,7 +435,7 @@ _ol_interaction_Snap_.prototype.updateFeature_ = function(feature) {
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Snap_.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
var polygon = _ol_geom_Polygon_.fromCircle(geometry);
|
||||
var polygon = Polygon.fromCircle(geometry);
|
||||
var coordinates = polygon.getCoordinates()[0];
|
||||
var i, ii, segment, segmentData;
|
||||
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user