Rename _ol_geom_Polygon_ to Polygon
This commit is contained in:
@@ -4,7 +4,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
@@ -140,7 +140,7 @@ var lineFeature = new _ol_Feature_(
|
||||
new LineString([[-1e7, 1e6], [-1e6, 3e6]]));
|
||||
|
||||
var polygonFeature = new _ol_Feature_(
|
||||
new _ol_geom_Polygon_([[[-3e6, -1e6], [-3e6, 1e6],
|
||||
new Polygon([[[-3e6, -1e6], [-3e6, 1e6],
|
||||
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ol_Map_ from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||
@@ -43,7 +43,7 @@ function addInteraction() {
|
||||
value = 'Circle';
|
||||
geometryFunction = function(coordinates, geometry) {
|
||||
if (!geometry) {
|
||||
geometry = new _ol_geom_Polygon_(null);
|
||||
geometry = new Polygon(null);
|
||||
}
|
||||
var center = coordinates[0];
|
||||
var last = coordinates[1];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import _ol_Map_ from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import _ol_format_KML_ from '../src/ol/format/KML.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||
import _ol_render_ from '../src/ol/render.js';
|
||||
@@ -39,7 +39,7 @@ var styleFunction = function(feature) {
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
}));
|
||||
vectorContext.drawGeometry(new _ol_geom_Polygon_([symbol.map(scaleFunction)]));
|
||||
vectorContext.drawGeometry(new Polygon([symbol.map(scaleFunction)]));
|
||||
style = new _ol_style_Style_({
|
||||
image: new _ol_style_Icon_({
|
||||
img: canvas,
|
||||
|
||||
@@ -4,7 +4,7 @@ import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||
import _ol_Sphere_ from '../src/ol/Sphere.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||
@@ -104,7 +104,7 @@ var pointerMoveHandler = function(evt) {
|
||||
|
||||
if (sketch) {
|
||||
var geom = (sketch.getGeometry());
|
||||
if (geom instanceof _ol_geom_Polygon_) {
|
||||
if (geom instanceof Polygon) {
|
||||
helpMsg = continuePolygonMsg;
|
||||
} else if (geom instanceof LineString) {
|
||||
helpMsg = continueLineMsg;
|
||||
@@ -217,7 +217,7 @@ function addInteraction() {
|
||||
listener = sketch.getGeometry().on('change', function(evt) {
|
||||
var geom = evt.target;
|
||||
var output;
|
||||
if (geom instanceof _ol_geom_Polygon_) {
|
||||
if (geom instanceof Polygon) {
|
||||
output = formatArea(geom);
|
||||
tooltipCoord = geom.getInteriorPoint().getCoordinates();
|
||||
} else if (geom instanceof LineString) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_render_ from '../src/ol/render.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
@@ -25,5 +25,5 @@ var style = new _ol_style_Style_({
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
vectorContext.drawGeometry(new LineString([[10, 10], [90, 90]]));
|
||||
vectorContext.drawGeometry(new _ol_geom_Polygon_([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
||||
vectorContext.drawGeometry(new Polygon([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
||||
vectorContext.drawGeometry(new Point([88, 88]));
|
||||
|
||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../src/ol/Feature.js';
|
||||
import _ol_Map_ from '../src/ol/Map.js';
|
||||
import _ol_Sphere_ from '../src/ol/Sphere.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||
import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
|
||||
@@ -63,7 +63,7 @@ var radius = 800000;
|
||||
var x, y;
|
||||
for (x = -180; x < 180; x += 30) {
|
||||
for (y = -90; y < 90; y += 30) {
|
||||
var circle4326 = _ol_geom_Polygon_.circular(wgs84Sphere, [x, y], radius, 64);
|
||||
var circle4326 = Polygon.circular(wgs84Sphere, [x, y], radius, 64);
|
||||
var circle3857 = circle4326.clone().transform('EPSG:4326', 'EPSG:3857');
|
||||
vectorLayer4326.getSource().addFeature(new _ol_Feature_(circle4326));
|
||||
vectorLayer3857.getSource().addFeature(new _ol_Feature_(circle3857));
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ol_Map_ from '../src/ol/Map.js';
|
||||
import _ol_View_ from '../src/ol/View.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
|
||||
import Polygon from '../src/ol/geom/Polygon.js';
|
||||
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
|
||||
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
|
||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||
@@ -149,7 +149,7 @@ function edgeToFeature(edge) {
|
||||
function faceToFeature(face) {
|
||||
var coordinates = topo.getFaceGeometry(face);
|
||||
var feature = new _ol_Feature_({
|
||||
geometry: new _ol_geom_Polygon_(coordinates),
|
||||
geometry: new Polygon(coordinates),
|
||||
face: face
|
||||
});
|
||||
feature.setId(face.id);
|
||||
|
||||
Reference in New Issue
Block a user