/
opt
/
canhelp
/
node_modules
/
leaflet
/
src
/
geo
/
crs
/
/opt/canhelp/node_modules/leaflet/src/geo/crs
mkdir
upload
Name
Size
Mode
Actions
CRS.Earth.js
1133
0755
edit
dl
rm
CRS.EPSG3395.js
588
0644
edit
dl
rm
CRS.EPSG3857.js
801
0644
edit
dl
rm
CRS.EPSG4326.js
983
0644
edit
dl
rm
CRS.js
5281
0644
edit
dl
rm
CRS.Simple.js
926
0644
edit
dl
rm
index.js
394
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/leaflet/src/geo/crs/CRS.Earth.js
(1133B)
import {CRS} from './CRS'; import * as Util from '../../core/Util'; /* * @namespace CRS * @crs L.CRS.Earth * * Serves as the base for CRS that are global such that they cover the earth. * Can only be used as the base for other CRS and cannot be used directly, * since it does not have a `code`, `projection` or `transformation`. `distance()` returns * meters. */ export var Earth = Util.extend({}, CRS, { wrapLng: [-180, 180], // Mean Earth Radius, as recommended for use by // the International Union of Geodesy and Geophysics, // see https://rosettacode.org/wiki/Haversine_formula R: 6371000, // distance between two geographical points using spherical law of cosines approximation distance: function (latlng1, latlng2) { var rad = Math.PI / 180, lat1 = latlng1.lat * rad, lat2 = latlng2.lat * rad, sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); return this.R * c; } });
Save
cmd:
run