Replace ol/Sphere with ol/sphere

This commit is contained in:
Tim Schaub
2017-12-20 08:44:01 -08:00
parent 43342cd133
commit 54b8622114
9 changed files with 330 additions and 402 deletions
+1 -10
View File
@@ -4,14 +4,12 @@
import {inherits} from './index.js';
import _ol_GeolocationProperty_ from './GeolocationProperty.js';
import _ol_Object_ from './Object.js';
import _ol_Sphere_ from './Sphere.js';
import _ol_events_ from './events.js';
import EventType from './events/EventType.js';
import Polygon from './geom/Polygon.js';
import _ol_has_ from './has.js';
import {toRadians} from './math.js';
import {get as getProjection, getTransformFromProjections, identityTransform} from './proj.js';
import _ol_proj_EPSG4326_ from './proj/EPSG4326.js';
/**
@@ -74,12 +72,6 @@ var Geolocation = function(opt_options) {
*/
this.transform_ = identityTransform;
/**
* @private
* @type {ol.Sphere}
*/
this.sphere_ = new _ol_Sphere_(_ol_proj_EPSG4326_.RADIUS);
/**
* @private
* @type {number|undefined}
@@ -175,8 +167,7 @@ Geolocation.prototype.positionChange_ = function(position) {
this.set(_ol_GeolocationProperty_.POSITION, projectedPosition);
this.set(_ol_GeolocationProperty_.SPEED,
coords.speed === null ? undefined : coords.speed);
var geometry = Polygon.circular(
this.sphere_, this.position_, coords.accuracy);
var geometry = Polygon.circular(this.position_, coords.accuracy);
geometry.applyTransform(this.transform_);
this.set(_ol_GeolocationProperty_.ACCURACY_GEOMETRY, geometry);
this.changed();