diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b59f7e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test/ \ No newline at end of file diff --git a/src/Leaflet.BigImage.js b/src/Leaflet.BigImage.js index fe5d68e..6e648c0 100644 --- a/src/Leaflet.BigImage.js +++ b/src/Leaflet.BigImage.js @@ -215,7 +215,7 @@ let image = new Image(); image.crossOrigin = 'Anonymous'; image.onload = function () { - if (!self.tilesImgs[layer._leaflet_id][imgIndex]) self.tilesImgs[layer._leaflet_id][imgIndex] = {img: image, x: tilePos.x, y: tilePos.y}; + if (!self.tilesImgs[layer._leaflet_id][imgIndex]) self.tilesImgs[layer._leaflet_id][imgIndex] = { img: image, x: tilePos.x, y: tilePos.y }; resolve(); }; image.src = layer.getTileUrl(tilePoint); @@ -241,7 +241,7 @@ let image = new Image(); image.crossOrigin = 'Anonymous'; image.onload = function () { - self.markers[layer._leaflet_id] = {img: image, x: pixelPoint.x, y: pixelPoint.y}; + self.markers[layer._leaflet_id] = { img: image, x: pixelPoint.x, y: pixelPoint.y }; resolve(); }; image.src = layer._icon.src; @@ -266,6 +266,7 @@ } let latlngs = layer.options.fill ? layer._latlngs[0] : layer._latlngs; + if (Array.isArray(latlngs[0])) { latlngs = latlngs.flat(); } latlngs.forEach((latLng) => { let pixelPoint = self._map.project(latLng); pixelPoint = pixelPoint.subtract(new L.Point(self.bounds.min.x, self.bounds.min.y));