Rename ol.ProjectionUnits to ol.proj.Units
This commit is contained in:
@@ -4,11 +4,11 @@ goog.provide('ol.proj.EPSG21781');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.ProjectionUnits');
|
||||
goog.require('ol.ellipsoid.BESSEL1841');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.EPSG4326');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.proj.Units');
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ ol.proj.CH = function(options) {
|
||||
code: options.code,
|
||||
extent: options.extent,
|
||||
global: false,
|
||||
units: ol.ProjectionUnits.METERS
|
||||
units: ol.proj.Units.METERS
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.proj.CH, ol.proj.Projection);
|
||||
|
||||
@@ -2,10 +2,10 @@ goog.provide('ol.proj.EPSG3857');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.ProjectionUnits');
|
||||
goog.require('ol.math');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.proj.Units');
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ goog.require('ol.proj.Projection');
|
||||
ol.proj.EPSG3857 = function(code) {
|
||||
goog.base(this, {
|
||||
code: code,
|
||||
units: ol.ProjectionUnits.METERS,
|
||||
units: ol.proj.Units.METERS,
|
||||
extent: ol.proj.EPSG3857.EXTENT,
|
||||
global: true
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
goog.provide('ol.proj.EPSG4326');
|
||||
|
||||
goog.require('ol.ProjectionUnits');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.proj.Units');
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.proj.Projection');
|
||||
ol.proj.EPSG4326 = function(code, opt_axisOrientation) {
|
||||
goog.base(this, {
|
||||
code: code,
|
||||
units: ol.ProjectionUnits.DEGREES,
|
||||
units: ol.proj.Units.DEGREES,
|
||||
extent: ol.proj.EPSG4326.EXTENT,
|
||||
axisOrientation: opt_axisOrientation,
|
||||
global: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.ProjectionUnits');
|
||||
goog.provide('ol.proj');
|
||||
goog.provide('ol.proj.Projection');
|
||||
goog.provide('ol.proj.ProjectionLike');
|
||||
goog.provide('ol.proj.Units');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.asserts');
|
||||
@@ -35,7 +35,7 @@ ol.proj.ProjectionLike;
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.ProjectionUnits = {
|
||||
ol.proj.Units = {
|
||||
DEGREES: 'degrees',
|
||||
FEET: 'ft',
|
||||
METERS: 'm'
|
||||
@@ -43,13 +43,13 @@ ol.ProjectionUnits = {
|
||||
|
||||
|
||||
/**
|
||||
* @const {Object.<ol.ProjectionUnits, number>} Meters per unit lookup table.
|
||||
* @const {Object.<ol.proj.Units, number>} Meters per unit lookup table.
|
||||
*/
|
||||
ol.METERS_PER_UNIT = {};
|
||||
ol.METERS_PER_UNIT[ol.ProjectionUnits.DEGREES] =
|
||||
ol.METERS_PER_UNIT[ol.proj.Units.DEGREES] =
|
||||
2 * Math.PI * ol.sphere.NORMAL.radius / 360;
|
||||
ol.METERS_PER_UNIT[ol.ProjectionUnits.FEET] = 0.3048;
|
||||
ol.METERS_PER_UNIT[ol.ProjectionUnits.METERS] = 1;
|
||||
ol.METERS_PER_UNIT[ol.proj.Units.FEET] = 0.3048;
|
||||
ol.METERS_PER_UNIT[ol.proj.Units.METERS] = 1;
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ ol.proj.Projection = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.ProjectionUnits}
|
||||
* @type {ol.proj.Units}
|
||||
*/
|
||||
this.units_ = options.units;
|
||||
|
||||
@@ -132,7 +132,7 @@ ol.proj.Projection.prototype.getPointResolution = goog.abstractMethod;
|
||||
|
||||
/**
|
||||
* Get the units of this projection.
|
||||
* @return {ol.ProjectionUnits} Units.
|
||||
* @return {ol.proj.Units} Units.
|
||||
*/
|
||||
ol.proj.Projection.prototype.getUnits = function() {
|
||||
return this.units_;
|
||||
@@ -199,7 +199,7 @@ ol.proj.Projection.prototype.setDefaultTileGrid = function(tileGrid) {
|
||||
*/
|
||||
ol.Proj4jsProjection_ = function(proj4jsProj, options) {
|
||||
|
||||
var units = /** @type {ol.ProjectionUnits} */ (proj4jsProj.units);
|
||||
var units = /** @type {ol.proj.Units} */ (proj4jsProj.units);
|
||||
|
||||
var config = /** @type {ol.ProjectionOptions} */ ({
|
||||
units: units,
|
||||
@@ -242,7 +242,7 @@ ol.Proj4jsProjection_.prototype.getMetersPerUnit = function() {
|
||||
*/
|
||||
ol.Proj4jsProjection_.prototype.getPointResolution =
|
||||
function(resolution, point) {
|
||||
if (this.getUnits() == ol.ProjectionUnits.DEGREES) {
|
||||
if (this.getUnits() == ol.proj.Units.DEGREES) {
|
||||
return resolution;
|
||||
} else {
|
||||
// Estimate point resolution by transforming the center pixel to EPSG:4326,
|
||||
@@ -267,7 +267,7 @@ ol.Proj4jsProjection_.prototype.getPointResolution =
|
||||
var height = ol.sphere.NORMAL.haversineDistance(
|
||||
vertices.slice(4, 6), vertices.slice(6, 8));
|
||||
var pointResolution = (width + height) / 2;
|
||||
if (this.getUnits() == ol.ProjectionUnits.FEET) {
|
||||
if (this.getUnits() == ol.proj.Units.FEET) {
|
||||
// The radius of the normal sphere is defined in meters, so we must
|
||||
// convert back to feet.
|
||||
pointResolution /= 0.3048;
|
||||
|
||||
Reference in New Issue
Block a user