diff --git a/examples/custom-interactions.js b/examples/custom-interactions.js index c84cc3b236..9848ce2028 100644 --- a/examples/custom-interactions.js +++ b/examples/custom-interactions.js @@ -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]]])); diff --git a/examples/draw-shapes.js b/examples/draw-shapes.js index 57d1231915..1f8c43f9c4 100644 --- a/examples/draw-shapes.js +++ b/examples/draw-shapes.js @@ -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]; diff --git a/examples/earthquake-custom-symbol.js b/examples/earthquake-custom-symbol.js index e2c3f01e06..64491102e1 100644 --- a/examples/earthquake-custom-symbol.js +++ b/examples/earthquake-custom-symbol.js @@ -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, diff --git a/examples/measure.js b/examples/measure.js index b9ae2cb2c0..529e5e0635 100644 --- a/examples/measure.js +++ b/examples/measure.js @@ -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) { diff --git a/examples/render-geometry.js b/examples/render-geometry.js index dd4793fbb5..d12cc98479 100644 --- a/examples/render-geometry.js +++ b/examples/render-geometry.js @@ -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])); diff --git a/examples/tissot.js b/examples/tissot.js index 9d8e95b5d4..0f7561483c 100644 --- a/examples/tissot.js +++ b/examples/tissot.js @@ -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)); diff --git a/examples/topolis.js b/examples/topolis.js index 41134f697a..e23f3bf1f0 100644 --- a/examples/topolis.js +++ b/examples/topolis.js @@ -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); diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index c95f13378b..2d84f0a503 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -9,7 +9,7 @@ import _ol_Object_ from './Object.js'; import _ol_Sphere_ from './Sphere.js'; import _ol_events_ from './events.js'; import _ol_events_EventType_ from './events/EventType.js'; -import _ol_geom_Polygon_ from './geom/Polygon.js'; +import Polygon from './geom/Polygon.js'; import _ol_has_ from './has.js'; import _ol_math_ from './math.js'; import {get as getProjection, getTransformFromProjections, identityTransform} from './proj.js'; @@ -161,7 +161,7 @@ _ol_Geolocation_.prototype.positionChange_ = function(position) { this.set(_ol_GeolocationProperty_.POSITION, projectedPosition); this.set(_ol_GeolocationProperty_.SPEED, coords.speed === null ? undefined : coords.speed); - var geometry = _ol_geom_Polygon_.circular( + var geometry = Polygon.circular( this.sphere_, this.position_, coords.accuracy); geometry.applyTransform(this.transform_); this.set(_ol_GeolocationProperty_.ACCURACY_GEOMETRY, geometry); diff --git a/src/ol/View.js b/src/ol/View.js index 98db0ebcb5..e6e18b2243 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -15,7 +15,7 @@ import _ol_coordinate_ from './coordinate.js'; import {inAndOut} from './easing.js'; import {getForViewAndSize, getCenter, getHeight, getWidth, isEmpty} from './extent.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_geom_SimpleGeometry_ from './geom/SimpleGeometry.js'; import _ol_math_ from './math.js'; import _ol_obj_ from './obj.js'; @@ -884,10 +884,10 @@ _ol_View_.prototype.fit = function(geometryOrExtent, opt_options) { 24); // Invalid extent or geometry provided as `geometry` _ol_asserts_.assert(!isEmpty(geometryOrExtent), 25); // Cannot fit empty extent provided as `geometry` - geometry = _ol_geom_Polygon_.fromExtent(geometryOrExtent); + geometry = Polygon.fromExtent(geometryOrExtent); } else if (geometryOrExtent.getType() === _ol_geom_GeometryType_.CIRCLE) { geometryOrExtent = geometryOrExtent.getExtent(); - geometry = _ol_geom_Polygon_.fromExtent(geometryOrExtent); + geometry = Polygon.fromExtent(geometryOrExtent); geometry.rotate(this.getRotation(), getCenter(geometryOrExtent)); } else { geometry = geometryOrExtent; diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index 728d4e4da8..0a6b7d9ec4 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -15,7 +15,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_geom_flat_deflate_ from '../geom/flat/deflate.js'; import _ol_geom_flat_orient_ from '../geom/flat/orient.js'; import _ol_obj_ from '../obj.js'; @@ -238,7 +238,7 @@ _ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) { */ _ol_format_EsriJSON_.readPolygonGeometry_ = function(object) { var layout = _ol_format_EsriJSON_.getGeometryLayout_(object); - return new _ol_geom_Polygon_(object.rings, layout); + return new Polygon(object.rings, layout); }; diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index bb79e73991..cd76f0d64f 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -12,7 +12,7 @@ import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import LineString from '../geom/LineString.js'; import MultiLineString from '../geom/MultiLineString.js'; import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../geom/Polygon.js'; +import Polygon from '../geom/Polygon.js'; import _ol_obj_ from '../obj.js'; import {get as getProjection, transformExtent} from '../proj.js'; import _ol_xml_ from '../xml.js'; @@ -244,7 +244,7 @@ _ol_format_GML3_.prototype.readSurface_ = function(node, objectStack) { var flatLinearRings = _ol_xml_.pushParseAndPop([null], this.SURFACE_PARSERS_, node, objectStack, this); if (flatLinearRings && flatLinearRings[0]) { - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); var flatCoordinates = flatLinearRings[0]; var ends = [flatCoordinates.length]; var i, ii; diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js index 66520fb372..1df321fb17 100644 --- a/src/ol/format/GMLBase.js +++ b/src/ol/format/GMLBase.js @@ -16,7 +16,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_obj_ from '../obj.js'; import {get as getProjection} from '../proj.js'; import _ol_xml_ from '../xml.js'; @@ -423,7 +423,7 @@ _ol_format_GMLBase_.prototype.readPolygon = function(node, objectStack) { var flatLinearRings = _ol_xml_.pushParseAndPop([null], this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this); if (flatLinearRings && flatLinearRings[0]) { - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); var flatCoordinates = flatLinearRings[0]; var ends = [flatCoordinates.length]; var i, ii; diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index a2604444af..f4c04f6d46 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -15,7 +15,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_obj_ from '../obj.js'; import {get as getProjection} from '../proj.js'; @@ -159,7 +159,7 @@ _ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) { * @return {ol.geom.Polygon} Polygon. */ _ol_format_GeoJSON_.readPolygonGeometry_ = function(object) { - return new _ol_geom_Polygon_(object.coordinates); + return new Polygon(object.coordinates); }; diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 59b407ec8c..ad88293707 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -22,7 +22,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_math_ from '../math.js'; import {get as getProjection} from '../proj.js'; import _ol_style_Fill_ from '../style/Fill.js'; @@ -887,7 +887,7 @@ _ol_format_KML_.readLinearRing_ = function(node, objectStack) { var flatCoordinates = _ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack); if (flatCoordinates) { - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); polygon.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates, [flatCoordinates.length]); polygon.setProperties(properties); @@ -995,7 +995,7 @@ _ol_format_KML_.readPolygon_ = function(node, objectStack) { var flatLinearRings = _ol_xml_.pushParseAndPop([null], _ol_format_KML_.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack); if (flatLinearRings && flatLinearRings[0]) { - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); var flatCoordinates = flatLinearRings[0]; var ends = [flatCoordinates.length]; var i, ii; diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index 2fa1eb05b0..d48238e2e2 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -15,7 +15,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_geom_flat_orient_ from '../geom/flat/orient.js'; import _ol_proj_Projection_ from '../proj/Projection.js'; import _ol_proj_Units_ from '../proj/Units.js'; @@ -307,12 +307,12 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options ends = endss; geom = new _ol_geom_MultiPolygon_(null); } else { - geom = new _ol_geom_Polygon_(null); + geom = new Polygon(null); } } else { geom = geometryType === _ol_geom_GeometryType_.POINT ? new Point(null) : geometryType === _ol_geom_GeometryType_.LINE_STRING ? new LineString(null) : - geometryType === _ol_geom_GeometryType_.POLYGON ? new _ol_geom_Polygon_(null) : + geometryType === _ol_geom_GeometryType_.POLYGON ? new Polygon(null) : geometryType === _ol_geom_GeometryType_.MULTI_POINT ? new MultiPoint (null) : geometryType === _ol_geom_GeometryType_.MULTI_LINE_STRING ? new MultiLineString(null) : null; diff --git a/src/ol/format/OSMXML.js b/src/ol/format/OSMXML.js index 956b946981..cfeffc5dec 100644 --- a/src/ol/format/OSMXML.js +++ b/src/ol/format/OSMXML.js @@ -10,7 +10,7 @@ import _ol_format_XMLFeature_ from '../format/XMLFeature.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import LineString from '../geom/LineString.js'; import Point from '../geom/Point.js'; -import _ol_geom_Polygon_ from '../geom/Polygon.js'; +import Polygon from '../geom/Polygon.js'; import _ol_obj_ from '../obj.js'; import {get as getProjection} from '../proj.js'; import _ol_xml_ from '../xml.js'; @@ -185,7 +185,7 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options) var geometry; if (values.ndrefs[0] == values.ndrefs[values.ndrefs.length - 1]) { // closed way - geometry = new _ol_geom_Polygon_(null); + geometry = new Polygon(null); geometry.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, flatCoordinates, [flatCoordinates.length]); } else { diff --git a/src/ol/format/TopoJSON.js b/src/ol/format/TopoJSON.js index 61d554db61..ded8075c57 100644 --- a/src/ol/format/TopoJSON.js +++ b/src/ol/format/TopoJSON.js @@ -10,7 +10,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 {get as getProjection} from '../proj.js'; /** @@ -176,7 +176,7 @@ _ol_format_TopoJSON_.readPolygonGeometry_ = function(object, arcs) { for (i = 0, ii = object.arcs.length; i < ii; ++i) { coordinates[i] = _ol_format_TopoJSON_.concatenateArcs_(object.arcs[i], arcs); } - return new _ol_geom_Polygon_(coordinates); + return new Polygon(coordinates); }; diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index 6a9eba090c..3dcbe9a641 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -13,7 +13,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_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js'; /** @@ -920,7 +920,7 @@ _ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() { _ol_format_WKT_.Parser.GeometryConstructor_ = { 'POINT': Point, 'LINESTRING': LineString, - 'POLYGON': _ol_geom_Polygon_, + 'POLYGON': Polygon, 'MULTIPOINT': MultiPoint, 'MULTILINESTRING': MultiLineString, 'MULTIPOLYGON': _ol_geom_MultiPolygon_ diff --git a/src/ol/geom/MultiPolygon.js b/src/ol/geom/MultiPolygon.js index b248d7bc36..034e6fc713 100644 --- a/src/ol/geom/MultiPolygon.js +++ b/src/ol/geom/MultiPolygon.js @@ -7,7 +7,7 @@ import {closestSquaredDistanceXY} from '../extent.js'; import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; import MultiPoint from '../geom/MultiPoint.js'; -import _ol_geom_Polygon_ from '../geom/Polygon.js'; +import Polygon from '../geom/Polygon.js'; import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js'; import _ol_geom_flat_area_ from '../geom/flat/area.js'; import _ol_geom_flat_center_ from '../geom/flat/center.js'; @@ -298,7 +298,7 @@ _ol_geom_MultiPolygon_.prototype.getPolygon = function(index) { ends[i] -= offset; } } - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); polygon.setFlatCoordinates( this.layout, this.flatCoordinates.slice(offset, end), ends); return polygon; @@ -325,7 +325,7 @@ _ol_geom_MultiPolygon_.prototype.getPolygons = function() { ends[j] -= offset; } } - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); polygon.setFlatCoordinates( layout, flatCoordinates.slice(offset, end), ends); polygons.push(polygon); diff --git a/src/ol/geom/Polygon.js b/src/ol/geom/Polygon.js index 72a3713971..71ee9baef8 100644 --- a/src/ol/geom/Polygon.js +++ b/src/ol/geom/Polygon.js @@ -35,7 +35,7 @@ import _ol_math_ from '../math.js'; * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api */ -var _ol_geom_Polygon_ = function(coordinates, opt_layout) { +var Polygon = function(coordinates, opt_layout) { _ol_geom_SimpleGeometry_.call(this); @@ -85,7 +85,7 @@ var _ol_geom_Polygon_ = function(coordinates, opt_layout) { }; -inherits(_ol_geom_Polygon_, _ol_geom_SimpleGeometry_); +inherits(Polygon, _ol_geom_SimpleGeometry_); /** @@ -93,7 +93,7 @@ inherits(_ol_geom_Polygon_, _ol_geom_SimpleGeometry_); * @param {ol.geom.LinearRing} linearRing Linear ring. * @api */ -_ol_geom_Polygon_.prototype.appendLinearRing = function(linearRing) { +Polygon.prototype.appendLinearRing = function(linearRing) { if (!this.flatCoordinates) { this.flatCoordinates = linearRing.getFlatCoordinates().slice(); } else { @@ -110,8 +110,8 @@ _ol_geom_Polygon_.prototype.appendLinearRing = function(linearRing) { * @override * @api */ -_ol_geom_Polygon_.prototype.clone = function() { - var polygon = new _ol_geom_Polygon_(null); +Polygon.prototype.clone = function() { + var polygon = new Polygon(null); polygon.setFlatCoordinates( this.layout, this.flatCoordinates.slice(), this.ends_.slice()); return polygon; @@ -121,7 +121,7 @@ _ol_geom_Polygon_.prototype.clone = function() { /** * @inheritDoc */ -_ol_geom_Polygon_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { +Polygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) { return minSquaredDistance; } @@ -139,7 +139,7 @@ _ol_geom_Polygon_.prototype.closestPointXY = function(x, y, closestPoint, minSqu /** * @inheritDoc */ -_ol_geom_Polygon_.prototype.containsXY = function(x, y) { +Polygon.prototype.containsXY = function(x, y) { return _ol_geom_flat_contains_.linearRingsContainsXY( this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y); }; @@ -150,7 +150,7 @@ _ol_geom_Polygon_.prototype.containsXY = function(x, y) { * @return {number} Area (on projected plane). * @api */ -_ol_geom_Polygon_.prototype.getArea = function() { +Polygon.prototype.getArea = function() { return _ol_geom_flat_area_.linearRings( this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride); }; @@ -170,7 +170,7 @@ _ol_geom_Polygon_.prototype.getArea = function() { * @override * @api */ -_ol_geom_Polygon_.prototype.getCoordinates = function(opt_right) { +Polygon.prototype.getCoordinates = function(opt_right) { var flatCoordinates; if (opt_right !== undefined) { flatCoordinates = this.getOrientedFlatCoordinates().slice(); @@ -188,7 +188,7 @@ _ol_geom_Polygon_.prototype.getCoordinates = function(opt_right) { /** * @return {Array.} Ends. */ -_ol_geom_Polygon_.prototype.getEnds = function() { +Polygon.prototype.getEnds = function() { return this.ends_; }; @@ -196,7 +196,7 @@ _ol_geom_Polygon_.prototype.getEnds = function() { /** * @return {Array.} Interior point. */ -_ol_geom_Polygon_.prototype.getFlatInteriorPoint = function() { +Polygon.prototype.getFlatInteriorPoint = function() { if (this.flatInteriorPointRevision_ != this.getRevision()) { var flatCenter = getCenter(this.getExtent()); this.flatInteriorPoint_ = _ol_geom_flat_interiorpoint_.linearRings( @@ -214,7 +214,7 @@ _ol_geom_Polygon_.prototype.getFlatInteriorPoint = function() { * length of the horizontal intersection that the point belongs to. * @api */ -_ol_geom_Polygon_.prototype.getInteriorPoint = function() { +Polygon.prototype.getInteriorPoint = function() { return new Point(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM); }; @@ -226,7 +226,7 @@ _ol_geom_Polygon_.prototype.getInteriorPoint = function() { * @return {number} Number of rings. * @api */ -_ol_geom_Polygon_.prototype.getLinearRingCount = function() { +Polygon.prototype.getLinearRingCount = function() { return this.ends_.length; }; @@ -241,7 +241,7 @@ _ol_geom_Polygon_.prototype.getLinearRingCount = function() { * @return {ol.geom.LinearRing} Linear ring. * @api */ -_ol_geom_Polygon_.prototype.getLinearRing = function(index) { +Polygon.prototype.getLinearRing = function(index) { if (index < 0 || this.ends_.length <= index) { return null; } @@ -257,7 +257,7 @@ _ol_geom_Polygon_.prototype.getLinearRing = function(index) { * @return {Array.} Linear rings. * @api */ -_ol_geom_Polygon_.prototype.getLinearRings = function() { +Polygon.prototype.getLinearRings = function() { var layout = this.layout; var flatCoordinates = this.flatCoordinates; var ends = this.ends_; @@ -278,7 +278,7 @@ _ol_geom_Polygon_.prototype.getLinearRings = function() { /** * @return {Array.} Oriented flat coordinates. */ -_ol_geom_Polygon_.prototype.getOrientedFlatCoordinates = function() { +Polygon.prototype.getOrientedFlatCoordinates = function() { if (this.orientedRevision_ != this.getRevision()) { var flatCoordinates = this.flatCoordinates; if (_ol_geom_flat_orient_.linearRingsAreOriented( @@ -299,14 +299,14 @@ _ol_geom_Polygon_.prototype.getOrientedFlatCoordinates = function() { /** * @inheritDoc */ -_ol_geom_Polygon_.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { +Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) { var simplifiedFlatCoordinates = []; var simplifiedEnds = []; simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.quantizes( this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds); - var simplifiedPolygon = new _ol_geom_Polygon_(null); + var simplifiedPolygon = new Polygon(null); simplifiedPolygon.setFlatCoordinates( _ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEnds); return simplifiedPolygon; @@ -317,7 +317,7 @@ _ol_geom_Polygon_.prototype.getSimplifiedGeometryInternal = function(squaredTole * @inheritDoc * @api */ -_ol_geom_Polygon_.prototype.getType = function() { +Polygon.prototype.getType = function() { return _ol_geom_GeometryType_.POLYGON; }; @@ -326,7 +326,7 @@ _ol_geom_Polygon_.prototype.getType = function() { * @inheritDoc * @api */ -_ol_geom_Polygon_.prototype.intersectsExtent = function(extent) { +Polygon.prototype.intersectsExtent = function(extent) { return _ol_geom_flat_intersectsextent_.linearRings( this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent); }; @@ -339,7 +339,7 @@ _ol_geom_Polygon_.prototype.intersectsExtent = function(extent) { * @override * @api */ -_ol_geom_Polygon_.prototype.setCoordinates = function(coordinates, opt_layout) { +Polygon.prototype.setCoordinates = function(coordinates, opt_layout) { if (!coordinates) { this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.ends_); } else { @@ -360,7 +360,7 @@ _ol_geom_Polygon_.prototype.setCoordinates = function(coordinates, opt_layout) { * @param {Array.} flatCoordinates Flat coordinates. * @param {Array.} ends Ends. */ -_ol_geom_Polygon_.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { +Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, ends) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.ends_ = ends; this.changed(); @@ -378,7 +378,7 @@ _ol_geom_Polygon_.prototype.setFlatCoordinates = function(layout, flatCoordinate * @return {ol.geom.Polygon} The "circular" polygon. * @api */ -_ol_geom_Polygon_.circular = function(sphere, center, radius, opt_n) { +Polygon.circular = function(sphere, center, radius, opt_n) { var n = opt_n ? opt_n : 32; /** @type {Array.} */ var flatCoordinates = []; @@ -388,7 +388,7 @@ _ol_geom_Polygon_.circular = function(sphere, center, radius, opt_n) { flatCoordinates, sphere.offset(center, radius, 2 * Math.PI * i / n)); } flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]); - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); polygon.setFlatCoordinates( _ol_geom_GeometryLayout_.XY, flatCoordinates, [flatCoordinates.length]); return polygon; @@ -401,14 +401,14 @@ _ol_geom_Polygon_.circular = function(sphere, center, radius, opt_n) { * @return {ol.geom.Polygon} The polygon. * @api */ -_ol_geom_Polygon_.fromExtent = function(extent) { +Polygon.fromExtent = function(extent) { var minX = extent[0]; var minY = extent[1]; var maxX = extent[2]; var maxY = extent[3]; var flatCoordinates = [minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY]; - var polygon = new _ol_geom_Polygon_(null); + var polygon = new Polygon(null); polygon.setFlatCoordinates( _ol_geom_GeometryLayout_.XY, flatCoordinates, [flatCoordinates.length]); return polygon; @@ -424,11 +424,11 @@ _ol_geom_Polygon_.fromExtent = function(extent) { * @return {ol.geom.Polygon} Polygon geometry. * @api */ -_ol_geom_Polygon_.fromCircle = function(circle, opt_sides, opt_angle) { +Polygon.fromCircle = function(circle, opt_sides, opt_angle) { var sides = opt_sides ? opt_sides : 32; var stride = circle.getStride(); var layout = circle.getLayout(); - var polygon = new _ol_geom_Polygon_(null, layout); + var polygon = new Polygon(null, layout); var arrayLength = stride * (sides + 1); var flatCoordinates = new Array(arrayLength); for (var i = 0; i < arrayLength; i++) { @@ -436,7 +436,7 @@ _ol_geom_Polygon_.fromCircle = function(circle, opt_sides, opt_angle) { } var ends = [flatCoordinates.length]; polygon.setFlatCoordinates(layout, flatCoordinates, ends); - _ol_geom_Polygon_.makeRegular( + Polygon.makeRegular( polygon, circle.getCenter(), circle.getRadius(), opt_angle); return polygon; }; @@ -450,7 +450,7 @@ _ol_geom_Polygon_.fromCircle = function(circle, opt_sides, opt_angle) { * @param {number=} opt_angle Start angle for the first vertex of the polygon in * radians. Default is 0. */ -_ol_geom_Polygon_.makeRegular = function(polygon, center, radius, opt_angle) { +Polygon.makeRegular = function(polygon, center, radius, opt_angle) { var flatCoordinates = polygon.getFlatCoordinates(); var layout = polygon.getLayout(); var stride = polygon.getStride(); @@ -466,4 +466,4 @@ _ol_geom_Polygon_.makeRegular = function(polygon, center, radius, opt_angle) { } polygon.setFlatCoordinates(layout, flatCoordinates, ends); }; -export default _ol_geom_Polygon_; +export default Polygon; diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index 6190129485..d205a0927f 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -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.} 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), diff --git a/src/ol/interaction/Extent.js b/src/ol/interaction/Extent.js index 9b174a802e..f9d65aff01 100644 --- a/src/ol/interaction/Extent.js +++ b/src/ol/interaction/Extent.js @@ -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; diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index cb9ec4dbbb..1f9be29ae3 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -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) { diff --git a/src/ol/render/Box.js b/src/ol/render/Box.js index 1fefc970a2..fb6b392cf2 100644 --- a/src/ol/render/Box.js +++ b/src/ol/render/Box.js @@ -5,7 +5,7 @@ import {inherits} from '../index.js'; import _ol_Disposable_ from '../Disposable.js'; -import _ol_geom_Polygon_ from '../geom/Polygon.js'; +import Polygon from '../geom/Polygon.js'; /** * @constructor @@ -118,7 +118,7 @@ _ol_render_Box_.prototype.createOrUpdateGeometry = function() { // close the polygon coordinates[4] = coordinates[0].slice(); if (!this.geometry_) { - this.geometry_ = new _ol_geom_Polygon_([coordinates]); + this.geometry_ = new Polygon([coordinates]); } else { this.geometry_.setCoordinates([coordinates]); } diff --git a/test/rendering/ol/layer/vector.test.js b/test/rendering/ol/layer/vector.test.js index f5ad573969..bb05e98d98 100644 --- a/test/rendering/ol/layer/vector.test.js +++ b/test/rendering/ol/layer/vector.test.js @@ -5,7 +5,7 @@ import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js'; import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.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_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; @@ -46,7 +46,7 @@ describe('ol.rendering.layer.Vector', function() { } function addPolygon(r) { - source.addFeature(new _ol_Feature_(new _ol_geom_Polygon_([ + source.addFeature(new _ol_Feature_(new Polygon([ [ [center[0] - r, center[1] - r], [center[0] + r, center[1] - r], @@ -494,14 +494,14 @@ describe('ol.rendering.layer.Vector', function() { beforeEach(function() { var src = new _ol_source_Vector_({ features: [ - new _ol_Feature_(new _ol_geom_Polygon_([[ + new _ol_Feature_(new Polygon([[ [-22, 58], [-22, 78], [-9, 78], [-9, 58], [-22, 58] ]])), - new _ol_Feature_(new _ol_geom_Polygon_([[ + new _ol_Feature_(new Polygon([[ [-9, 58], [-9, 78], [4, 78], diff --git a/test/rendering/ol/render.test.js b/test/rendering/ol/render.test.js index 1b193311a7..b8d84ca5f8 100644 --- a/test/rendering/ol/render.test.js +++ b/test/rendering/ol/render.test.js @@ -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_render_VectorContext_ from '../../../src/ol/render/VectorContext.js'; import _ol_render_canvas_Immediate_ from '../../../src/ol/render/canvas/Immediate.js'; @@ -143,7 +143,7 @@ describe('ol.render', function() { vectorContext.setStyle(style); - vectorContext.drawGeometry(new _ol_geom_Polygon_([ + vectorContext.drawGeometry(new Polygon([ [[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]], [[40, 40], [40, 60], [60, 60], [60, 40], [40, 40]] ])); @@ -168,7 +168,7 @@ describe('ol.render', function() { vectorContext.setStyle(style); - vectorContext.drawGeometry(new _ol_geom_Polygon_([ + vectorContext.drawGeometry(new Polygon([ [[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]], [[40, 40], [40, 60], [60, 60], [60, 40], [40, 40]] ])); @@ -194,7 +194,7 @@ describe('ol.render', function() { vectorContext.setStyle(style); - vectorContext.drawGeometry(new _ol_geom_Polygon_([ + vectorContext.drawGeometry(new Polygon([ [[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]], [[40, 40], [40, 60], [60, 60], [60, 40], [40, 40]] ])); diff --git a/test/rendering/ol/style/polygon.test.js b/test/rendering/ol/style/polygon.test.js index 1614ac1a8f..4dc767f2e2 100644 --- a/test/rendering/ol/style/polygon.test.js +++ b/test/rendering/ol/style/polygon.test.js @@ -1,5 +1,5 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_View_ from '../../../../src/ol/View.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; @@ -49,7 +49,7 @@ describe('ol.rendering.style.Polygon', function() { var feature; // rectangle feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] ]) }); @@ -60,7 +60,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 1 hole feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]], [[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]] @@ -73,7 +73,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 2 holes feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]], [[-18, -18], [-12, -18], [-12, -12], [-18, -12], [-18, -18]], [[5, -18], [12, -18], [12, -12], [5, -12], [5, -18]] @@ -114,7 +114,7 @@ describe('ol.rendering.style.Polygon', function() { var feature; // rectangle feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] ]) }); @@ -125,7 +125,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 1 hole feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[0, 10], [0, 20], [20, 20], [20, 10], [0, 10]], [[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]] @@ -138,7 +138,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 2 holes feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, -20], [-20, 5], [20, 5], [20, -20], [-20, -20]], [[-12, -3], [-12, -12], [-8, -12], [-8, -3], [-12, -3]], [[0, -12], [13, -12], [13, -3], [0, -3], [0, -12]] @@ -174,7 +174,7 @@ describe('ol.rendering.style.Polygon', function() { var feature; // rectangle with z-index 2 feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]] ]) }); @@ -186,7 +186,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with z-index 3 feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]] ]) }); @@ -198,7 +198,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with z-index 1 feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]] ]) }); @@ -231,7 +231,7 @@ describe('ol.rendering.style.Polygon', function() { var feature; // rectangle feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] ]) }); @@ -243,7 +243,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 1 hole feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]] ]) }); @@ -255,7 +255,7 @@ describe('ol.rendering.style.Polygon', function() { // rectangle with 2 holes feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]] ]) }); @@ -317,7 +317,7 @@ describe('ol.rendering.style.Polygon', function() { function createFeatures() { var feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[-20, -20], [-20, 20], [18, 20], [-20, -20]] ]) }); diff --git a/test/rendering/ol/style/text.test.js b/test/rendering/ol/style/text.test.js index c1eb6af0d1..4c8ef79623 100644 --- a/test/rendering/ol/style/text.test.js +++ b/test/rendering/ol/style/text.test.js @@ -3,7 +3,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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_Map_ from '../../../../src/ol/Map.js'; import _ol_View_ from '../../../../src/ol/View.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; @@ -287,7 +287,7 @@ describe('ol.rendering.style.Text', function() { it('renders text along a Polygon', function(done) { createMap('canvas'); - var geom = new _ol_geom_Polygon_(null); + var geom = new Polygon(null); geom.setFlatCoordinates('XY', polygon, [polygon.length]); var feature = new _ol_Feature_(geom); feature.setStyle(new _ol_style_Style_({ @@ -305,7 +305,7 @@ describe('ol.rendering.style.Text', function() { it('renders text along a MultiPolygon', function(done) { createMap('canvas'); - var geom = new _ol_geom_Polygon_(null); + var geom = new Polygon(null); geom.setFlatCoordinates('XY', polygon, [polygon.length]); var multiPolygon = new _ol_geom_MultiPolygon_(null); multiPolygon.appendPolygon(geom); diff --git a/test/spec/ol/format/esrijson.test.js b/test/spec/ol/format/esrijson.test.js index 7208e1f4b1..e187f7e7db 100644 --- a/test/spec/ol/format/esrijson.test.js +++ b/test/spec/ol/format/esrijson.test.js @@ -7,7 +7,7 @@ import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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 {get as getProjection, transform} from '../../../../src/ol/proj.js'; @@ -205,7 +205,7 @@ describe('ol.format.EsriJSON', function() { var feature = format.readFeature(polygonEsriJSON); expect(feature).to.be.an(_ol_Feature_); var geometry = feature.getGeometry(); - expect(geometry).to.be.an(_ol_geom_Polygon_); + expect(geometry).to.be.an(Polygon); expect(geometry.getCoordinates()).to.eql([[ [100.0, 0.0], [100.0, 1.0], [101.0, 1.0], [101.0, 0.0] ]]); @@ -229,7 +229,7 @@ describe('ol.format.EsriJSON', function() { expect(features).to.have.length(3); expect(features[0].getGeometry()).to.be.an(Point); expect(features[1].getGeometry()).to.be.an(LineString); - expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_); + expect(features[2].getGeometry()).to.be.an(Polygon); }); it('can read and transform a point', function() { @@ -304,7 +304,7 @@ describe('ol.format.EsriJSON', function() { expect(first.get('field_name')).to.be('EUDORA'); expect(first.getId()).to.be(6406); var firstGeom = first.getGeometry(); - expect(firstGeom).to.be.a(_ol_geom_Polygon_); + expect(firstGeom).to.be.a(Polygon); expect(_ol_extent_.equals(firstGeom.getExtent(), [ -10585772.743554419, 4712365.161160459, -10579560.16462974, 4716567.373073828 @@ -315,7 +315,7 @@ describe('ol.format.EsriJSON', function() { expect(last.get('field_name')).to.be('FEAGINS'); expect(last.getId()).to.be(6030); var lastGeom = last.getGeometry(); - expect(lastGeom).to.be.a(_ol_geom_Polygon_); + expect(lastGeom).to.be.a(Polygon); expect(_ol_extent_.equals(lastGeom.getExtent(), [ -10555714.026858449, 4576511.565880965, -10553671.199322715, 4578554.9934867555 @@ -558,7 +558,7 @@ describe('ol.format.EsriJSON', function() { rings: [outer, inner1, inner2] }); var obj = format.readGeometry(str); - expect(obj).to.be.a(_ol_geom_Polygon_); + expect(obj).to.be.a(Polygon); expect(obj.getLayout()).to.eql('XY'); var rings = obj.getLinearRings(); expect(rings.length).to.be(3); @@ -577,7 +577,7 @@ describe('ol.format.EsriJSON', function() { hasZ: true }); var obj = format.readGeometry(str); - expect(obj).to.be.a(_ol_geom_Polygon_); + expect(obj).to.be.a(Polygon); expect(obj.getLayout()).to.eql('XYZ'); var rings = obj.getLinearRings(); expect(rings.length).to.be(3); @@ -596,7 +596,7 @@ describe('ol.format.EsriJSON', function() { hasM: true }); var obj = format.readGeometry(str); - expect(obj).to.be.a(_ol_geom_Polygon_); + expect(obj).to.be.a(Polygon); expect(obj.getLayout()).to.eql('XYM'); var rings = obj.getLinearRings(); expect(rings.length).to.be(3); @@ -625,7 +625,7 @@ describe('ol.format.EsriJSON', function() { hasM: true }); var obj = format.readGeometry(str); - expect(obj).to.be.a(_ol_geom_Polygon_); + expect(obj).to.be.a(Polygon); expect(obj.getLayout()).to.eql('XYZM'); var rings = obj.getLinearRings(); expect(rings.length).to.be(3); @@ -826,7 +826,7 @@ describe('ol.format.EsriJSON', function() { var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]; var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; - var polygon = new _ol_geom_Polygon_([outer, inner1, inner2]); + var polygon = new Polygon([outer, inner1, inner2]); var esrijson = format.writeGeometry(polygon); expect(polygon.getCoordinates(false)).to.eql( format.readGeometry(esrijson).getCoordinates()); @@ -836,7 +836,7 @@ describe('ol.format.EsriJSON', function() { var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; - var polygon = new _ol_geom_Polygon_([outer, inner1, inner2], + var polygon = new Polygon([outer, inner1, inner2], 'XYZ'); var esrijson = format.writeGeometry(polygon); expect(polygon.getCoordinates(false)).to.eql( @@ -847,7 +847,7 @@ describe('ol.format.EsriJSON', function() { var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]]; var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]]; var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]]; - var polygon = new _ol_geom_Polygon_([outer, inner1, inner2], + var polygon = new Polygon([outer, inner1, inner2], 'XYM'); var esrijson = format.writeGeometry(polygon); expect(polygon.getCoordinates(false)).to.eql( @@ -864,7 +864,7 @@ describe('ol.format.EsriJSON', function() { var inner2 = [ [8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1], [8, 8, 2, 1] ]; - var polygon = new _ol_geom_Polygon_([outer, inner1, inner2], + var polygon = new Polygon([outer, inner1, inner2], 'XYZM'); var esrijson = format.writeGeometry(polygon); expect(polygon.getCoordinates(false)).to.eql( diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index faf870f24d..b0fffccb55 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -7,7 +7,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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 {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js'; @@ -175,7 +175,7 @@ describe('ol.format.GeoJSON', function() { var feature = format.readFeature(polygonGeoJSON); expect(feature).to.be.an(_ol_Feature_); var geometry = feature.getGeometry(); - expect(geometry).to.be.an(_ol_geom_Polygon_); + expect(geometry).to.be.an(Polygon); expect(geometry.getCoordinates()).to.eql([[ [100.0, 0.0], [100.0, 1.0], [101.0, 1.0], [101.0, 0.0] ]]); @@ -202,7 +202,7 @@ describe('ol.format.GeoJSON', function() { expect(features).to.have.length(3); expect(features[0].getGeometry()).to.be.an(Point); expect(features[1].getGeometry()).to.be.an(LineString); - expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_); + expect(features[2].getGeometry()).to.be.an(Polygon); }); it('can read and transform a point', function() { @@ -288,7 +288,7 @@ describe('ol.format.GeoJSON', function() { expect(features).to.be.an(Array); expect(features).to.have.length(1); var geometry = features[0].getGeometry(); - expect(geometry).to.be.an(_ol_geom_Polygon_); + expect(geometry).to.be.an(Polygon); }); it('parses countries.geojson', function(done) { @@ -301,7 +301,7 @@ describe('ol.format.GeoJSON', function() { expect(first.get('name')).to.be('Afghanistan'); expect(first.getId()).to.be('AFG'); var firstGeom = first.getGeometry(); - expect(firstGeom).to.be.a(_ol_geom_Polygon_); + expect(firstGeom).to.be.a(Polygon); expect(_ol_extent_.equals(firstGeom.getExtent(), [60.52843, 29.318572, 75.158028, 38.486282])) .to.be(true); @@ -311,7 +311,7 @@ describe('ol.format.GeoJSON', function() { expect(last.get('name')).to.be('Zimbabwe'); expect(last.getId()).to.be('ZWE'); var lastGeom = last.getGeometry(); - expect(lastGeom).to.be.a(_ol_geom_Polygon_); + expect(lastGeom).to.be.a(Polygon); expect(_ol_extent_.equals(lastGeom.getExtent(), [25.264226, -22.271612, 32.849861, -15.507787])) .to.be(true); @@ -395,7 +395,7 @@ describe('ol.format.GeoJSON', function() { }); var obj = format.readGeometry(str); - expect(obj).to.be.a(_ol_geom_Polygon_); + expect(obj).to.be.a(Polygon); expect(obj.getLayout()).to.eql('XY'); var rings = obj.getLinearRings(); expect(rings.length).to.be(3); @@ -622,7 +622,7 @@ describe('ol.format.GeoJSON', function() { var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]; var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]]; var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]]; - var polygon = new _ol_geom_Polygon_([outer, inner1, inner2]); + var polygon = new Polygon([outer, inner1, inner2]); var geojson = format.writeGeometry(polygon); expect(polygon.getCoordinates()).to.eql( format.readGeometry(geojson).getCoordinates()); @@ -633,9 +633,9 @@ describe('ol.format.GeoJSON', function() { var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]; var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]; - var right = new _ol_geom_Polygon_([ccw, cw]); + var right = new Polygon([ccw, cw]); var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]); - var left = new _ol_geom_Polygon_([cw, ccw]); + var left = new Polygon([cw, ccw]); var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]); var rightObj = { @@ -670,9 +670,9 @@ describe('ol.format.GeoJSON', function() { var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]; var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]; - var right = new _ol_geom_Polygon_([ccw, cw]); + var right = new Polygon([ccw, cw]); var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]); - var left = new _ol_geom_Polygon_([cw, ccw]); + var left = new Polygon([cw, ccw]); var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]); var rightObj = { @@ -701,9 +701,9 @@ describe('ol.format.GeoJSON', function() { var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]; var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]; - var right = new _ol_geom_Polygon_([ccw, cw]); + var right = new Polygon([ccw, cw]); var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]); - var left = new _ol_geom_Polygon_([cw, ccw]); + var left = new Polygon([cw, ccw]); var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]); var leftObj = { diff --git a/test/spec/ol/format/gml.test.js b/test/spec/ol/format/gml.test.js index 9ea90f117a..41ea0ba8f5 100644 --- a/test/spec/ol/format/gml.test.js +++ b/test/spec/ol/format/gml.test.js @@ -7,7 +7,7 @@ import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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 {transform} from '../../../../src/ol/proj.js'; import _ol_xml_ from '../../../../src/ol/xml.js'; @@ -195,7 +195,7 @@ describe('ol.format.GML2', function() { ' '; var feature = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([[[1.1, 2], [3, 4.2], [5.2, 6]]]) + geometry: new Polygon([[[1.1, 2], [3, 4.2], [5.2, 6]]]) }); feature.setId(1); var objectStack = [{ @@ -610,7 +610,7 @@ describe('ol.format.GML3', function() { ' ' + ''; var g = readGeometry(format, text); - expect(g).to.be.an(_ol_geom_Polygon_); + expect(g).to.be.an(Polygon); expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); @@ -653,7 +653,7 @@ describe('ol.format.GML3', function() { ' ' + ''; var g = readGeometry(format, text); - expect(g).to.be.an(_ol_geom_Polygon_); + expect(g).to.be.an(Polygon); expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); @@ -1528,7 +1528,7 @@ describe('ol.format.GML3', function() { it('creates a Polygon', function() { feature = features[1]; expect(feature.getId()).to.equal('geoserver_layer.2'); - expect(feature.getGeometry()).to.be.an(_ol_geom_Polygon_); + expect(feature.getGeometry()).to.be.an(Polygon); }); it('creates a Point', function() { diff --git a/test/spec/ol/format/gpx.test.js b/test/spec/ol/format/gpx.test.js index 15cb6121fe..1744914168 100644 --- a/test/spec/ol/format/gpx.test.js +++ b/test/spec/ol/format/gpx.test.js @@ -3,7 +3,7 @@ import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.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 {get as getProjection, transform} from '../../../../src/ol/proj.js'; import _ol_xml_ from '../../../../src/ol/xml.js'; @@ -661,7 +661,7 @@ describe('ol.format.GPX', function() { }); it('does not fail', function() { - var polygon = new _ol_geom_Polygon_( + var polygon = new Polygon( [[[0, 0], [2, 2], [4, 0], [0, 0]]]); var feature = new _ol_Feature_(polygon); var features = [feature]; diff --git a/test/spec/ol/format/kml.test.js b/test/spec/ol/format/kml.test.js index 82218bafc7..24067f3cd3 100644 --- a/test/spec/ol/format/kml.test.js +++ b/test/spec/ol/format/kml.test.js @@ -9,7 +9,7 @@ import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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 {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js'; import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js'; import _ol_proj_transforms_ from '../../../../src/ol/proj/transforms.js'; @@ -553,7 +553,7 @@ describe('ol.format.KML', function() { var f = fs[0]; expect(f).to.be.an(_ol_Feature_); var g = f.getGeometry(); - expect(g).to.be.an(_ol_geom_Polygon_); + expect(g).to.be.an(Polygon); expect(g.getCoordinates()).to.eql([[[1, 2, 3], [4, 5, 6], [7, 8, 9]]]); }); @@ -661,7 +661,7 @@ describe('ol.format.KML', function() { var f = fs[0]; expect(f).to.be.an(_ol_Feature_); var g = f.getGeometry(); - expect(g).to.be.an(_ol_geom_Polygon_); + expect(g).to.be.an(Polygon); expect(g.getCoordinates()).to.eql( [[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]]]); expect(g.get('extrude')).to.be(false); @@ -670,7 +670,7 @@ describe('ol.format.KML', function() { it('can write XY Polygon geometries', function() { var layout = 'XY'; - var polygon = new _ol_geom_Polygon_( + var polygon = new Polygon( [[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]]], layout); var features = [new _ol_Feature_(polygon)]; var node = format.writeFeaturesNode(features); @@ -695,7 +695,7 @@ describe('ol.format.KML', function() { it('can write XYZ Polygon geometries', function() { var layout = 'XYZ'; - var polygon = new _ol_geom_Polygon_( + var polygon = new Polygon( [[[0, 0, 1], [0, 2, 2], [2, 2, 3], [2, 0, 4], [0, 0, 5]]], layout); var features = [new _ol_Feature_(polygon)]; var node = format.writeFeaturesNode(features); @@ -722,7 +722,7 @@ describe('ol.format.KML', function() { it('can write XYM Polygon geometries', function() { var layout = 'XYM'; - var polygon = new _ol_geom_Polygon_( + var polygon = new Polygon( [[[0, 0, 1], [0, 2, 1], [2, 2, 1], [2, 0, 1], [0, 0, 1]]], layout); var features = [new _ol_Feature_(polygon)]; var node = format.writeFeaturesNode(features); @@ -749,7 +749,7 @@ describe('ol.format.KML', function() { it('can write XYZM Polygon geometries', function() { var layout = 'XYZM'; - var polygon = new _ol_geom_Polygon_([ + var polygon = new Polygon([ [[0, 0, 1, 1], [0, 2, 2, 1], [2, 2, 3, 1], [2, 0, 4, 1], [0, 0, 5, 1]] ], layout); var features = [new _ol_Feature_(polygon)]; @@ -801,7 +801,7 @@ describe('ol.format.KML', function() { var f = fs[0]; expect(f).to.be.an(_ol_Feature_); var g = f.getGeometry(); - expect(g).to.be.an(_ol_geom_Polygon_); + expect(g).to.be.an(Polygon); expect(g.getCoordinates()).to.eql([ [[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]], [[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]], @@ -811,7 +811,7 @@ describe('ol.format.KML', function() { it('can write complex Polygon geometries', function() { var layout = 'XYZ'; - var polygon = new _ol_geom_Polygon_([ + var polygon = new Polygon([ [[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]], [[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]], [[3, 3, 0], [3, 4, 0], [4, 4, 0], [4, 3, 0]] @@ -1182,8 +1182,8 @@ describe('ol.format.KML', function() { expect(gs).to.have.length(4); expect(gs[0]).to.be.an(Point); expect(gs[1]).to.be.an(LineString); - expect(gs[2]).to.be.an(_ol_geom_Polygon_); - expect(gs[3]).to.be.an(_ol_geom_Polygon_); + expect(gs[2]).to.be.an(Polygon); + expect(gs[3]).to.be.an(Polygon); }); it('can read nested GeometryCollection geometries', function() { @@ -1211,7 +1211,7 @@ describe('ol.format.KML', function() { var collection = new _ol_geom_GeometryCollection_([ new Point([1, 2]), new LineString([[1, 2], [3, 4]]), - new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]]) + new Polygon([[[1, 2], [3, 4], [3, 2], [1, 2]]]) ]); var features = [new _ol_Feature_(collection)]; var node = format.writeFeaturesNode(features); diff --git a/test/spec/ol/format/mvt.test.js b/test/spec/ol/format/mvt.test.js index c4b4a6bee2..f272cb220c 100644 --- a/test/spec/ol/format/mvt.test.js +++ b/test/spec/ol/format/mvt.test.js @@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js'; import * as _ol_extent_ from '../../../../src/ol/extent.js'; import _ol_format_MVT_ from '../../../../src/ol/format/MVT.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_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js'; @@ -136,7 +136,7 @@ describe('ol.format.MVT', function() { var feature = format.createFeature_({}, rawFeature); _ol_format_MVT_.readRawGeometry_ = readRawGeometry_; var geometry = feature.getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); }); it('detects a MultiPolygon', function() { diff --git a/test/spec/ol/format/topojson.test.js b/test/spec/ol/format/topojson.test.js index 3a223d60a1..985e1faaa9 100644 --- a/test/spec/ol/format/topojson.test.js +++ b/test/spec/ol/format/topojson.test.js @@ -1,6 +1,6 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js'; import {transform} from '../../../../src/ol/proj.js'; import _ol_format_TopoJSON_ from '../../../../src/ol/format/TopoJSON.js'; @@ -62,7 +62,7 @@ describe('ol.format.TopoJSON', function() { expect(feature).to.be.a(_ol_Feature_); var geometry = feature.getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); // Parses identifier expect(feature.getId()).to.be(533); @@ -164,7 +164,7 @@ describe('ol.format.TopoJSON', function() { var last = features[177]; expect(last).to.be.a(_ol_Feature_); var lastGeom = last.getGeometry(); - expect(lastGeom).to.be.a(_ol_geom_Polygon_); + expect(lastGeom).to.be.a(Polygon); expect(lastGeom.getExtent()).to.eql([ 25.26325263252633, -22.271802279310577, 32.848528485284874, -15.50833810039586 diff --git a/test/spec/ol/format/wfs.test.js b/test/spec/ol/format/wfs.test.js index 62f893570c..7a54dffb57 100644 --- a/test/spec/ol/format/wfs.test.js +++ b/test/spec/ol/format/wfs.test.js @@ -6,7 +6,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; import {transform} from '../../../../src/ol/proj.js'; import _ol_xml_ from '../../../../src/ol/xml.js'; @@ -551,7 +551,7 @@ describe('ol.format.WFS', function() { featureTypes: ['area'], filter: _ol_format_filter_.contains( 'the_geom', - new _ol_geom_Polygon_([[ + new Polygon([[ [10, 20], [10, 25], [15, 25], @@ -588,7 +588,7 @@ describe('ol.format.WFS', function() { featureTypes: ['area'], filter: _ol_format_filter_.intersects( 'the_geom', - new _ol_geom_Polygon_([[ + new Polygon([[ [10, 20], [10, 25], [15, 25], @@ -625,7 +625,7 @@ describe('ol.format.WFS', function() { featureTypes: ['area'], filter: _ol_format_filter_.within( 'the_geom', - new _ol_geom_Polygon_([[ + new Polygon([[ [10, 20], [10, 25], [15, 25], @@ -1138,7 +1138,7 @@ describe('ol.format.WFS', function() { var fid = 'Historische_Messtischblaetter_WFS.71055885'; expect(feature.getId()).to.equal(fid); expect(feature.get('titel')).to.equal('Arnstadt'); - expect(feature.getGeometry()).to.be.an(_ol_geom_Polygon_); + expect(feature.getGeometry()).to.be.an(Polygon); }); }); diff --git a/test/spec/ol/geom/geometrycollection.test.js b/test/spec/ol/geom/geometrycollection.test.js index f3e80ed5fc..d104c967db 100644 --- a/test/spec/ol/geom/geometrycollection.test.js +++ b/test/spec/ol/geom/geometrycollection.test.js @@ -2,7 +2,7 @@ import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js'; import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.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'; describe('ol.geom.GeometryCollection', function() { @@ -16,7 +16,7 @@ describe('ol.geom.GeometryCollection', function() { beforeEach(function() { point = new Point([10, 20]); line = new LineString([[10, 20], [30, 40]]); - poly = new _ol_geom_Polygon_([outer, inner1, inner2]); + poly = new Polygon([outer, inner1, inner2]); multi = new _ol_geom_GeometryCollection_([point, line, poly]); }); @@ -58,7 +58,7 @@ describe('ol.geom.GeometryCollection', function() { it('returns a collection of geometries', function() { var point = new Point([10, 20]); var line = new LineString([[10, 20], [30, 40]]); - var poly = new _ol_geom_Polygon_([outer, inner1, inner2]); + var poly = new Polygon([outer, inner1, inner2]); var multi = new _ol_geom_GeometryCollection_([point, line, poly]); var geometries = multi.getGeometries(); @@ -66,7 +66,7 @@ describe('ol.geom.GeometryCollection', function() { expect(geometries).to.have.length(3); expect(geometries[0]).to.be.a(Point); expect(geometries[1]).to.be.a(LineString); - expect(geometries[2]).to.be.a(_ol_geom_Polygon_); + expect(geometries[2]).to.be.a(Polygon); }); }); @@ -76,7 +76,7 @@ describe('ol.geom.GeometryCollection', function() { it('has a working clone method', function() { var point = new Point([10, 20]); var line = new LineString([[10, 20], [30, 40]]); - var poly = new _ol_geom_Polygon_([outer, inner1, inner2]); + var poly = new Polygon([outer, inner1, inner2]); var multi = new _ol_geom_GeometryCollection_([point, line, poly]); var clone = multi.clone(); expect(clone).to.not.be(multi); @@ -124,7 +124,7 @@ describe('ol.geom.GeometryCollection', function() { beforeEach(function() { point = new Point([5, 20]); line = new LineString([[10, 20], [30, 40]]); - poly = new _ol_geom_Polygon_([outer, inner1, inner2]); + poly = new Polygon([outer, inner1, inner2]); multi = new _ol_geom_GeometryCollection_([point, line, poly]); }); @@ -153,7 +153,7 @@ describe('ol.geom.GeometryCollection', function() { beforeEach(function() { point = new Point([10, 20]); line = new LineString([[10, 20], [30, 40]]); - poly = new _ol_geom_Polygon_([outer, inner1, inner2]); + poly = new Polygon([outer, inner1, inner2]); multi = new _ol_geom_GeometryCollection_([point, line, poly]); }); diff --git a/test/spec/ol/geom/multipolygon.test.js b/test/spec/ol/geom/multipolygon.test.js index f723be16b3..30f1db2733 100644 --- a/test/spec/ol/geom/multipolygon.test.js +++ b/test/spec/ol/geom/multipolygon.test.js @@ -1,5 +1,5 @@ import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; describe('ol.geom.MultiPolygon', function() { @@ -19,11 +19,11 @@ describe('ol.geom.MultiPolygon', function() { it('can append polygons', function() { multiPolygon.appendPolygon( - new _ol_geom_Polygon_([[[0, 0], [0, 2], [1, 1], [2, 0]]])); + new Polygon([[[0, 0], [0, 2], [1, 1], [2, 0]]])); expect(multiPolygon.getCoordinates()).to.eql( [[[[0, 0], [0, 2], [1, 1], [2, 0]]]]); multiPolygon.appendPolygon( - new _ol_geom_Polygon_([[[3, 0], [4, 1], [5, 2], [5, 0]]])); + new Polygon([[[3, 0], [4, 1], [5, 2], [5, 0]]])); expect(multiPolygon.getCoordinates()).to.eql([ [[[0, 0], [0, 2], [1, 1], [2, 0]]], [[[3, 0], [4, 1], [5, 2], [5, 0]]] @@ -42,11 +42,11 @@ describe('ol.geom.MultiPolygon', function() { it('can append polygons', function() { multiPolygon.appendPolygon( - new _ol_geom_Polygon_([[[0, 0], [0, 2], [1, 1], [2, 0]]])); + new Polygon([[[0, 0], [0, 2], [1, 1], [2, 0]]])); expect(multiPolygon.getCoordinates()).to.eql( [[[[0, 0], [0, 2], [1, 1], [2, 0]]]]); multiPolygon.appendPolygon( - new _ol_geom_Polygon_([[[3, 0], [4, 1], [5, 2], [5, 0]]])); + new Polygon([[[3, 0], [4, 1], [5, 2], [5, 0]]])); expect(multiPolygon.getCoordinates()).to.eql([ [[[0, 0], [0, 2], [1, 1], [2, 0]]], [[[3, 0], [4, 1], [5, 2], [5, 0]]] @@ -99,11 +99,11 @@ describe('ol.geom.MultiPolygon', function() { it('can return individual polygons', function() { var polygon0 = multiPolygon.getPolygon(0); - expect(polygon0).to.be.an(_ol_geom_Polygon_); + expect(polygon0).to.be.an(Polygon); expect(polygon0.getCoordinates()).to.eql( [[[0, 0], [0, 2], [1, 1], [2, 0]]]); var polygon1 = multiPolygon.getPolygon(1); - expect(polygon1).to.be.an(_ol_geom_Polygon_); + expect(polygon1).to.be.an(Polygon); expect(polygon1.getCoordinates()).to.eql( [[[3, 0], [4, 1], [5, 2], [5, 0]]]); }); @@ -112,10 +112,10 @@ describe('ol.geom.MultiPolygon', function() { var polygons = multiPolygon.getPolygons(); expect(polygons).to.be.an(Array); expect(polygons).to.have.length(2); - expect(polygons[0]).to.be.an(_ol_geom_Polygon_); + expect(polygons[0]).to.be.an(Polygon); expect(polygons[0].getCoordinates()).to.eql( [[[0, 0], [0, 2], [1, 1], [2, 0]]]); - expect(polygons[1]).to.be.an(_ol_geom_Polygon_); + expect(polygons[1]).to.be.an(Polygon); expect(polygons[1].getCoordinates()).to.eql( [[[3, 0], [4, 1], [5, 2], [5, 0]]]); }); diff --git a/test/spec/ol/geom/polygon.test.js b/test/spec/ol/geom/polygon.test.js index 797dadcba5..96e2b6d724 100644 --- a/test/spec/ol/geom/polygon.test.js +++ b/test/spec/ol/geom/polygon.test.js @@ -1,14 +1,14 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js'; import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; describe('ol.geom.Polygon', function() { it('can be constructed with a null geometry', function() { expect(function() { - return new _ol_geom_Polygon_(null); + return new Polygon(null); }).not.to.throwException(); }); @@ -16,7 +16,7 @@ describe('ol.geom.Polygon', function() { var polygon; beforeEach(function() { - polygon = new _ol_geom_Polygon_([]); + polygon = new Polygon([]); }); it('defaults to layout XY', function() { @@ -59,7 +59,7 @@ describe('ol.geom.Polygon', function() { beforeEach(function() { outerRing = [[0, 1], [1, 4], [4, 3], [3, 0]]; innerRing = [[2, 2], [3, 2], [3, 3], [2, 3]]; - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); flatCoordinates = [0, 1, 1, 4, 4, 3, 3, 0, 2, 2, 3, 2, 3, 3, 2, 3]; outsideOuter = [0, 4]; inside = [1.5, 1.5]; @@ -104,7 +104,7 @@ describe('ol.geom.Polygon', function() { it('does not reverse any rings', function() { outerRing.reverse(); innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); var coordinates = polygon.getCoordinates(); expect(coordinates[0]).to.eql(outerRing); expect(coordinates[1]).to.eql(innerRing); @@ -126,8 +126,8 @@ describe('ol.geom.Polygon', function() { var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]; var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]; - var right = new _ol_geom_Polygon_([ccw, cw]); - var left = new _ol_geom_Polygon_([cw, ccw]); + var right = new Polygon([ccw, cw]); + var left = new Polygon([cw, ccw]); it('returns coordinates as they were constructed', function() { expect(right.getCoordinates()).to.eql([ccw, cw]); @@ -150,20 +150,20 @@ describe('ol.geom.Polygon', function() { it('reverses the outer ring if necessary', function() { outerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses inner rings if necessary', function() { innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses all rings if necessary', function() { outerRing.reverse(); innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); @@ -178,7 +178,7 @@ describe('ol.geom.Polygon', function() { beforeEach(function() { outerRing = [[0, 0, 1], [4, 4, 2], [4, 0, 3]]; innerRing = [[2, 1, 4], [3, 1, 5], [3, 2, 6]]; - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); flatCoordinates = [0, 0, 1, 4, 4, 2, 4, 0, 3, 2, 1, 4, 3, 1, 5, 3, 2, 6]; outsideOuter = [1, 3]; inside = [3.5, 0.5]; @@ -248,20 +248,20 @@ describe('ol.geom.Polygon', function() { it('reverses the outer ring if necessary', function() { outerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses inner rings if necessary', function() { innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses all rings if necessary', function() { outerRing.reverse(); innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); @@ -276,7 +276,7 @@ describe('ol.geom.Polygon', function() { beforeEach(function() { outerRing = [[0, 0, 1], [4, 4, 2], [4, 0, 3]]; innerRing = [[2, 1, 4], [3, 1, 5], [3, 2, 6]]; - polygon = new _ol_geom_Polygon_( + polygon = new Polygon( [outerRing, innerRing], 'XYM'); flatCoordinates = [0, 0, 1, 4, 4, 2, 4, 0, 3, 2, 1, 4, 3, 1, 5, 3, 2, 6]; outsideOuter = [1, 3]; @@ -347,20 +347,20 @@ describe('ol.geom.Polygon', function() { it('reverses the outer ring if necessary', function() { outerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses inner rings if necessary', function() { innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses all rings if necessary', function() { outerRing.reverse(); innerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing]); + polygon = new Polygon([outerRing, innerRing]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); @@ -377,7 +377,7 @@ describe('ol.geom.Polygon', function() { innerRing1 = [[2, 4, 7, 8], [4, 4, 9, 10], [4, 5, 11, 12], [2, 5, 13, 14]]; innerRing2 = [[3, 2, 15, 16], [4, 3, 17, 18], [2, 3, 19, 20]]; - polygon = new _ol_geom_Polygon_([outerRing, innerRing1, innerRing2]); + polygon = new Polygon([outerRing, innerRing1, innerRing2]); flatCoordinates = [ 0, 6, 1, 2, 6, 6, 3, 4, 3, 0, 5, 6, 2, 4, 7, 8, 4, 4, 9, 10, 4, 5, 11, 12, 2, 5, 13, 14, @@ -456,14 +456,14 @@ describe('ol.geom.Polygon', function() { it('reverses the outer ring if necessary', function() { outerRing.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing1, innerRing2]); + polygon = new Polygon([outerRing, innerRing1, innerRing2]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); it('reverses inner rings if necessary', function() { innerRing1.reverse(); innerRing2.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing1, innerRing2]); + polygon = new Polygon([outerRing, innerRing1, innerRing2]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); @@ -471,7 +471,7 @@ describe('ol.geom.Polygon', function() { outerRing.reverse(); innerRing1.reverse(); innerRing2.reverse(); - polygon = new _ol_geom_Polygon_([outerRing, innerRing1, innerRing2]); + polygon = new Polygon([outerRing, innerRing1, innerRing2]); expect(polygon.getOrientedFlatCoordinates()).to.eql(flatCoordinates); }); @@ -483,7 +483,7 @@ describe('ol.geom.Polygon', function() { var polygon; beforeEach(function() { - polygon = new _ol_geom_Polygon_( + polygon = new Polygon( [[[3, 0], [1, 3], [0, 6], [2, 6], [3, 7], [4, 6], [6, 6], [4, 3]]]); }); @@ -491,7 +491,7 @@ describe('ol.geom.Polygon', function() { it('returns the expected result', function() { var simplifiedGeometry = polygon.getSimplifiedGeometry(9); - expect(simplifiedGeometry).to.be.an(_ol_geom_Polygon_); + expect(simplifiedGeometry).to.be.an(Polygon); expect(simplifiedGeometry.getCoordinates()).to.eql( [[[3, 0], [0, 3], [0, 6], [6, 6], [3, 3]]]); }); @@ -511,7 +511,7 @@ describe('ol.geom.Polygon', function() { describe('#scale()', function() { it('scales a polygon', function() { - var geom = new _ol_geom_Polygon_([ + var geom = new Polygon([ [[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]] ]); geom.scale(10); @@ -520,7 +520,7 @@ describe('ol.geom.Polygon', function() { }); it('accepts sx and sy', function() { - var geom = new _ol_geom_Polygon_([ + var geom = new Polygon([ [[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]] ]); geom.scale(2, 3); @@ -529,7 +529,7 @@ describe('ol.geom.Polygon', function() { }); it('accepts an anchor', function() { - var geom = new _ol_geom_Polygon_([ + var geom = new Polygon([ [[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]] ]); geom.scale(3, 2, [-1, -2]); @@ -542,7 +542,7 @@ describe('ol.geom.Polygon', function() { describe('#getInteriorPoint', function() { it('returns XYM point with intersection width as M', function() { - var geom = new _ol_geom_Polygon_([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]); + var geom = new Polygon([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]); var interiorPoint = geom.getInteriorPoint(); expect(interiorPoint.getType()).to.be('Point'); expect(interiorPoint.layout).to.be('XYM'); @@ -550,7 +550,7 @@ describe('ol.geom.Polygon', function() { }); it('returns XYM point for donut polygons', function() { - var geom = new _ol_geom_Polygon_([ + var geom = new Polygon([ [[0.5, 0.5], [0.5, 2.5], [2.5, 2.5], [2.5, 0.5], [0.5, 0.5]], [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]] ]); @@ -564,7 +564,7 @@ describe('ol.geom.Polygon', function() { describe('ol.geom.Polygon.fromExtent', function() { it('creates the correct polygon', function() { var extent = [1, 2, 3, 5]; - var polygon = _ol_geom_Polygon_.fromExtent(extent); + var polygon = Polygon.fromExtent(extent); var flatCoordinates = polygon.getFlatCoordinates(); expect(flatCoordinates).to.eql( [1, 2, 1, 5, 3, 5, 3, 2, 1, 2]); @@ -578,7 +578,7 @@ describe('ol.geom.Polygon', function() { it('creates a regular polygon', function() { var circle = new _ol_geom_Circle_([0, 0, 0], 1, 'XYZ'); - var polygon = _ol_geom_Polygon_.fromCircle(circle); + var polygon = Polygon.fromCircle(circle); var coordinates = polygon.getLinearRing(0).getCoordinates(); expect(coordinates[0].length).to.eql(3); expect(coordinates[0][2]).to.eql(0); @@ -599,7 +599,7 @@ describe('ol.geom.Polygon', function() { it('creates a regular polygon with custom sides and angle', function() { var circle = new _ol_geom_Circle_([0, 0], 1); - var polygon = _ol_geom_Polygon_.fromCircle(circle, 4, Math.PI / 2); + var polygon = Polygon.fromCircle(circle, 4, Math.PI / 2); var coordinates = polygon.getLinearRing(0).getCoordinates(); expect(coordinates[4]).to.eql(coordinates[0]); expect(coordinates[0][0]).to.roughlyEqual(0, 1e-9); diff --git a/test/spec/ol/interaction/dragzoom.test.js b/test/spec/ol/interaction/dragzoom.test.js index 4e09a66cbd..a0e1e7d238 100644 --- a/test/spec/ol/interaction/dragzoom.test.js +++ b/test/spec/ol/interaction/dragzoom.test.js @@ -1,7 +1,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_View_ from '../../../../src/ol/View.js'; import * as _ol_extent_ from '../../../../src/ol/extent.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; import _ol_interaction_DragZoom_ from '../../../../src/ol/interaction/DragZoom.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; import _ol_render_Box_ from '../../../../src/ol/render/Box.js'; @@ -72,7 +72,7 @@ describe('ol.interaction.DragZoom', function() { var box = new _ol_render_Box_(); var extent = [-110, 40, -90, 60]; - box.geometry_ = _ol_geom_Polygon_.fromExtent(extent); + box.geometry_ = Polygon.fromExtent(extent); interaction.box_ = box; interaction.onBoxEnd(); @@ -94,7 +94,7 @@ describe('ol.interaction.DragZoom', function() { var box = new _ol_render_Box_(); var extent = [-11.25, -11.25, 11.25, 11.25]; - box.geometry_ = _ol_geom_Polygon_.fromExtent(extent); + box.geometry_ = Polygon.fromExtent(extent); interaction.box_ = box; map.getView().setResolution(0.25); diff --git a/test/spec/ol/interaction/draw.test.js b/test/spec/ol/interaction/draw.test.js index 45aa8c8b77..573ad2b1b2 100644 --- a/test/spec/ol/interaction/draw.test.js +++ b/test/spec/ol/interaction/draw.test.js @@ -11,7 +11,7 @@ import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.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_Draw_ from '../../../../src/ol/interaction/Draw.js'; import _ol_interaction_Interaction_ from '../../../../src/ol/interaction/Interaction.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; @@ -551,7 +551,7 @@ describe('ol.interaction.Draw', function() { var features = source.getFeatures(); expect(features).to.have.length(1); var geometry = features[0].getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); expect(geometry.getCoordinates()).to.eql([ [[10, -20], [30, -20], [40, -10], [10, -20]] @@ -629,7 +629,7 @@ describe('ol.interaction.Draw', function() { var features = source.getFeatures(); expect(features).to.have.length(1); var geometry = features[0].getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); expect(geometry.getCoordinates()).to.eql([ [[10, -20], [30, -20], [40, -10], [10, -20]] @@ -653,7 +653,7 @@ describe('ol.interaction.Draw', function() { var features = source.getFeatures(); expect(features).to.have.length(1); var geometry = features[0].getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); expect(geometry.getCoordinates()).to.eql([ [[10, -20], [30, -20], [40, -10], [10, -20]] @@ -988,7 +988,7 @@ describe('ol.interaction.Draw', function() { var features = source.getFeatures(); var geometry = features[0].getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); var coordinates = geometry.getCoordinates(); expect(coordinates[0].length).to.eql(5); expect(coordinates[0][0][0]).to.roughlyEqual(20, 1e-9); @@ -1017,7 +1017,7 @@ describe('ol.interaction.Draw', function() { var features = source.getFeatures(); var geometry = features[0].getGeometry(); - expect(geometry).to.be.a(_ol_geom_Polygon_); + expect(geometry).to.be.a(Polygon); var coordinates = geometry.getCoordinates(); expect(coordinates[0]).to.have.length(5); expect(geometry.getArea()).to.equal(400); diff --git a/test/spec/ol/interaction/modify.test.js b/test/spec/ol/interaction/modify.test.js index be6499e605..5bb781976d 100644 --- a/test/spec/ol/interaction/modify.test.js +++ b/test/spec/ol/interaction/modify.test.js @@ -8,7 +8,7 @@ import _ol_events_condition_ from '../../../../src/ol/events/condition.js'; import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.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_Modify_ from '../../../../src/ol/interaction/Modify.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; import _ol_pointer_PointerEvent_ from '../../../../src/ol/pointer/PointerEvent.js'; @@ -35,7 +35,7 @@ describe('ol.interaction.Modify', function() { features = [ new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([ + geometry: new Polygon([ [[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]] ]) }) diff --git a/test/spec/ol/interaction/select.test.js b/test/spec/ol/interaction/select.test.js index 1d8b52ce6c..d1b39b6697 100644 --- a/test/spec/ol/interaction/select.test.js +++ b/test/spec/ol/interaction/select.test.js @@ -4,7 +4,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_MapBrowserEventType_ from '../../../../src/ol/MapBrowserEventType.js'; import _ol_MapBrowserPointerEvent_ from '../../../../src/ol/MapBrowserPointerEvent.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_Interaction_ from '../../../../src/ol/interaction/Interaction.js'; import _ol_interaction_Select_ from '../../../../src/ol/interaction/Select.js'; import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js'; @@ -29,7 +29,7 @@ describe('ol.interaction.Select', function() { style.height = height + 'px'; document.body.appendChild(target); - var geometry = new _ol_geom_Polygon_([[[0, 0], [0, 40], [40, 40], [40, 0]]]); + var geometry = new Polygon([[[0, 0], [0, 40], [40, 40], [40, 0]]]); // Four overlapping features, two features of type "foo" and two features // of type "bar". The rendering order is, from top to bottom, foo -> bar diff --git a/test/spec/ol/render/box.test.js b/test/spec/ol/render/box.test.js index 92aad1d123..9fed4c2f71 100644 --- a/test/spec/ol/render/box.test.js +++ b/test/spec/ol/render/box.test.js @@ -1,7 +1,7 @@ import _ol_Disposable_ from '../../../../src/ol/Disposable.js'; 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_render_Box_ from '../../../../src/ol/render/Box.js'; @@ -67,7 +67,7 @@ describe('ol.render.Box', function() { it('creates a polygon geometry', function() { expect(box.getGeometry()).to.be(null); box.setPixels([1, 2], [3, 4]); - expect(box.getGeometry()).to.be.a(_ol_geom_Polygon_); + expect(box.getGeometry()).to.be.a(Polygon); }); }); diff --git a/test/spec/ol/render/canvas/immediate.test.js b/test/spec/ol/render/canvas/immediate.test.js index 2b70148cb3..f161adfe52 100644 --- a/test/spec/ol/render/canvas/immediate.test.js +++ b/test/spec/ol/render/canvas/immediate.test.js @@ -5,7 +5,7 @@ import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.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_VectorContext_ from '../../../../../src/ol/render/VectorContext.js'; import _ol_render_canvas_Immediate_ from '../../../../../src/ol/render/canvas/Immediate.js'; import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js'; @@ -91,7 +91,7 @@ describe('ol.render.canvas.Immediate', function() { var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent); sinon.spy(context, 'drawPolygon'); - var geometry = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]); + var geometry = new Polygon([[[1, 2], [3, 4], [5, 6], [1, 2]]]); context.drawGeometry(geometry); expect(context.drawPolygon.calledOnce).to.be(true); expect(context.drawPolygon.firstCall.calledWithExactly(geometry)).to.be(true); @@ -136,7 +136,7 @@ describe('ol.render.canvas.Immediate', function() { var point = new Point([1, 2]); var linestring = new LineString([[1, 2], [3, 4]]); - var polygon = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]); + var polygon = new Polygon([[[1, 2], [3, 4], [5, 6], [1, 2]]]); var geometry = new _ol_geom_GeometryCollection_([point, linestring, polygon]); context.drawGeometry(geometry); diff --git a/test/spec/ol/render/canvas/textreplay.test.js b/test/spec/ol/render/canvas/textreplay.test.js index cc63bbd6d4..e33ef5ae0e 100644 --- a/test/spec/ol/render/canvas/textreplay.test.js +++ b/test/spec/ol/render/canvas/textreplay.test.js @@ -1,6 +1,6 @@ import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../../src/ol/geom/Polygon.js'; import _ol_render_canvas_TextReplay_ from '../../../../../src/ol/render/canvas/TextReplay.js'; import _ol_style_Text_ from '../../../../../src/ol/style/Text.js'; @@ -8,7 +8,7 @@ describe('ol.render.canvas.TextReplay', function() { it('renders polygon labels only when they fit', function() { var replay = new _ol_render_canvas_TextReplay_(1, [-180, -90, 180, 90], 0.02, 1, true); - var geometry = new _ol_geom_Polygon_([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]); + var geometry = new Polygon([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]); var feature = new _ol_Feature_(geometry); replay.setTextStyle(new _ol_style_Text_({ diff --git a/test/spec/ol/render/feature.test.js b/test/spec/ol/render/feature.test.js index c1746da292..0707534a3d 100644 --- a/test/spec/ol/render/feature.test.js +++ b/test/spec/ol/render/feature.test.js @@ -1,7 +1,7 @@ import LineString from '../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../src/ol/geom/Polygon.js'; import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js'; @@ -55,7 +55,7 @@ describe('ol.render.Feature', function() { describe('#getFlatInteriorPoint()', function() { it('returns correct point and caches it', function() { - var polygon = new _ol_geom_Polygon_([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]); + var polygon = new Polygon([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]); var feature = new _ol_render_Feature_('Polygon', polygon.getOrientedFlatCoordinates(), polygon.getEnds()); expect(feature.getFlatInteriorPoint()).to.eql([5, 5, 10]); diff --git a/test/spec/ol/render/webgl/immediate.test.js b/test/spec/ol/render/webgl/immediate.test.js index 377c9ae000..40d740e501 100644 --- a/test/spec/ol/render/webgl/immediate.test.js +++ b/test/spec/ol/render/webgl/immediate.test.js @@ -6,7 +6,7 @@ import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.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_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js'; import _ol_render_webgl_ImageReplay_ from '../../../../../src/ol/render/webgl/ImageReplay.js'; import _ol_render_webgl_Immediate_ from '../../../../../src/ol/render/webgl/Immediate.js'; @@ -31,7 +31,7 @@ describe('ol.render.webgl.Immediate', function() { multiLine = new MultiLineString([[[0, 0], [5, 5]]]); point = new Point([0, 0]); multiPoint = new MultiPoint([[0, 0]]); - polygon = new _ol_geom_Polygon_([[[0, 0], [5, 5], [5, 0], [0, 0]]]); + polygon = new Polygon([[[0, 0], [5, 5], [5, 0], [0, 0]]]); multiPolygon = new _ol_geom_MultiPolygon_([[[[0, 0], [5, 5], [5, 0], [0, 0]]]]); }); diff --git a/test/spec/ol/render/webgl/polygonreplay.test.js b/test/spec/ol/render/webgl/polygonreplay.test.js index e0a462dc31..4fa1785ecf 100644 --- a/test/spec/ol/render/webgl/polygonreplay.test.js +++ b/test/spec/ol/render/webgl/polygonreplay.test.js @@ -1,7 +1,7 @@ import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js'; -import _ol_geom_Polygon_ from '../../../../../src/ol/geom/Polygon.js'; +import Polygon from '../../../../../src/ol/geom/Polygon.js'; import _ol_render_webgl_PolygonReplay_ from '../../../../../src/ol/render/webgl/PolygonReplay.js'; import _ol_render_webgl_polygonreplay_defaultshader_ from '../../../../../src/ol/render/webgl/polygonreplay/defaultshader.js'; import _ol_render_webgl_polygonreplay_defaultshader_Locations_ from '../../../../../src/ol/render/webgl/polygonreplay/defaultshader/Locations.js'; @@ -32,7 +32,7 @@ describe('ol.render.webgl.PolygonReplay', function() { }); it('sets the buffer data', function() { - var polygon1 = new _ol_geom_Polygon_( + var polygon1 = new Polygon( [[[1000, 2000], [1200, 2000], [1200, 3000]]] ); replay.drawPolygon(polygon1, null); @@ -43,7 +43,7 @@ describe('ol.render.webgl.PolygonReplay', function() { 1000, 2000, 1200, 3000, 1200, 2000, 1000, 2000]); expect(replay.indices).to.eql([2, 0, 1]); - var polygon2 = new _ol_geom_Polygon_( + var polygon2 = new Polygon( [[[4000, 2000], [4200, 2000], [4200, 3000]]] ); replay.drawPolygon(polygon2, null); @@ -396,13 +396,13 @@ describe('ol.render.webgl.PolygonReplay', function() { describe('#drawReplay', function() { var gl, context; var feature1 = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([[[0, 0], [500, 500], [500, 0], [0, 0]]]) + geometry: new Polygon([[[0, 0], [500, 500], [500, 0], [0, 0]]]) }); var feature2 = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([[[0, 0], [500, 500], [500, 0], [0, 0]]]) + geometry: new Polygon([[[0, 0], [500, 500], [500, 0], [0, 0]]]) }); var feature3 = new _ol_Feature_({ - geometry: new _ol_geom_Polygon_([[[0, 0], [500, 500], [500, 0], [0, 0]]]) + geometry: new Polygon([[[0, 0], [500, 500], [500, 0], [0, 0]]]) }); beforeEach(function() { gl = { diff --git a/test/spec/ol/renderer/canvas/replay.test.js b/test/spec/ol/renderer/canvas/replay.test.js index 11a6514f24..60c8671a53 100644 --- a/test/spec/ol/renderer/canvas/replay.test.js +++ b/test/spec/ol/renderer/canvas/replay.test.js @@ -6,7 +6,7 @@ import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.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_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js'; import _ol_render_canvas_PolygonReplay_ from '../../../../../src/ol/render/canvas/PolygonReplay.js'; import _ol_render_canvas_Replay_ from '../../../../../src/ol/render/canvas/Replay.js'; @@ -29,13 +29,13 @@ describe('ol.render.canvas.ReplayGroup', function() { beforeEach(function() { transform = _ol_transform_.create(); replay = new _ol_render_canvas_ReplayGroup_(1, [-180, -90, 180, 90], 1, 1, false); - feature0 = new _ol_Feature_(new _ol_geom_Polygon_( + feature0 = new _ol_Feature_(new Polygon( [[[-90, 0], [-45, 45], [0, 0], [1, 1], [0, -45], [-90, 0]]])); - feature1 = new _ol_Feature_(new _ol_geom_Polygon_( + feature1 = new _ol_Feature_(new Polygon( [[[-90, -45], [-90, 0], [0, 0], [0, -45], [-90, -45]]])); - feature2 = new _ol_Feature_(new _ol_geom_Polygon_( + feature2 = new _ol_Feature_(new Polygon( [[[90, 45], [90, 0], [0, 0], [0, 45], [90, 45]]])); - feature3 = new _ol_Feature_(new _ol_geom_Polygon_( + feature3 = new _ol_Feature_(new Polygon( [[[-90, -45], [-90, 45], [90, 45], [90, -45], [-90, -45]]])); fill0 = new _ol_style_Style_({ fill: new _ol_style_Fill_({color: 'black'}) diff --git a/test/spec/ol/renderer/vector.test.js b/test/spec/ol/renderer/vector.test.js index 6376c00150..c156d32e99 100644 --- a/test/spec/ol/renderer/vector.test.js +++ b/test/spec/ol/renderer/vector.test.js @@ -2,7 +2,7 @@ import {nullFunction} from '../../../../src/ol/index.js'; import _ol_events_ from '../../../../src/ol/events.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 MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js'; @@ -129,7 +129,7 @@ describe('ol.renderer.vector', function() { }); it('does render the polygon', function() { - feature.setGeometry(new _ol_geom_Polygon_( + feature.setGeometry(new Polygon( [[[0, 0], [1, 1], [1, 0], [0, 0]]])); var polygonReplay = replayGroup.getReplay( style.getZIndex(), 'Polygon'); diff --git a/test/spec/ol/source/cluster.test.js b/test/spec/ol/source/cluster.test.js index 0891978824..3779597d54 100644 --- a/test/spec/ol/source/cluster.test.js +++ b/test/spec/ol/source/cluster.test.js @@ -1,7 +1,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.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 {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js'; import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; @@ -52,7 +52,7 @@ describe('ol.source.Cluster', function() { features: [ new _ol_Feature_(new Point([0, 0])), new _ol_Feature_(new LineString([[0, 0], [1, 1]])), - new _ol_Feature_(new _ol_geom_Polygon_( + new _ol_Feature_(new Polygon( [[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]])) ] })