Skip to content

Commit

Permalink
Avoid defining imgPathElement globally
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Oct 1, 2024
1 parent 347f902 commit d0ce6a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions leaflet/static/leaflet/leaflet.extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ L.Map.djangoMap = function (id, options) {
}
};

const imgPathElement = document.getElementById("force-img-path");
{
const imgPathElement = document.getElementById("force-img-path");

if (!!imgPathElement) {
if (!!imgPathElement) {
L.Icon.Default.imagePath = JSON.parse(imgPathElement.textContent);
}
}
}

0 comments on commit d0ce6a8

Please sign in to comment.