Skip to content

Commit 3682a02

Browse files
committed
[chores] Stop JS logic in loci.js if map is not available
This prevents javascript errors if the JS is loaded on pages where the user doesn't have permission to see the map.
1 parent 3ffe032 commit 3682a02

File tree

1 file changed

+3
-0
lines changed
  • django_loci/static/django-loci/js

1 file changed

+3
-0
lines changed

django_loci/static/django-loci/js/loci.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ django.jQuery(function ($) {
570570
});
571571

572572
function geometryListeners() {
573+
if (!getMap()) {
574+
return;
575+
}
573576
var featureGroup = getFeatureGroup(),
574577
marker = getMarker();
575578
featureGroup.on("layeradd", function () {

0 commit comments

Comments
 (0)