From ac7985a5ade91cf28f07f7ecff8c2f2d71a61471 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 14 Dec 2017 08:57:52 -0700 Subject: [PATCH] Rename _ol_geom_Circle_ to Circle --- examples/geojson.js | 4 +- src/ol/geom/Circle.js | 40 +++++++++---------- src/ol/interaction/Draw.js | 6 +-- test/rendering/ol/layer/vector.test.js | 4 +- test/spec/ol/coordinate.test.js | 4 +- test/spec/ol/format/geojson.test.js | 4 +- test/spec/ol/geom/circle.test.js | 12 +++--- test/spec/ol/geom/polygon.test.js | 6 +-- test/spec/ol/interaction/draw.test.js | 4 +- test/spec/ol/interaction/modify.test.js | 6 +-- test/spec/ol/interaction/snap.test.js | 4 +- test/spec/ol/render/canvas/immediate.test.js | 4 +- .../spec/ol/render/webgl/circlereplay.test.js | 14 +++---- test/spec/ol/render/webgl/immediate.test.js | 6 +-- test/spec/ol/view.test.js | 6 +-- 15 files changed, 62 insertions(+), 62 deletions(-) diff --git a/examples/geojson.js b/examples/geojson.js index 3b207afd98..e8c9db2d8f 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -3,7 +3,7 @@ import _ol_Map_ from '../src/ol/Map.js'; import _ol_View_ from '../src/ol/View.js'; import _ol_control_ from '../src/ol/control.js'; import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js'; -import _ol_geom_Circle_ from '../src/ol/geom/Circle.js'; +import Circle from '../src/ol/geom/Circle.js'; import _ol_layer_Tile_ from '../src/ol/layer/Tile.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; @@ -164,7 +164,7 @@ var vectorSource = new _ol_source_Vector_({ features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject) }); -vectorSource.addFeature(new _ol_Feature_(new _ol_geom_Circle_([5e6, 7e6], 1e6))); +vectorSource.addFeature(new _ol_Feature_(new Circle([5e6, 7e6], 1e6))); var vectorLayer = new _ol_layer_Vector_({ source: vectorSource, diff --git a/src/ol/geom/Circle.js b/src/ol/geom/Circle.js index ac279fe272..bc1e3dc6de 100644 --- a/src/ol/geom/Circle.js +++ b/src/ol/geom/Circle.js @@ -19,13 +19,13 @@ import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js'; * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api */ -var _ol_geom_Circle_ = function(center, opt_radius, opt_layout) { +var Circle = function(center, opt_radius, opt_layout) { _ol_geom_SimpleGeometry_.call(this); var radius = opt_radius ? opt_radius : 0; this.setCenterAndRadius(center, radius, opt_layout); }; -inherits(_ol_geom_Circle_, _ol_geom_SimpleGeometry_); +inherits(Circle, _ol_geom_SimpleGeometry_); /** @@ -34,8 +34,8 @@ inherits(_ol_geom_Circle_, _ol_geom_SimpleGeometry_); * @override * @api */ -_ol_geom_Circle_.prototype.clone = function() { - var circle = new _ol_geom_Circle_(null); +Circle.prototype.clone = function() { + var circle = new Circle(null); circle.setFlatCoordinates(this.layout, this.flatCoordinates.slice()); return circle; }; @@ -44,7 +44,7 @@ _ol_geom_Circle_.prototype.clone = function() { /** * @inheritDoc */ -_ol_geom_Circle_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { +Circle.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { var flatCoordinates = this.flatCoordinates; var dx = x - flatCoordinates[0]; var dy = y - flatCoordinates[1]; @@ -74,7 +74,7 @@ _ol_geom_Circle_.prototype.closestPointXY = function(x, y, closestPoint, minSqua /** * @inheritDoc */ -_ol_geom_Circle_.prototype.containsXY = function(x, y) { +Circle.prototype.containsXY = function(x, y) { var flatCoordinates = this.flatCoordinates; var dx = x - flatCoordinates[0]; var dy = y - flatCoordinates[1]; @@ -87,7 +87,7 @@ _ol_geom_Circle_.prototype.containsXY = function(x, y) { * @return {ol.Coordinate} Center. * @api */ -_ol_geom_Circle_.prototype.getCenter = function() { +Circle.prototype.getCenter = function() { return this.flatCoordinates.slice(0, this.stride); }; @@ -95,7 +95,7 @@ _ol_geom_Circle_.prototype.getCenter = function() { /** * @inheritDoc */ -_ol_geom_Circle_.prototype.computeExtent = function(extent) { +Circle.prototype.computeExtent = function(extent) { var flatCoordinates = this.flatCoordinates; var radius = flatCoordinates[this.stride] - flatCoordinates[0]; return createOrUpdate( @@ -110,7 +110,7 @@ _ol_geom_Circle_.prototype.computeExtent = function(extent) { * @return {number} Radius. * @api */ -_ol_geom_Circle_.prototype.getRadius = function() { +Circle.prototype.getRadius = function() { return Math.sqrt(this.getRadiusSquared_()); }; @@ -119,7 +119,7 @@ _ol_geom_Circle_.prototype.getRadius = function() { * @private * @return {number} Radius squared. */ -_ol_geom_Circle_.prototype.getRadiusSquared_ = function() { +Circle.prototype.getRadiusSquared_ = function() { var dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0]; var dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1]; return dx * dx + dy * dy; @@ -130,7 +130,7 @@ _ol_geom_Circle_.prototype.getRadiusSquared_ = function() { * @inheritDoc * @api */ -_ol_geom_Circle_.prototype.getType = function() { +Circle.prototype.getType = function() { return _ol_geom_GeometryType_.CIRCLE; }; @@ -139,7 +139,7 @@ _ol_geom_Circle_.prototype.getType = function() { * @inheritDoc * @api */ -_ol_geom_Circle_.prototype.intersectsExtent = function(extent) { +Circle.prototype.intersectsExtent = function(extent) { var circleExtent = this.getExtent(); if (intersects(extent, circleExtent)) { var center = this.getCenter(); @@ -163,7 +163,7 @@ _ol_geom_Circle_.prototype.intersectsExtent = function(extent) { * @param {ol.Coordinate} center Center. * @api */ -_ol_geom_Circle_.prototype.setCenter = function(center) { +Circle.prototype.setCenter = function(center) { var stride = this.stride; var radius = this.flatCoordinates[stride] - this.flatCoordinates[0]; var flatCoordinates = center.slice(); @@ -184,7 +184,7 @@ _ol_geom_Circle_.prototype.setCenter = function(center) { * @param {ol.geom.GeometryLayout=} opt_layout Layout. * @api */ -_ol_geom_Circle_.prototype.setCenterAndRadius = function(center, radius, opt_layout) { +Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) { if (!center) { this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null); } else { @@ -210,20 +210,20 @@ _ol_geom_Circle_.prototype.setCenterAndRadius = function(center, radius, opt_lay /** * @inheritDoc */ -_ol_geom_Circle_.prototype.getCoordinates = function() {}; +Circle.prototype.getCoordinates = function() {}; /** * @inheritDoc */ -_ol_geom_Circle_.prototype.setCoordinates = function(coordinates, opt_layout) {}; +Circle.prototype.setCoordinates = function(coordinates, opt_layout) {}; /** * @param {ol.geom.GeometryLayout} layout Layout. * @param {Array.} flatCoordinates Flat coordinates. */ -_ol_geom_Circle_.prototype.setFlatCoordinates = function(layout, flatCoordinates) { +Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) { this.setFlatCoordinatesInternal(layout, flatCoordinates); this.changed(); }; @@ -234,7 +234,7 @@ _ol_geom_Circle_.prototype.setFlatCoordinates = function(layout, flatCoordinates * @param {number} radius Radius. * @api */ -_ol_geom_Circle_.prototype.setRadius = function(radius) { +Circle.prototype.setRadius = function(radius) { this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius; this.changed(); }; @@ -262,5 +262,5 @@ _ol_geom_Circle_.prototype.setRadius = function(radius) { * @function * @api */ -_ol_geom_Circle_.prototype.transform; -export default _ol_geom_Circle_; +Circle.prototype.transform; +export default Circle; diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index d62eefc895..26f007ace3 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -11,7 +11,7 @@ import _ol_events_Event_ from '../events/Event.js'; import _ol_events_condition_ from '../events/condition.js'; import {boundingExtent, getBottomLeft, getBottomRight, getTopLeft, getTopRight} from '../extent.js'; import _ol_functions_ from '../functions.js'; -import _ol_geom_Circle_ from '../geom/Circle.js'; +import Circle from '../geom/Circle.js'; import _ol_geom_GeometryType_ from '../geom/GeometryType.js'; import LineString from '../geom/LineString.js'; import MultiLineString from '../geom/MultiLineString.js'; @@ -142,7 +142,7 @@ var _ol_interaction_Draw_ = function(options) { */ geometryFunction = function(coordinates, opt_geometry) { var circle = opt_geometry ? /** @type {ol.geom.Circle} */ (opt_geometry) : - new _ol_geom_Circle_([NaN, NaN]); + new Circle([NaN, NaN]); var squaredLength = _ol_coordinate_.squaredDistance( coordinates[0], coordinates[1]); circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength)); @@ -798,7 +798,7 @@ _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) : - Polygon.fromCircle(new _ol_geom_Circle_(center), opt_sides); + Polygon.fromCircle(new Circle(center), opt_sides); var angle = opt_angle ? opt_angle : Math.atan((end[1] - center[1]) / (end[0] - center[0])); Polygon.makeRegular(geometry, center, radius, angle); diff --git a/test/rendering/ol/layer/vector.test.js b/test/rendering/ol/layer/vector.test.js index bb05e98d98..6153fd4864 100644 --- a/test/rendering/ol/layer/vector.test.js +++ b/test/rendering/ol/layer/vector.test.js @@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js'; import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_View_ from '../../../../src/ol/View.js'; import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import Point from '../../../../src/ol/geom/Point.js'; import Polygon from '../../../../src/ol/geom/Polygon.js'; @@ -42,7 +42,7 @@ describe('ol.rendering.layer.Vector', function() { var source; function addCircle(r) { - source.addFeature(new _ol_Feature_(new _ol_geom_Circle_(center, r))); + source.addFeature(new _ol_Feature_(new Circle(center, r))); } function addPolygon(r) { diff --git a/test/spec/ol/coordinate.test.js b/test/spec/ol/coordinate.test.js index a78649415d..a4b33e3985 100644 --- a/test/spec/ol/coordinate.test.js +++ b/test/spec/ol/coordinate.test.js @@ -1,5 +1,5 @@ import _ol_coordinate_ from '../../../src/ol/coordinate.js'; -import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js'; +import Circle from '../../../src/ol/geom/Circle.js'; describe('ol.coordinate', function() { @@ -90,7 +90,7 @@ describe('ol.coordinate', function() { describe('#closestOnCircle', function() { var center = [5, 10]; - var circle = new _ol_geom_Circle_(center, 10); + var circle = new Circle(center, 10); it('can find the closest point on circle', function() { expect(_ol_coordinate_.closestOnCircle([-20, 10], circle)) .to.eql([-5, 10]); diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index b0a6b80e63..9a0d806dd8 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -1,7 +1,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js'; import * as _ol_extent_ from '../../../../src/ol/extent.js'; import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js'; @@ -747,7 +747,7 @@ describe('ol.format.GeoJSON', function() { }); it('encodes a circle as an empty geometry collection', function() { - var circle = new _ol_geom_Circle_([0, 0], 1); + var circle = new Circle([0, 0], 1); var geojson = format.writeGeometryObject(circle); expect(geojson).to.eql({ 'type': 'GeometryCollection', diff --git a/test/spec/ol/geom/circle.test.js b/test/spec/ol/geom/circle.test.js index 3491d48bc6..749c8f251b 100644 --- a/test/spec/ol/geom/circle.test.js +++ b/test/spec/ol/geom/circle.test.js @@ -1,4 +1,4 @@ -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; describe('ol.geom.Circle', function() { @@ -7,14 +7,14 @@ describe('ol.geom.Circle', function() { var circle; beforeEach(function() { - circle = new _ol_geom_Circle_([0, 0], 1); + circle = new Circle([0, 0], 1); }); describe('#clone', function() { it('returns a clone', function() { var clone = circle.clone(); - expect(clone).to.be.an(_ol_geom_Circle_); + expect(clone).to.be.an(Circle); expect(clone.getCenter()).to.eql(circle.getCenter()); expect(clone.getCenter()).not.to.be(circle.getCenter()); expect(clone.getRadius()).to.be(circle.getRadius()); @@ -90,7 +90,7 @@ describe('ol.geom.Circle', function() { }); it('maintains Z coordinates', function() { - var circle = new _ol_geom_Circle_([0, 0, 1], 1); + var circle = new Circle([0, 0, 1], 1); expect(circle.getLayout()).to.be('XYZ'); var closestPoint = circle.getClosestPoint([2, 0]); expect(closestPoint).to.have.length(3); @@ -100,7 +100,7 @@ describe('ol.geom.Circle', function() { }); it('maintains M coordinates', function() { - var circle = new _ol_geom_Circle_([0, 0, 2], 1, + var circle = new Circle([0, 0, 2], 1, 'XYM'); var closestPoint = circle.getClosestPoint([2, 0]); expect(closestPoint).to.have.length(3); @@ -110,7 +110,7 @@ describe('ol.geom.Circle', function() { }); it('maintains Z and M coordinates', function() { - var circle = new _ol_geom_Circle_([0, 0, 1, 2], 1); + var circle = new Circle([0, 0, 1, 2], 1); expect(circle.getLayout()).to.be('XYZM'); var closestPoint = circle.getClosestPoint([2, 0]); expect(closestPoint).to.have.length(4); diff --git a/test/spec/ol/geom/polygon.test.js b/test/spec/ol/geom/polygon.test.js index 96e2b6d724..17a18769a9 100644 --- a/test/spec/ol/geom/polygon.test.js +++ b/test/spec/ol/geom/polygon.test.js @@ -1,5 +1,5 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js'; import Polygon from '../../../../src/ol/geom/Polygon.js'; @@ -577,7 +577,7 @@ describe('ol.geom.Polygon', function() { describe('ol.geom.Polygon.fromCircle', function() { it('creates a regular polygon', function() { - var circle = new _ol_geom_Circle_([0, 0, 0], 1, 'XYZ'); + var circle = new Circle([0, 0, 0], 1, 'XYZ'); var polygon = Polygon.fromCircle(circle); var coordinates = polygon.getLinearRing(0).getCoordinates(); expect(coordinates[0].length).to.eql(3); @@ -598,7 +598,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 circle = new Circle([0, 0], 1); var polygon = Polygon.fromCircle(circle, 4, Math.PI / 2); var coordinates = polygon.getLinearRing(0).getCoordinates(); expect(coordinates[4]).to.eql(coordinates[0]); diff --git a/test/spec/ol/interaction/draw.test.js b/test/spec/ol/interaction/draw.test.js index 3d9b86ac73..b7f63808c4 100644 --- a/test/spec/ol/interaction/draw.test.js +++ b/test/spec/ol/interaction/draw.test.js @@ -5,7 +5,7 @@ import _ol_View_ from '../../../../src/ol/View.js'; import _ol_array_ from '../../../../src/ol/array.js'; import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_condition_ from '../../../../src/ol/events/condition.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; @@ -795,7 +795,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_Circle_); + expect(geometry).to.be.a(Circle); expect(geometry.getCenter()).to.eql([10, -20]); expect(geometry.getRadius()).to.eql(20); }); diff --git a/test/spec/ol/interaction/modify.test.js b/test/spec/ol/interaction/modify.test.js index 5bb781976d..4df7366304 100644 --- a/test/spec/ol/interaction/modify.test.js +++ b/test/spec/ol/interaction/modify.test.js @@ -5,7 +5,7 @@ import _ol_MapBrowserPointerEvent_ from '../../../../src/ol/MapBrowserPointerEve import _ol_View_ from '../../../../src/ol/View.js'; import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_condition_ from '../../../../src/ol/events/condition.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import Point from '../../../../src/ol/geom/Point.js'; import Polygon from '../../../../src/ol/geom/Polygon.js'; @@ -382,7 +382,7 @@ describe('ol.interaction.Modify', function() { describe('circle modification', function() { it('changes the circle radius and center', function() { - var circleFeature = new _ol_Feature_(new _ol_geom_Circle_([10, 10], 20)); + var circleFeature = new _ol_Feature_(new Circle([10, 10], 20)); features.length = 0; features.push(circleFeature); @@ -617,7 +617,7 @@ describe('ol.interaction.Modify', function() { }); it('updates circle segment data', function() { - var feature = new _ol_Feature_(new _ol_geom_Circle_([10, 10], 20)); + var feature = new _ol_Feature_(new Circle([10, 10], 20)); features.length = 0; features.push(feature); diff --git a/test/spec/ol/interaction/snap.test.js b/test/spec/ol/interaction/snap.test.js index 8322f26eef..b7f47ec8a7 100644 --- a/test/spec/ol/interaction/snap.test.js +++ b/test/spec/ol/interaction/snap.test.js @@ -2,7 +2,7 @@ import _ol_Collection_ from '../../../../src/ol/Collection.js'; import _ol_Feature_ from '../../../../src/ol/Feature.js'; import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_View_ from '../../../../src/ol/View.js'; -import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../src/ol/geom/Circle.js'; import Point from '../../../../src/ol/geom/Point.js'; import LineString from '../../../../src/ol/geom/LineString.js'; import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.js'; @@ -109,7 +109,7 @@ describe('ol.interaction.Snap', function() { }); it('snaps to circle', function() { - var circle = new _ol_Feature_(new _ol_geom_Circle_([0, 0], 10)); + var circle = new _ol_Feature_(new Circle([0, 0], 10)); var snapInteraction = new _ol_interaction_Snap_({ features: new _ol_Collection_([circle]), pixelTolerance: 5 diff --git a/test/spec/ol/render/canvas/immediate.test.js b/test/spec/ol/render/canvas/immediate.test.js index e30e310c4f..14bddd8ca6 100644 --- a/test/spec/ol/render/canvas/immediate.test.js +++ b/test/spec/ol/render/canvas/immediate.test.js @@ -1,4 +1,4 @@ -import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../../src/ol/geom/Circle.js'; import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js'; import LineString from '../../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; @@ -154,7 +154,7 @@ describe('ol.render.canvas.Immediate', function() { var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent); sinon.spy(context, 'drawCircle'); - var geometry = new _ol_geom_Circle_([0, 0]); + var geometry = new Circle([0, 0]); context.drawGeometry(geometry); expect(context.drawCircle.calledOnce).to.be(true); diff --git a/test/spec/ol/render/webgl/circlereplay.test.js b/test/spec/ol/render/webgl/circlereplay.test.js index d35a852de6..6af996410e 100644 --- a/test/spec/ol/render/webgl/circlereplay.test.js +++ b/test/spec/ol/render/webgl/circlereplay.test.js @@ -1,6 +1,6 @@ import {getUid} from '../../../../../src/ol/index.js'; import _ol_Feature_ from '../../../../../src/ol/Feature.js'; -import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../../src/ol/geom/Circle.js'; import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js'; import _ol_render_webgl_circlereplay_defaultshader_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader.js'; import _ol_render_webgl_circlereplay_defaultshader_Locations_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader/Locations.js'; @@ -48,7 +48,7 @@ describe('ol.render.webgl.CircleReplay', function() { describe('#drawCircle', function() { it('sets the buffer data', function() { - var circle = new _ol_geom_Circle_([0, 0], 5000); + var circle = new Circle([0, 0], 5000); replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.drawCircle(circle, null); @@ -61,7 +61,7 @@ describe('ol.render.webgl.CircleReplay', function() { }); it('does not draw if radius is zero', function() { - var circle = new _ol_geom_Circle_([0, 0], 0); + var circle = new Circle([0, 0], 0); replay.drawCircle(circle, null); expect(replay.vertices).to.have.length(0); @@ -71,7 +71,7 @@ describe('ol.render.webgl.CircleReplay', function() { }); it('resets state and removes style if it belongs to a zero radius circle', function() { - var circle = new _ol_geom_Circle_([0, 0], 0); + var circle = new Circle([0, 0], 0); replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.setFillStrokeStyle(null, strokeStyle); @@ -174,13 +174,13 @@ describe('ol.render.webgl.CircleReplay', function() { describe('#drawReplay', function() { var gl, context; var feature1 = new _ol_Feature_({ - geometry: new _ol_geom_Circle_([0, 0], 5000) + geometry: new Circle([0, 0], 5000) }); var feature2 = new _ol_Feature_({ - geometry: new _ol_geom_Circle_([10, 10], 5000) + geometry: new Circle([10, 10], 5000) }); var feature3 = new _ol_Feature_({ - geometry: new _ol_geom_Circle_([20, 20], 5000) + geometry: new Circle([20, 20], 5000) }); beforeEach(function() { gl = {}; diff --git a/test/spec/ol/render/webgl/immediate.test.js b/test/spec/ol/render/webgl/immediate.test.js index 7282611401..429d00293c 100644 --- a/test/spec/ol/render/webgl/immediate.test.js +++ b/test/spec/ol/render/webgl/immediate.test.js @@ -1,5 +1,5 @@ import _ol_Feature_ from '../../../../../src/ol/Feature.js'; -import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js'; +import Circle from '../../../../../src/ol/geom/Circle.js'; import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js'; import LineString from '../../../../../src/ol/geom/LineString.js'; import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; @@ -26,7 +26,7 @@ describe('ol.render.webgl.Immediate', function() { fill: new _ol_style_Fill_(), stroke: new _ol_style_Stroke_() }); - circle = new _ol_geom_Circle_([0, 0], 5); + circle = new Circle([0, 0], 5); line = new LineString([[0, 0], [5, 5]]); multiLine = new MultiLineString([[[0, 0], [5, 5]]]); point = new Point([0, 0]); @@ -75,7 +75,7 @@ describe('ol.render.webgl.Immediate', function() { it('does nothing if geometry is out of bounds', function() { feat = new _ol_Feature_({ - geometry: new _ol_geom_Circle_([540, 540], 1) + geometry: new Circle([540, 540], 1) }); context.drawFeature(feat, style); expect(context.setStyle.called).to.be(false); diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index f741b9d5ed..c20c94f3db 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -2,7 +2,7 @@ import _ol_Map_ from '../../../src/ol/Map.js'; import _ol_View_ from '../../../src/ol/View.js'; import _ol_ViewHint_ from '../../../src/ol/ViewHint.js'; import * as _ol_extent_ from '../../../src/ol/extent.js'; -import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js'; +import Circle from '../../../src/ol/geom/Circle.js'; import LineString from '../../../src/ol/geom/LineString.js'; import Point from '../../../src/ol/geom/Point.js'; @@ -1288,7 +1288,7 @@ describe('ol.View', function() { expect(view.getCenter()[1]).to.be(46100); view.fit( - new _ol_geom_Circle_([6000, 46000], 1000), + new Circle([6000, 46000], 1000), {size: [200, 200], constrainResolution: false}); expect(view.getResolution()).to.be(10); expect(view.getCenter()[0]).to.be(6000); @@ -1296,7 +1296,7 @@ describe('ol.View', function() { view.setRotation(Math.PI / 8); view.fit( - new _ol_geom_Circle_([6000, 46000], 1000), + new Circle([6000, 46000], 1000), {size: [200, 200], constrainResolution: false}); expect(view.getResolution()).to.roughlyEqual(10, 1e-9); expect(view.getCenter()[0]).to.roughlyEqual(6000, 1e-9);