Remove ol.proj dependency from EPSG3857 and EPSG4326

This commit is contained in:
Tim Schaub
2017-03-27 09:47:03 -06:00
parent 1316513a1e
commit 03700c0f01
2 changed files with 13 additions and 15 deletions
+3 -4
View File
@@ -2,7 +2,6 @@ goog.provide('ol.proj.EPSG3857');
goog.require('ol'); goog.require('ol');
goog.require('ol.math'); goog.require('ol.math');
goog.require('ol.proj');
goog.require('ol.proj.Projection'); goog.require('ol.proj.Projection');
goog.require('ol.proj.Units'); goog.require('ol.proj.Units');
@@ -16,7 +15,7 @@ goog.require('ol.proj.Units');
* @param {string} code Code. * @param {string} code Code.
* @private * @private
*/ */
ol.proj.EPSG3857_ = function(code) { ol.proj.EPSG3857.Projection_ = function(code) {
ol.proj.Projection.call(this, { ol.proj.Projection.call(this, {
code: code, code: code,
units: ol.proj.Units.METERS, units: ol.proj.Units.METERS,
@@ -28,7 +27,7 @@ ol.proj.EPSG3857_ = function(code) {
} }
}); });
}; };
ol.inherits(ol.proj.EPSG3857_, ol.proj.Projection); ol.inherits(ol.proj.EPSG3857.Projection_, ol.proj.Projection);
/** /**
@@ -85,7 +84,7 @@ ol.proj.EPSG3857.CODES = [
* @type {Array.<ol.proj.Projection>} * @type {Array.<ol.proj.Projection>}
*/ */
ol.proj.EPSG3857.PROJECTIONS = ol.proj.EPSG3857.CODES.map(function(code) { ol.proj.EPSG3857.PROJECTIONS = ol.proj.EPSG3857.CODES.map(function(code) {
return new ol.proj.EPSG3857_(code); return new ol.proj.EPSG3857.Projection_(code);
}); });
+10 -11
View File
@@ -1,7 +1,6 @@
goog.provide('ol.proj.EPSG4326'); goog.provide('ol.proj.EPSG4326');
goog.require('ol'); goog.require('ol');
goog.require('ol.proj');
goog.require('ol.proj.Projection'); goog.require('ol.proj.Projection');
goog.require('ol.proj.Units'); goog.require('ol.proj.Units');
goog.require('ol.sphere.WGS84'); goog.require('ol.sphere.WGS84');
@@ -21,7 +20,7 @@ goog.require('ol.sphere.WGS84');
* @param {string=} opt_axisOrientation Axis orientation. * @param {string=} opt_axisOrientation Axis orientation.
* @private * @private
*/ */
ol.proj.EPSG4326_ = function(code, opt_axisOrientation) { ol.proj.EPSG4326.Projection_ = function(code, opt_axisOrientation) {
ol.proj.Projection.call(this, { ol.proj.Projection.call(this, {
code: code, code: code,
units: ol.proj.Units.DEGREES, units: ol.proj.Units.DEGREES,
@@ -32,7 +31,7 @@ ol.proj.EPSG4326_ = function(code, opt_axisOrientation) {
worldExtent: ol.proj.EPSG4326.EXTENT worldExtent: ol.proj.EPSG4326.EXTENT
}); });
}; };
ol.inherits(ol.proj.EPSG4326_, ol.proj.Projection); ol.inherits(ol.proj.EPSG4326.Projection_, ol.proj.Projection);
/** /**
@@ -58,12 +57,12 @@ ol.proj.EPSG4326.METERS_PER_UNIT = Math.PI * ol.sphere.WGS84.radius / 180;
* @type {Array.<ol.proj.Projection>} * @type {Array.<ol.proj.Projection>}
*/ */
ol.proj.EPSG4326.PROJECTIONS = [ ol.proj.EPSG4326.PROJECTIONS = [
new ol.proj.EPSG4326_('CRS:84'), new ol.proj.EPSG4326.Projection_('CRS:84'),
new ol.proj.EPSG4326_('EPSG:4326', 'neu'), new ol.proj.EPSG4326.Projection_('EPSG:4326', 'neu'),
new ol.proj.EPSG4326_('urn:ogc:def:crs:EPSG::4326', 'neu'), new ol.proj.EPSG4326.Projection_('urn:ogc:def:crs:EPSG::4326', 'neu'),
new ol.proj.EPSG4326_('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'), new ol.proj.EPSG4326.Projection_('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'),
new ol.proj.EPSG4326_('urn:ogc:def:crs:OGC:1.3:CRS84'), new ol.proj.EPSG4326.Projection_('urn:ogc:def:crs:OGC:1.3:CRS84'),
new ol.proj.EPSG4326_('urn:ogc:def:crs:OGC:2:84'), new ol.proj.EPSG4326.Projection_('urn:ogc:def:crs:OGC:2:84'),
new ol.proj.EPSG4326_('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'), new ol.proj.EPSG4326.Projection_('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'),
new ol.proj.EPSG4326_('urn:x-ogc:def:crs:EPSG:4326', 'neu') new ol.proj.EPSG4326.Projection_('urn:x-ogc:def:crs:EPSG:4326', 'neu')
]; ];