Skip to content

Commit

Permalink
feat: added multipolygon support
Browse files Browse the repository at this point in the history
  • Loading branch information
caerroff committed Nov 28, 2023
1 parent b922385 commit 93ace73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/
5 changes: 3 additions & 2 deletions src/Leaflet.BigImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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));
Expand Down

0 comments on commit 93ace73

Please sign in to comment.