diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-14 13:34:41 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2015-02-17 15:48:28 -0600 |
commit | 9252fc84840220106e696cc2116e7804c9529c5a (patch) | |
tree | c1bafe27ad0cac8e4b49bd476ad2e3947fe4fca9 /extlib/leaflet/src/geo | |
parent | 572106e23037997db9a4e131029b0a4f7cb969b5 (diff) | |
download | mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.tar.lz mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.tar.xz mediagoblin-9252fc84840220106e696cc2116e7804c9529c5a.zip |
Remove extlib deps moved into bower
Diffstat (limited to 'extlib/leaflet/src/geo')
-rw-r--r-- | extlib/leaflet/src/geo/LatLng.js | 35 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/LatLngBounds.js | 62 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/crs/CRS.EPSG3395.js | 13 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/crs/CRS.EPSG3857.js | 17 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/crs/CRS.EPSG4326.js | 7 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/crs/CRS.js | 17 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/projection/Projection.LonLat.js | 10 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/projection/Projection.Mercator.js | 49 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/projection/Projection.SphericalMercator.js | 23 | ||||
-rw-r--r-- | extlib/leaflet/src/geo/projection/Projection.js | 5 |
10 files changed, 0 insertions, 238 deletions
diff --git a/extlib/leaflet/src/geo/LatLng.js b/extlib/leaflet/src/geo/LatLng.js deleted file mode 100644 index fb916547..00000000 --- a/extlib/leaflet/src/geo/LatLng.js +++ /dev/null @@ -1,35 +0,0 @@ -/*
- CM.LatLng represents a geographical point with latitude and longtitude coordinates.
-*/
-
-L.LatLng = function(/*Number*/ lat, /*Number*/ lng, /*Boolean*/ noWrap) {
- if (noWrap !== true) {
- lat = Math.max(Math.min(lat, 90), -90); // clamp latitude into -90..90
- lng = (lng + 180) % 360 + (lng < -180 ? 180 : -180); // wrap longtitude into -180..180
- }
-
- //TODO change to lat() & lng()
- this.lat = lat;
- this.lng = lng;
-};
-
-L.Util.extend(L.LatLng, {
- DEG_TO_RAD: Math.PI / 180,
- RAD_TO_DEG: 180 / Math.PI,
- MAX_MARGIN: 1.0E-9 // max margin of error for the "equals" check
-});
-
-L.LatLng.prototype = {
- equals: function(/*LatLng*/ obj) {
- if (!(obj instanceof L.LatLng)) { return false; }
-
- var margin = Math.max(Math.abs(this.lat - obj.lat), Math.abs(this.lng - obj.lng));
- return margin <= L.LatLng.MAX_MARGIN;
- },
-
- toString: function() {
- return 'LatLng(' +
- L.Util.formatNum(this.lat) + ', ' +
- L.Util.formatNum(this.lng) + ')';
- }
-};
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/LatLngBounds.js b/extlib/leaflet/src/geo/LatLngBounds.js deleted file mode 100644 index c4e70ec3..00000000 --- a/extlib/leaflet/src/geo/LatLngBounds.js +++ /dev/null @@ -1,62 +0,0 @@ -/*
- * L.LatLngBounds represents a rectangular area on the map in geographical coordinates.
- */
-
-L.LatLngBounds = L.Class.extend({
- initialize: function(southWest, northEast) { // (LatLng, LatLng) or (LatLng[])
- if (!southWest) return;
- var latlngs = (southWest instanceof Array ? southWest : [southWest, northEast]);
- for (var i = 0, len = latlngs.length; i < len; i++) {
- this.extend(latlngs[i]);
- }
- },
-
- // extend the bounds to contain the given point
- extend: function(/*LatLng*/ latlng) {
- if (!this._southWest && !this._northEast) {
- this._southWest = new L.LatLng(latlng.lat, latlng.lng);
- this._northEast = new L.LatLng(latlng.lat, latlng.lng);
- } else {
- this._southWest.lat = Math.min(latlng.lat, this._southWest.lat);
- this._southWest.lng = Math.min(latlng.lng, this._southWest.lng);
- this._northEast.lat = Math.max(latlng.lat, this._northEast.lat);
- this._northEast.lng = Math.max(latlng.lng, this._northEast.lng);
- }
- },
-
- getCenter: function() /*-> LatLng*/ {
- return new L.LatLng(
- (this._southWest.lat + this._northEast.lat) / 2,
- (this._southWest.lng + this._northEast.lng) / 2);
- },
-
- getSouthWest: function() { return this._southWest; },
-
- getNorthEast: function() { return this._northEast; },
-
- getNorthWest: function() {
- return new L.LatLng(this._northEast.lat, this._southWest.lng);
- },
-
- getSouthEast: function() {
- return new L.LatLng(this._southWest.lat, this._northEast.lng);
- },
-
- contains: function(/*LatLngBounds or LatLng*/ obj) /*-> Boolean*/ {
- var sw = this._southWest,
- ne = this._northEast,
- sw2, ne2;
-
- if (obj instanceof L.LatLngBounds) {
- sw2 = obj.getSouthWest();
- ne2 = obj.getNorthEast();
- } else {
- sw2 = ne2 = obj;
- }
-
- return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&
- (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);
- }
-});
-
-//TODO International date line?
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/crs/CRS.EPSG3395.js b/extlib/leaflet/src/geo/crs/CRS.EPSG3395.js deleted file mode 100644 index 426dc73c..00000000 --- a/extlib/leaflet/src/geo/crs/CRS.EPSG3395.js +++ /dev/null @@ -1,13 +0,0 @@ -
-L.CRS.EPSG3395 = L.Util.extend({}, L.CRS, {
- code: 'EPSG:3395',
-
- projection: L.Projection.Mercator,
- transformation: (function() {
- var m = L.Projection.Mercator,
- r = m.R_MAJOR,
- r2 = m.R_MINOR;
-
- return new L.Transformation(0.5/(Math.PI * r), 0.5, -0.5/(Math.PI * r2), 0.5);
- })()
-});
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/crs/CRS.EPSG3857.js b/extlib/leaflet/src/geo/crs/CRS.EPSG3857.js deleted file mode 100644 index cbdbd03a..00000000 --- a/extlib/leaflet/src/geo/crs/CRS.EPSG3857.js +++ /dev/null @@ -1,17 +0,0 @@ -
-L.CRS.EPSG3857 = L.Util.extend({}, L.CRS, {
- code: 'EPSG:3857',
-
- projection: L.Projection.SphericalMercator,
- transformation: new L.Transformation(0.5/Math.PI, 0.5, -0.5/Math.PI, 0.5),
-
- project: function(/*LatLng*/ latlng)/*-> Point*/ {
- var projectedPoint = this.projection.project(latlng),
- earthRadius = 6378137;
- return projectedPoint.multiplyBy(earthRadius);
- }
-});
-
-L.CRS.EPSG900913 = L.Util.extend({}, L.CRS.EPSG3857, {
- code: 'EPSG:900913'
-});
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/crs/CRS.EPSG4326.js b/extlib/leaflet/src/geo/crs/CRS.EPSG4326.js deleted file mode 100644 index 1550718d..00000000 --- a/extlib/leaflet/src/geo/crs/CRS.EPSG4326.js +++ /dev/null @@ -1,7 +0,0 @@ -
-L.CRS.EPSG4326 = L.Util.extend({}, L.CRS, {
- code: 'EPSG:4326',
-
- projection: L.Projection.LonLat,
- transformation: new L.Transformation(1/360, 0.5, -1/360, 0.5)
-});
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/crs/CRS.js b/extlib/leaflet/src/geo/crs/CRS.js deleted file mode 100644 index 2dc2aa8d..00000000 --- a/extlib/leaflet/src/geo/crs/CRS.js +++ /dev/null @@ -1,17 +0,0 @@ -
-L.CRS = {
- latLngToPoint: function(/*LatLng*/ latlng, /*Number*/ scale)/*-> Point*/ {
- var projectedPoint = this.projection.project(latlng);
- return this.transformation._transform(projectedPoint, scale);
- },
-
- pointToLatLng: function(/*Point*/ point, /*Number*/ scale, /*(optional) Boolean*/ unbounded)/*-> LatLng*/ {
- var untransformedPoint = this.transformation.untransform(point, scale);
- return this.projection.unproject(untransformedPoint, unbounded);
- //TODO get rid of 'unbounded' everywhere
- },
-
- project: function(latlng) {
- return this.projection.project(latlng);
- }
-};
\ No newline at end of file diff --git a/extlib/leaflet/src/geo/projection/Projection.LonLat.js b/extlib/leaflet/src/geo/projection/Projection.LonLat.js deleted file mode 100644 index ece29717..00000000 --- a/extlib/leaflet/src/geo/projection/Projection.LonLat.js +++ /dev/null @@ -1,10 +0,0 @@ -
-L.Projection.LonLat = {
- project: function(latlng) {
- return new L.Point(latlng.lng, latlng.lat);
- },
-
- unproject: function(point, unbounded) {
- return new L.LatLng(point.y, point.x, unbounded);
- }
-};
diff --git a/extlib/leaflet/src/geo/projection/Projection.Mercator.js b/extlib/leaflet/src/geo/projection/Projection.Mercator.js deleted file mode 100644 index 9eafff18..00000000 --- a/extlib/leaflet/src/geo/projection/Projection.Mercator.js +++ /dev/null @@ -1,49 +0,0 @@ -
-L.Projection.Mercator = {
- MAX_LATITUDE: 85.0840591556,
-
- R_MINOR: 6356752.3142,
- R_MAJOR: 6378137,
-
- project: function(/*LatLng*/ latlng) /*-> Point*/ {
- var d = L.LatLng.DEG_TO_RAD,
- max = this.MAX_LATITUDE,
- lat = Math.max(Math.min(max, latlng.lat), -max),
- r = this.R_MAJOR,
- x = latlng.lng * d * r,
- y = lat * d,
- tmp = this.R_MINOR / r,
- eccent = Math.sqrt(1.0 - tmp * tmp),
- con = eccent * Math.sin(y);
-
- con = Math.pow((1 - con)/(1 + con), eccent * 0.5);
-
- var ts = Math.tan(0.5 * ((Math.PI * 0.5) - y)) / con;
- y = -r * Math.log(ts);
-
- return new L.Point(x, y);
- },
-
- unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
- var d = L.LatLng.RAD_TO_DEG,
- r = this.R_MAJOR,
- lng = point.x * d / r,
- tmp = this.R_MINOR / r,
- eccent = Math.sqrt(1 - (tmp * tmp)),
- ts = Math.exp(- point.y / r),
- phi = Math.PI/2 - 2 * Math.atan(ts),
- numIter = 15,
- tol = 1e-7,
- i = numIter,
- dphi = 0.1,
- con;
-
- while ((Math.abs(dphi) > tol) && (--i > 0)) {
- con = eccent * Math.sin(phi);
- dphi = Math.PI/2 - 2 * Math.atan(ts * Math.pow((1.0 - con)/(1.0 + con), 0.5 * eccent)) - phi;
- phi += dphi;
- }
-
- return new L.LatLng(phi * d, lng, unbounded);
- }
-};
diff --git a/extlib/leaflet/src/geo/projection/Projection.SphericalMercator.js b/extlib/leaflet/src/geo/projection/Projection.SphericalMercator.js deleted file mode 100644 index be0532ff..00000000 --- a/extlib/leaflet/src/geo/projection/Projection.SphericalMercator.js +++ /dev/null @@ -1,23 +0,0 @@ -
-L.Projection.SphericalMercator = {
- MAX_LATITUDE: 85.0511287798,
-
- project: function(/*LatLng*/ latlng) /*-> Point*/ {
- var d = L.LatLng.DEG_TO_RAD,
- max = this.MAX_LATITUDE,
- lat = Math.max(Math.min(max, latlng.lat), -max),
- x = latlng.lng * d,
- y = lat * d;
- y = Math.log(Math.tan(Math.PI/4 + y/2));
-
- return new L.Point(x, y);
- },
-
- unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
- var d = L.LatLng.RAD_TO_DEG,
- lng = point.x * d,
- lat = (2 * Math.atan(Math.exp(point.y)) - Math.PI/2) * d;
-
- return new L.LatLng(lat, lng, unbounded);
- }
-};
diff --git a/extlib/leaflet/src/geo/projection/Projection.js b/extlib/leaflet/src/geo/projection/Projection.js deleted file mode 100644 index 84316b30..00000000 --- a/extlib/leaflet/src/geo/projection/Projection.js +++ /dev/null @@ -1,5 +0,0 @@ -/*
- * L.Projection contains various geographical projections used by CRS classes.
- */
-
-L.Projection = {};
|