Remove ol.sphere.NORMAL

This commit is contained in:
Tim Schaub
2017-07-11 08:10:46 -06:00
parent 2e903c0293
commit fa71593a2a
2 changed files with 11 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
goog.provide('ol.proj'); goog.provide('ol.proj');
goog.require('ol'); goog.require('ol');
goog.require('ol.Sphere');
goog.require('ol.extent'); goog.require('ol.extent');
goog.require('ol.proj.EPSG3857'); goog.require('ol.proj.EPSG3857');
goog.require('ol.proj.EPSG4326'); goog.require('ol.proj.EPSG4326');
@@ -9,7 +10,6 @@ goog.require('ol.proj.Units');
goog.require('ol.proj.proj4'); goog.require('ol.proj.proj4');
goog.require('ol.proj.projections'); goog.require('ol.proj.projections');
goog.require('ol.proj.transforms'); goog.require('ol.proj.transforms');
goog.require('ol.sphere.NORMAL');
/** /**
@@ -21,6 +21,14 @@ goog.require('ol.sphere.NORMAL');
ol.proj.METERS_PER_UNIT = ol.proj.Units.METERS_PER_UNIT; ol.proj.METERS_PER_UNIT = ol.proj.Units.METERS_PER_UNIT;
/**
* A place to store the radius of the Clarke 1866 Authalic Sphere.
* @private
* @type {ol.Sphere}
*/
ol.proj.AUTHALIC_SPHERE_ = new ol.Sphere(6370997);
if (ol.ENABLE_PROJ4JS) { if (ol.ENABLE_PROJ4JS) {
/** /**
* Register proj4. If not explicitly registered, it will be assumed that * Register proj4. If not explicitly registered, it will be assumed that
@@ -80,9 +88,9 @@ ol.proj.getPointResolution = function(projection, resolution, point) {
point[0], point[1] + resolution / 2 point[0], point[1] + resolution / 2
]; ];
vertices = toEPSG4326(vertices, vertices, 2); vertices = toEPSG4326(vertices, vertices, 2);
var width = ol.sphere.NORMAL.haversineDistance( var width = ol.proj.AUTHALIC_SPHERE_.haversineDistance(
vertices.slice(0, 2), vertices.slice(2, 4)); vertices.slice(0, 2), vertices.slice(2, 4));
var height = ol.sphere.NORMAL.haversineDistance( var height = ol.proj.AUTHALIC_SPHERE_.haversineDistance(
vertices.slice(4, 6), vertices.slice(6, 8)); vertices.slice(4, 6), vertices.slice(6, 8));
pointResolution = (width + height) / 2; pointResolution = (width + height) / 2;
var metersPerUnit = projection.getMetersPerUnit(); var metersPerUnit = projection.getMetersPerUnit();

View File

@@ -1,11 +0,0 @@
goog.provide('ol.sphere.NORMAL');
goog.require('ol.Sphere');
/**
* The normal sphere.
* @const
* @type {ol.Sphere}
*/
ol.sphere.NORMAL = new ol.Sphere(6370997);