leaflet-geometryutil
Advanced tools
Comparing version 0.10.1 to 0.10.2
{ | ||
"name": "leaflet-geometryutil", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Leaflet utility functions on geometries", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,2 +50,7 @@ Leaflet.GeometryUtil | ||
### 0.10.2 ### | ||
* use leaflet's earth radius in destination function (#96, thanks to @viliusstanga) | ||
* Changed imports to acommodate to new ngx-leaflet organization (#97, thanks to @rtrevinnoc) | ||
### 0.10.1 ### | ||
@@ -52,0 +57,0 @@ |
describe('Destination', function() { | ||
var radius = L.CRS.Earth.R; | ||
it('It should be [90.0,0.0]', function(done) { | ||
var latlng1 = L.latLng([0.0, 0.0]), | ||
heading = 0.0; | ||
dist = 6378137 * Math.PI / 2.0; // 1/4 Earth's circumference. | ||
dist = radius * Math.PI / 2.0; // 1/4 Earth's circumference. | ||
result = L.latLng([90.0,0.0]); | ||
@@ -15,3 +17,3 @@ assert.latLngEqual(result, L.GeometryUtil.destination(latlng1, heading, dist)); | ||
heading = -90.0; | ||
dist = 6378137 * Math.PI / 8.0; | ||
dist = radius * Math.PI / 8.0; | ||
result = L.latLng([0.0, 162.5]); | ||
@@ -25,3 +27,3 @@ assert.latLngEqual(result, L.GeometryUtil.destination(latlng1, heading, dist)); | ||
heading = 134.5614514132577; | ||
dist = 3140555.3283872544; | ||
dist = 3137041.1135971523; | ||
result = L.latLng([-10, 10.0]); | ||
@@ -28,0 +30,0 @@ assert.latLngEqual(result, L.GeometryUtil.destination(latlng1, heading, dist)); |
@@ -1,2 +0,3 @@ | ||
import L, { LatLngLiteral, Layer } from "leaflet"; | ||
import * as L from "leaflet"; | ||
import { LatLngLiteral, Layer } from "leaflet" | ||
@@ -3,0 +4,0 @@ interface LayerPointRelation<LayerType extends Layer = Layer> { |
@@ -717,3 +717,3 @@ // Packaging/modules magic dance. | ||
radInv = 180 / Math.PI, | ||
R = 6378137, // approximation of Earth's radius | ||
R = L.CRS.Earth.R, // approximation of Earth's radius | ||
lon1 = latlng.lng * rad, | ||
@@ -720,0 +720,0 @@ lat1 = latlng.lat * rad, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1657033
2502
173
19