Remove ol.sphere.WGS84
This commit is contained in:
+19
-15
@@ -101,22 +101,26 @@
|
|||||||
"openlayers-internal/requires-first": 2,
|
"openlayers-internal/requires-first": 2,
|
||||||
"openlayers-internal/valid-provide": 2,
|
"openlayers-internal/valid-provide": 2,
|
||||||
"openlayers-internal/valid-requires": 2,
|
"openlayers-internal/valid-requires": 2,
|
||||||
"indent": [2, 2, {
|
"indent": [
|
||||||
"VariableDeclarator": 2,
|
2,
|
||||||
"SwitchCase": 1,
|
2,
|
||||||
"MemberExpression": 2,
|
{
|
||||||
"FunctionDeclaration": {
|
"VariableDeclarator": 2,
|
||||||
"parameters": 2,
|
"SwitchCase": 1,
|
||||||
"body": 1
|
"MemberExpression": 2,
|
||||||
},
|
"FunctionDeclaration": {
|
||||||
"FunctionExpression": {
|
"parameters": 2,
|
||||||
"parameters": 2,
|
"body": 1
|
||||||
"body": 1
|
},
|
||||||
},
|
"FunctionExpression": {
|
||||||
"CallExpression": {
|
"parameters": 2,
|
||||||
"arguments": 2
|
"body": 1
|
||||||
|
},
|
||||||
|
"CallExpression": {
|
||||||
|
"arguments": 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ext": [
|
"ext": [
|
||||||
|
|||||||
+10
-3
@@ -3,15 +3,16 @@
|
|||||||
goog.provide('ol.Geolocation');
|
goog.provide('ol.Geolocation');
|
||||||
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.Object');
|
|
||||||
goog.require('ol.GeolocationProperty');
|
goog.require('ol.GeolocationProperty');
|
||||||
|
goog.require('ol.Object');
|
||||||
|
goog.require('ol.Sphere');
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.events.EventType');
|
goog.require('ol.events.EventType');
|
||||||
goog.require('ol.geom.Polygon');
|
goog.require('ol.geom.Polygon');
|
||||||
goog.require('ol.has');
|
goog.require('ol.has');
|
||||||
goog.require('ol.math');
|
goog.require('ol.math');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.sphere.WGS84');
|
goog.require('ol.proj.EPSG4326');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,6 +60,12 @@ ol.Geolocation = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.transform_ = ol.proj.identityTransform;
|
this.transform_ = ol.proj.identityTransform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {ol.Sphere}
|
||||||
|
*/
|
||||||
|
this.sphere_ = new ol.Sphere(ol.proj.EPSG4326.RADIUS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
@@ -154,7 +161,7 @@ ol.Geolocation.prototype.positionChange_ = function(position) {
|
|||||||
this.set(ol.GeolocationProperty.SPEED,
|
this.set(ol.GeolocationProperty.SPEED,
|
||||||
coords.speed === null ? undefined : coords.speed);
|
coords.speed === null ? undefined : coords.speed);
|
||||||
var geometry = ol.geom.Polygon.circular(
|
var geometry = ol.geom.Polygon.circular(
|
||||||
ol.sphere.WGS84, this.position_, coords.accuracy);
|
this.sphere_, this.position_, coords.accuracy);
|
||||||
geometry.applyTransform(this.transform_);
|
geometry.applyTransform(this.transform_);
|
||||||
this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
||||||
this.changed();
|
this.changed();
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
goog.provide('ol.sphere.WGS84');
|
|
||||||
|
|
||||||
goog.require('ol.Sphere');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A sphere with radius equal to the semi-major axis of the WGS84 ellipsoid.
|
|
||||||
* @const
|
|
||||||
* @type {ol.Sphere}
|
|
||||||
*/
|
|
||||||
ol.sphere.WGS84 = new ol.Sphere(6378137);
|
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
goog.provide('ol.test.Sphere');
|
goog.provide('ol.test.Sphere');
|
||||||
|
|
||||||
goog.require('ol.Sphere');
|
goog.require('ol.Sphere');
|
||||||
goog.require('ol.sphere.WGS84');
|
|
||||||
goog.require('ol.format.WKT');
|
goog.require('ol.format.WKT');
|
||||||
|
goog.require('ol.proj.EPSG4326');
|
||||||
|
|
||||||
|
|
||||||
describe('ol.Sphere', function() {
|
describe('ol.Sphere', function() {
|
||||||
@@ -102,7 +102,8 @@ describe('ol.Sphere', function() {
|
|||||||
|
|
||||||
it('results match the expected area of Ilinois', function() {
|
it('results match the expected area of Ilinois', function() {
|
||||||
var coords = geometry.getPolygon(0).getLinearRing(0).getCoordinates();
|
var coords = geometry.getPolygon(0).getLinearRing(0).getCoordinates();
|
||||||
expect(ol.sphere.WGS84.geodesicArea(coords)).to.equal(145978332359.37125);
|
var sphere = new ol.Sphere(ol.proj.EPSG4326.RADIUS);
|
||||||
|
expect(sphere.geodesicArea(coords)).to.equal(145978332359.37125);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user