From 0e42830e29095a5f78f347e9b4d304a27ddcef70 Mon Sep 17 00:00:00 2001 From: Basile Bruneau Date: Sat, 12 Feb 2022 20:46:38 +0100 Subject: [PATCH] fix: release 2.2.1 --- package.json | 2 +- src/without-countries.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 76e87aa..5e355f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dotted-map", - "version": "2.2.0", + "version": "2.2.1", "description": "Create a SVG map filled with dots for the world or countries", "main": "./index.js", "exports": { diff --git a/src/without-countries.js b/src/without-countries.js index fb2a71f..063873d 100644 --- a/src/without-countries.js +++ b/src/without-countries.js @@ -17,7 +17,7 @@ function DottedMapWithoutCountries({ map, avoidOuterPins = false }) { return { addPin({ lat, lng, data, svgOptions }) { - const pin = getPin({ lat, lng }); + const pin = this.getPin({ lat, lng }); const point = { ...pin, data, svgOptions }; points[[x, y].join(';')] = point; @@ -50,7 +50,10 @@ function DottedMapWithoutCountries({ map, avoidOuterPins = false }) { const [localLng, localLat] = proj4( proj4.defs('GOOGLE'), proj4.defs('WGS84'), - [localx, localy], + [ + (localx * X_RANGE) / width + X_MIN, + Y_MAX - (localy * Y_RANGE) / height, + ], ); const pin = { x: localx, y: localy, lat: localLat, lng: localLng };