Rename _ol_proj_Units_ to Units

This commit is contained in:
Tim Schaub
2018-01-08 09:56:43 -07:00
parent a18f0590f6
commit a04144c3c2
10 changed files with 28 additions and 28 deletions

View File

@@ -4,7 +4,7 @@
import {inherits} from '../index.js';
import {cosh} from '../math.js';
import _ol_proj_Projection_ from '../proj/Projection.js';
import _ol_proj_Units_ from '../proj/Units.js';
import Units from '../proj/Units.js';
var _ol_proj_EPSG3857_ = {};
@@ -20,7 +20,7 @@ var _ol_proj_EPSG3857_ = {};
_ol_proj_EPSG3857_.Projection_ = function(code) {
_ol_proj_Projection_.call(this, {
code: code,
units: _ol_proj_Units_.METERS,
units: Units.METERS,
extent: _ol_proj_EPSG3857_.EXTENT,
global: true,
worldExtent: _ol_proj_EPSG3857_.WORLD_EXTENT,

View File

@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_proj_Projection_ from '../proj/Projection.js';
import _ol_proj_Units_ from '../proj/Units.js';
import Units from '../proj/Units.js';
var _ol_proj_EPSG4326_ = {};
@@ -24,7 +24,7 @@ var _ol_proj_EPSG4326_ = {};
_ol_proj_EPSG4326_.Projection_ = function(code, opt_axisOrientation) {
_ol_proj_Projection_.call(this, {
code: code,
units: _ol_proj_Units_.DEGREES,
units: Units.DEGREES,
extent: _ol_proj_EPSG4326_.EXTENT,
axisOrientation: opt_axisOrientation,
global: true,

View File

@@ -1,7 +1,7 @@
/**
* @module ol/proj/Projection
*/
import _ol_proj_Units_ from '../proj/Units.js';
import Units from '../proj/Units.js';
/**
* @classdesc
@@ -153,7 +153,7 @@ _ol_proj_Projection_.prototype.getUnits = function() {
* @api
*/
_ol_proj_Projection_.prototype.getMetersPerUnit = function() {
return this.metersPerUnit_ || _ol_proj_Units_.METERS_PER_UNIT[this.units_];
return this.metersPerUnit_ || Units.METERS_PER_UNIT[this.units_];
};

View File

@@ -6,7 +6,7 @@
* `'us-ft'`.
* @enum {string}
*/
var _ol_proj_Units_ = {
var Units = {
DEGREES: 'degrees',
FEET: 'ft',
METERS: 'm',
@@ -22,11 +22,11 @@ var _ol_proj_Units_ = {
* @type {Object.<ol.proj.Units, number>}
* @api
*/
_ol_proj_Units_.METERS_PER_UNIT = {};
Units.METERS_PER_UNIT = {};
// use the radius of the Normal sphere
_ol_proj_Units_.METERS_PER_UNIT[_ol_proj_Units_.DEGREES] =
Units.METERS_PER_UNIT[Units.DEGREES] =
2 * Math.PI * 6370997 / 360;
_ol_proj_Units_.METERS_PER_UNIT[_ol_proj_Units_.FEET] = 0.3048;
_ol_proj_Units_.METERS_PER_UNIT[_ol_proj_Units_.METERS] = 1;
_ol_proj_Units_.METERS_PER_UNIT[_ol_proj_Units_.USFEET] = 1200 / 3937;
export default _ol_proj_Units_;
Units.METERS_PER_UNIT[Units.FEET] = 0.3048;
Units.METERS_PER_UNIT[Units.METERS] = 1;
Units.METERS_PER_UNIT[Units.USFEET] = 1200 / 3937;
export default Units;