Rename _ol_geom_Circle_ to Circle

This commit is contained in:
Tim Schaub
2017-12-14 08:57:52 -07:00
parent 9d396280b0
commit ac7985a5ad
15 changed files with 62 additions and 62 deletions

View File

@@ -3,7 +3,7 @@ import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js'; import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js'; import _ol_control_ from '../src/ol/control.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.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_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js'; import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.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) 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_({ var vectorLayer = new _ol_layer_Vector_({
source: vectorSource, source: vectorSource,

View File

@@ -19,13 +19,13 @@ import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api
*/ */
var _ol_geom_Circle_ = function(center, opt_radius, opt_layout) { var Circle = function(center, opt_radius, opt_layout) {
_ol_geom_SimpleGeometry_.call(this); _ol_geom_SimpleGeometry_.call(this);
var radius = opt_radius ? opt_radius : 0; var radius = opt_radius ? opt_radius : 0;
this.setCenterAndRadius(center, radius, opt_layout); 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 * @override
* @api * @api
*/ */
_ol_geom_Circle_.prototype.clone = function() { Circle.prototype.clone = function() {
var circle = new _ol_geom_Circle_(null); var circle = new Circle(null);
circle.setFlatCoordinates(this.layout, this.flatCoordinates.slice()); circle.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
return circle; return circle;
}; };
@@ -44,7 +44,7 @@ _ol_geom_Circle_.prototype.clone = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_geom_Circle_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) { Circle.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
var flatCoordinates = this.flatCoordinates; var flatCoordinates = this.flatCoordinates;
var dx = x - flatCoordinates[0]; var dx = x - flatCoordinates[0];
var dy = y - flatCoordinates[1]; var dy = y - flatCoordinates[1];
@@ -74,7 +74,7 @@ _ol_geom_Circle_.prototype.closestPointXY = function(x, y, closestPoint, minSqua
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_geom_Circle_.prototype.containsXY = function(x, y) { Circle.prototype.containsXY = function(x, y) {
var flatCoordinates = this.flatCoordinates; var flatCoordinates = this.flatCoordinates;
var dx = x - flatCoordinates[0]; var dx = x - flatCoordinates[0];
var dy = y - flatCoordinates[1]; var dy = y - flatCoordinates[1];
@@ -87,7 +87,7 @@ _ol_geom_Circle_.prototype.containsXY = function(x, y) {
* @return {ol.Coordinate} Center. * @return {ol.Coordinate} Center.
* @api * @api
*/ */
_ol_geom_Circle_.prototype.getCenter = function() { Circle.prototype.getCenter = function() {
return this.flatCoordinates.slice(0, this.stride); return this.flatCoordinates.slice(0, this.stride);
}; };
@@ -95,7 +95,7 @@ _ol_geom_Circle_.prototype.getCenter = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_geom_Circle_.prototype.computeExtent = function(extent) { Circle.prototype.computeExtent = function(extent) {
var flatCoordinates = this.flatCoordinates; var flatCoordinates = this.flatCoordinates;
var radius = flatCoordinates[this.stride] - flatCoordinates[0]; var radius = flatCoordinates[this.stride] - flatCoordinates[0];
return createOrUpdate( return createOrUpdate(
@@ -110,7 +110,7 @@ _ol_geom_Circle_.prototype.computeExtent = function(extent) {
* @return {number} Radius. * @return {number} Radius.
* @api * @api
*/ */
_ol_geom_Circle_.prototype.getRadius = function() { Circle.prototype.getRadius = function() {
return Math.sqrt(this.getRadiusSquared_()); return Math.sqrt(this.getRadiusSquared_());
}; };
@@ -119,7 +119,7 @@ _ol_geom_Circle_.prototype.getRadius = function() {
* @private * @private
* @return {number} Radius squared. * @return {number} Radius squared.
*/ */
_ol_geom_Circle_.prototype.getRadiusSquared_ = function() { Circle.prototype.getRadiusSquared_ = function() {
var dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0]; var dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];
var dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1]; var dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];
return dx * dx + dy * dy; return dx * dx + dy * dy;
@@ -130,7 +130,7 @@ _ol_geom_Circle_.prototype.getRadiusSquared_ = function() {
* @inheritDoc * @inheritDoc
* @api * @api
*/ */
_ol_geom_Circle_.prototype.getType = function() { Circle.prototype.getType = function() {
return _ol_geom_GeometryType_.CIRCLE; return _ol_geom_GeometryType_.CIRCLE;
}; };
@@ -139,7 +139,7 @@ _ol_geom_Circle_.prototype.getType = function() {
* @inheritDoc * @inheritDoc
* @api * @api
*/ */
_ol_geom_Circle_.prototype.intersectsExtent = function(extent) { Circle.prototype.intersectsExtent = function(extent) {
var circleExtent = this.getExtent(); var circleExtent = this.getExtent();
if (intersects(extent, circleExtent)) { if (intersects(extent, circleExtent)) {
var center = this.getCenter(); var center = this.getCenter();
@@ -163,7 +163,7 @@ _ol_geom_Circle_.prototype.intersectsExtent = function(extent) {
* @param {ol.Coordinate} center Center. * @param {ol.Coordinate} center Center.
* @api * @api
*/ */
_ol_geom_Circle_.prototype.setCenter = function(center) { Circle.prototype.setCenter = function(center) {
var stride = this.stride; var stride = this.stride;
var radius = this.flatCoordinates[stride] - this.flatCoordinates[0]; var radius = this.flatCoordinates[stride] - this.flatCoordinates[0];
var flatCoordinates = center.slice(); var flatCoordinates = center.slice();
@@ -184,7 +184,7 @@ _ol_geom_Circle_.prototype.setCenter = function(center) {
* @param {ol.geom.GeometryLayout=} opt_layout Layout. * @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api * @api
*/ */
_ol_geom_Circle_.prototype.setCenterAndRadius = function(center, radius, opt_layout) { Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
if (!center) { if (!center) {
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null); this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
} else { } else {
@@ -210,20 +210,20 @@ _ol_geom_Circle_.prototype.setCenterAndRadius = function(center, radius, opt_lay
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_geom_Circle_.prototype.getCoordinates = function() {}; Circle.prototype.getCoordinates = function() {};
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_geom_Circle_.prototype.setCoordinates = function(coordinates, opt_layout) {}; Circle.prototype.setCoordinates = function(coordinates, opt_layout) {};
/** /**
* @param {ol.geom.GeometryLayout} layout Layout. * @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates. * @param {Array.<number>} flatCoordinates Flat coordinates.
*/ */
_ol_geom_Circle_.prototype.setFlatCoordinates = function(layout, flatCoordinates) { Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates); this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.changed(); this.changed();
}; };
@@ -234,7 +234,7 @@ _ol_geom_Circle_.prototype.setFlatCoordinates = function(layout, flatCoordinates
* @param {number} radius Radius. * @param {number} radius Radius.
* @api * @api
*/ */
_ol_geom_Circle_.prototype.setRadius = function(radius) { Circle.prototype.setRadius = function(radius) {
this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius; this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;
this.changed(); this.changed();
}; };
@@ -262,5 +262,5 @@ _ol_geom_Circle_.prototype.setRadius = function(radius) {
* @function * @function
* @api * @api
*/ */
_ol_geom_Circle_.prototype.transform; Circle.prototype.transform;
export default _ol_geom_Circle_; export default Circle;

View File

@@ -11,7 +11,7 @@ import _ol_events_Event_ from '../events/Event.js';
import _ol_events_condition_ from '../events/condition.js'; import _ol_events_condition_ from '../events/condition.js';
import {boundingExtent, getBottomLeft, getBottomRight, getTopLeft, getTopRight} from '../extent.js'; import {boundingExtent, getBottomLeft, getBottomRight, getTopLeft, getTopRight} from '../extent.js';
import _ol_functions_ from '../functions.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 _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import LineString from '../geom/LineString.js'; import LineString from '../geom/LineString.js';
import MultiLineString from '../geom/MultiLineString.js'; import MultiLineString from '../geom/MultiLineString.js';
@@ -142,7 +142,7 @@ var _ol_interaction_Draw_ = function(options) {
*/ */
geometryFunction = function(coordinates, opt_geometry) { geometryFunction = function(coordinates, opt_geometry) {
var circle = opt_geometry ? /** @type {ol.geom.Circle} */ (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( var squaredLength = _ol_coordinate_.squaredDistance(
coordinates[0], coordinates[1]); coordinates[0], coordinates[1]);
circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength)); circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength));
@@ -798,7 +798,7 @@ _ol_interaction_Draw_.createRegularPolygon = function(opt_sides, opt_angle) {
var radius = Math.sqrt( var radius = Math.sqrt(
_ol_coordinate_.squaredDistance(center, end)); _ol_coordinate_.squaredDistance(center, end));
var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) : 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 : var angle = opt_angle ? opt_angle :
Math.atan((end[1] - center[1]) / (end[0] - center[0])); Math.atan((end[1] - center[1]) / (end[0] - center[0]));
Polygon.makeRegular(geometry, center, radius, angle); Polygon.makeRegular(geometry, center, radius, angle);

View File

@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js'; import _ol_View_ from '../../../../src/ol/View.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.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 LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js'; import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js'; import Polygon from '../../../../src/ol/geom/Polygon.js';
@@ -42,7 +42,7 @@ describe('ol.rendering.layer.Vector', function() {
var source; var source;
function addCircle(r) { 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) { function addPolygon(r) {

View File

@@ -1,5 +1,5 @@
import _ol_coordinate_ from '../../../src/ol/coordinate.js'; 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() { describe('ol.coordinate', function() {
@@ -90,7 +90,7 @@ describe('ol.coordinate', function() {
describe('#closestOnCircle', function() { describe('#closestOnCircle', function() {
var center = [5, 10]; 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() { it('can find the closest point on circle', function() {
expect(_ol_coordinate_.closestOnCircle([-20, 10], circle)) expect(_ol_coordinate_.closestOnCircle([-20, 10], circle))
.to.eql([-5, 10]); .to.eql([-5, 10]);

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js'; import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js'; import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.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 _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../src/ol/geom/LineString.js'; import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.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() { 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); var geojson = format.writeGeometryObject(circle);
expect(geojson).to.eql({ expect(geojson).to.eql({
'type': 'GeometryCollection', 'type': 'GeometryCollection',

View File

@@ -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() { describe('ol.geom.Circle', function() {
@@ -7,14 +7,14 @@ describe('ol.geom.Circle', function() {
var circle; var circle;
beforeEach(function() { beforeEach(function() {
circle = new _ol_geom_Circle_([0, 0], 1); circle = new Circle([0, 0], 1);
}); });
describe('#clone', function() { describe('#clone', function() {
it('returns a clone', function() { it('returns a clone', function() {
var clone = circle.clone(); 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()).to.eql(circle.getCenter());
expect(clone.getCenter()).not.to.be(circle.getCenter()); expect(clone.getCenter()).not.to.be(circle.getCenter());
expect(clone.getRadius()).to.be(circle.getRadius()); expect(clone.getRadius()).to.be(circle.getRadius());
@@ -90,7 +90,7 @@ describe('ol.geom.Circle', function() {
}); });
it('maintains Z coordinates', 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'); expect(circle.getLayout()).to.be('XYZ');
var closestPoint = circle.getClosestPoint([2, 0]); var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(3); expect(closestPoint).to.have.length(3);
@@ -100,7 +100,7 @@ describe('ol.geom.Circle', function() {
}); });
it('maintains M coordinates', 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'); 'XYM');
var closestPoint = circle.getClosestPoint([2, 0]); var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(3); expect(closestPoint).to.have.length(3);
@@ -110,7 +110,7 @@ describe('ol.geom.Circle', function() {
}); });
it('maintains Z and M coordinates', 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'); expect(circle.getLayout()).to.be('XYZM');
var closestPoint = circle.getClosestPoint([2, 0]); var closestPoint = circle.getClosestPoint([2, 0]);
expect(closestPoint).to.have.length(4); expect(closestPoint).to.have.length(4);

View File

@@ -1,5 +1,5 @@
import * as _ol_extent_ from '../../../../src/ol/extent.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 _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js'; import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import Polygon from '../../../../src/ol/geom/Polygon.js'; import Polygon from '../../../../src/ol/geom/Polygon.js';
@@ -577,7 +577,7 @@ describe('ol.geom.Polygon', function() {
describe('ol.geom.Polygon.fromCircle', function() { describe('ol.geom.Polygon.fromCircle', function() {
it('creates a regular polygon', 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 polygon = Polygon.fromCircle(circle);
var coordinates = polygon.getLinearRing(0).getCoordinates(); var coordinates = polygon.getLinearRing(0).getCoordinates();
expect(coordinates[0].length).to.eql(3); 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() { 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 polygon = Polygon.fromCircle(circle, 4, Math.PI / 2);
var coordinates = polygon.getLinearRing(0).getCoordinates(); var coordinates = polygon.getLinearRing(0).getCoordinates();
expect(coordinates[4]).to.eql(coordinates[0]); expect(coordinates[4]).to.eql(coordinates[0]);

View File

@@ -5,7 +5,7 @@ import _ol_View_ from '../../../../src/ol/View.js';
import _ol_array_ from '../../../../src/ol/array.js'; import _ol_array_ from '../../../../src/ol/array.js';
import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.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 LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js'; import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js'; import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -795,7 +795,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures(); var features = source.getFeatures();
expect(features).to.have.length(1); expect(features).to.have.length(1);
var geometry = features[0].getGeometry(); 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.getCenter()).to.eql([10, -20]);
expect(geometry.getRadius()).to.eql(20); expect(geometry.getRadius()).to.eql(20);
}); });

View File

@@ -5,7 +5,7 @@ import _ol_MapBrowserPointerEvent_ from '../../../../src/ol/MapBrowserPointerEve
import _ol_View_ from '../../../../src/ol/View.js'; import _ol_View_ from '../../../../src/ol/View.js';
import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.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 LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js'; import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js'; import Polygon from '../../../../src/ol/geom/Polygon.js';
@@ -382,7 +382,7 @@ describe('ol.interaction.Modify', function() {
describe('circle modification', function() { describe('circle modification', function() {
it('changes the circle radius and center', 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.length = 0;
features.push(circleFeature); features.push(circleFeature);
@@ -617,7 +617,7 @@ describe('ol.interaction.Modify', function() {
}); });
it('updates circle segment data', 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.length = 0;
features.push(feature); features.push(feature);

View File

@@ -2,7 +2,7 @@ import _ol_Collection_ from '../../../../src/ol/Collection.js';
import _ol_Feature_ from '../../../../src/ol/Feature.js'; import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.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 Point from '../../../../src/ol/geom/Point.js';
import LineString from '../../../../src/ol/geom/LineString.js'; import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.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() { 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_({ var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([circle]), features: new _ol_Collection_([circle]),
pixelTolerance: 5 pixelTolerance: 5

View File

@@ -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 _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../../src/ol/geom/LineString.js'; import LineString from '../../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.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); var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
sinon.spy(context, 'drawCircle'); sinon.spy(context, 'drawCircle');
var geometry = new _ol_geom_Circle_([0, 0]); var geometry = new Circle([0, 0]);
context.drawGeometry(geometry); context.drawGeometry(geometry);
expect(context.drawCircle.calledOnce).to.be(true); expect(context.drawCircle.calledOnce).to.be(true);

View File

@@ -1,6 +1,6 @@
import {getUid} from '../../../../../src/ol/index.js'; import {getUid} from '../../../../../src/ol/index.js';
import _ol_Feature_ from '../../../../../src/ol/Feature.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_ 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_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader.js';
import _ol_render_webgl_circlereplay_defaultshader_Locations_ from '../../../../../src/ol/render/webgl/circlereplay/defaultshader/Locations.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() { describe('#drawCircle', function() {
it('sets the buffer data', 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.setFillStrokeStyle(fillStyle, strokeStyle);
replay.drawCircle(circle, null); replay.drawCircle(circle, null);
@@ -61,7 +61,7 @@ describe('ol.render.webgl.CircleReplay', function() {
}); });
it('does not draw if radius is zero', 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); replay.drawCircle(circle, null);
expect(replay.vertices).to.have.length(0); 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() { 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(fillStyle, strokeStyle);
replay.setFillStrokeStyle(null, strokeStyle); replay.setFillStrokeStyle(null, strokeStyle);
@@ -174,13 +174,13 @@ describe('ol.render.webgl.CircleReplay', function() {
describe('#drawReplay', function() { describe('#drawReplay', function() {
var gl, context; var gl, context;
var feature1 = new _ol_Feature_({ var feature1 = new _ol_Feature_({
geometry: new _ol_geom_Circle_([0, 0], 5000) geometry: new Circle([0, 0], 5000)
}); });
var feature2 = new _ol_Feature_({ var feature2 = new _ol_Feature_({
geometry: new _ol_geom_Circle_([10, 10], 5000) geometry: new Circle([10, 10], 5000)
}); });
var feature3 = new _ol_Feature_({ var feature3 = new _ol_Feature_({
geometry: new _ol_geom_Circle_([20, 20], 5000) geometry: new Circle([20, 20], 5000)
}); });
beforeEach(function() { beforeEach(function() {
gl = {}; gl = {};

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../../src/ol/Feature.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_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js'; import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../../src/ol/geom/LineString.js'; import LineString from '../../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js'; import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
@@ -26,7 +26,7 @@ describe('ol.render.webgl.Immediate', function() {
fill: new _ol_style_Fill_(), fill: new _ol_style_Fill_(),
stroke: new _ol_style_Stroke_() 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]]); line = new LineString([[0, 0], [5, 5]]);
multiLine = new MultiLineString([[[0, 0], [5, 5]]]); multiLine = new MultiLineString([[[0, 0], [5, 5]]]);
point = new Point([0, 0]); 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() { it('does nothing if geometry is out of bounds', function() {
feat = new _ol_Feature_({ feat = new _ol_Feature_({
geometry: new _ol_geom_Circle_([540, 540], 1) geometry: new Circle([540, 540], 1)
}); });
context.drawFeature(feat, style); context.drawFeature(feat, style);
expect(context.setStyle.called).to.be(false); expect(context.setStyle.called).to.be(false);

View File

@@ -2,7 +2,7 @@ import _ol_Map_ from '../../../src/ol/Map.js';
import _ol_View_ from '../../../src/ol/View.js'; import _ol_View_ from '../../../src/ol/View.js';
import _ol_ViewHint_ from '../../../src/ol/ViewHint.js'; import _ol_ViewHint_ from '../../../src/ol/ViewHint.js';
import * as _ol_extent_ from '../../../src/ol/extent.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 LineString from '../../../src/ol/geom/LineString.js';
import Point from '../../../src/ol/geom/Point.js'; import Point from '../../../src/ol/geom/Point.js';
@@ -1288,7 +1288,7 @@ describe('ol.View', function() {
expect(view.getCenter()[1]).to.be(46100); expect(view.getCenter()[1]).to.be(46100);
view.fit( view.fit(
new _ol_geom_Circle_([6000, 46000], 1000), new Circle([6000, 46000], 1000),
{size: [200, 200], constrainResolution: false}); {size: [200, 200], constrainResolution: false});
expect(view.getResolution()).to.be(10); expect(view.getResolution()).to.be(10);
expect(view.getCenter()[0]).to.be(6000); expect(view.getCenter()[0]).to.be(6000);
@@ -1296,7 +1296,7 @@ describe('ol.View', function() {
view.setRotation(Math.PI / 8); view.setRotation(Math.PI / 8);
view.fit( view.fit(
new _ol_geom_Circle_([6000, 46000], 1000), new Circle([6000, 46000], 1000),
{size: [200, 200], constrainResolution: false}); {size: [200, 200], constrainResolution: false});
expect(view.getResolution()).to.roughlyEqual(10, 1e-9); expect(view.getResolution()).to.roughlyEqual(10, 1e-9);
expect(view.getCenter()[0]).to.roughlyEqual(6000, 1e-9); expect(view.getCenter()[0]).to.roughlyEqual(6000, 1e-9);