From 3c99fde45db83b531c41c350ed4d0ac2a3c40c62 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:45:13 +0200 Subject: Adding debian version 1.1.0-3. Signed-off-by: Daniel Baumann --- .../geo/projection/Projection.SphericalMercator.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 debian/missing-sources/leaflet.js/geo/projection/Projection.SphericalMercator.js (limited to 'debian/missing-sources/leaflet.js/geo/projection/Projection.SphericalMercator.js') diff --git a/debian/missing-sources/leaflet.js/geo/projection/Projection.SphericalMercator.js b/debian/missing-sources/leaflet.js/geo/projection/Projection.SphericalMercator.js new file mode 100644 index 0000000..b6f6539 --- /dev/null +++ b/debian/missing-sources/leaflet.js/geo/projection/Projection.SphericalMercator.js @@ -0,0 +1,42 @@ +import {LatLng} from '../LatLng'; +import {Bounds} from '../../geometry/Bounds'; +import {Point} from '../../geometry/Point'; + +/* + * @namespace Projection + * @projection L.Projection.SphericalMercator + * + * Spherical Mercator projection — the most common projection for online maps, + * used by almost all free and commercial tile providers. Assumes that Earth is + * a sphere. Used by the `EPSG:3857` CRS. + */ + +export var SphericalMercator = { + + R: 6378137, + MAX_LATITUDE: 85.0511287798, + + project: function (latlng) { + var d = Math.PI / 180, + max = this.MAX_LATITUDE, + lat = Math.max(Math.min(max, latlng.lat), -max), + sin = Math.sin(lat * d); + + return new Point( + this.R * latlng.lng * d, + this.R * Math.log((1 + sin) / (1 - sin)) / 2); + }, + + unproject: function (point) { + var d = 180 / Math.PI; + + return new LatLng( + (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d, + point.x * d / this.R); + }, + + bounds: (function () { + var d = 6378137 * Math.PI; + return new Bounds([-d, -d], [d, d]); + })() +}; -- cgit v1.2.3