leaflet-rd
Advanced tools
Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "leaflet-rd", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Adds support for the Amersfoort / RD New coordinate system", | ||
@@ -20,15 +20,15 @@ "main": "src/leaflet.rd.js", | ||
"dependencies": { | ||
"proj4": "~2.4.4" | ||
"proj4": "~2.5.0" | ||
}, | ||
"peerDependencies": { | ||
"leaflet": "^1.2.0" | ||
"leaflet": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/leaflet": "*", | ||
"jasmine-core": "^2.5.2", | ||
"karma": "^1.5.0", | ||
"@types/leaflet": "~1.2.10", | ||
"jasmine-core": "^3.2.0", | ||
"karma": "^3.0.0", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-jasmine": "^1.1.0" | ||
}, | ||
"typings": "src/leaflet.rd.d.ts", | ||
"typings": "types/index.d.ts", | ||
"keywords": [ | ||
@@ -35,0 +35,0 @@ "leaflet", |
@@ -7,8 +7,8 @@ (function (factory, window) { | ||
// define a Common JS module that relies on 'leaflet' | ||
// define a Common JS module that relies on 'leaflet' | ||
} else if (typeof exports === 'object' && !(window.test)) { | ||
module.exports = factory(require('leaflet'), require('proj4').default); | ||
module.exports = factory(require('leaflet'), require('proj4')); | ||
} else { | ||
// attach your plugin to the global 'L' variable | ||
// attach your plugin to the global 'L' variable | ||
if (typeof L !== 'undefined' && typeof proj4 !== 'undefined') { | ||
@@ -19,2 +19,6 @@ factory(L, proj4); | ||
}(function (L, proj4) { | ||
if (proj4.hasOwnProperty('default')) { | ||
proj4 = proj4.default; | ||
} | ||
var def = '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957,0.343988,-1.87740,4.0725 +units=m +no_defs'; | ||
@@ -28,11 +32,11 @@ var proj4RD = proj4('WGS84', def); | ||
for (var i = 0; i <= maxZoom; i++) { | ||
scales.push(1/ (zeroScale * Math.pow(0.5, i))); | ||
scales.push(1 / (zeroScale * Math.pow(0.5, i))); | ||
}; | ||
L.Projection.RD = { | ||
project: function(latlng) { | ||
project: function (latlng) { | ||
var point = proj4RD.forward([latlng.lng, latlng.lat]); | ||
return new L.Point(point[0], point[1]); | ||
}, | ||
unproject: function(point) { | ||
unproject: function (point) { | ||
var lnglat = proj4RD.inverse([point.x, point.y]); | ||
@@ -43,3 +47,3 @@ return L.latLng(lnglat[1], lnglat[0]); | ||
bounds: L.bounds([-285401.920, 903401.920], [595401.920, 22598.080]), | ||
proj4def: def | ||
@@ -54,3 +58,3 @@ }; | ||
scale: function(zoom) { | ||
scale: function (zoom) { | ||
if (scales[zoom]) { | ||
@@ -63,4 +67,4 @@ return scales[zoom] | ||
zoom: function(scale) { | ||
return Math.log((1/scale) / zeroScale) / (Math.log(0.5)); | ||
zoom: function (scale) { | ||
return Math.log((1 / scale) / zeroScale) / (Math.log(0.5)); | ||
}, | ||
@@ -67,0 +71,0 @@ }); |
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
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
10
188
10855
+ Addedproj4@2.5.0(transitive)
- Removedproj4@2.4.4(transitive)
Updatedproj4@~2.5.0