Skip to content

Commit

Permalink
Fix Leaflet trying to load "infinite amount of tiles" (#9233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen authored and andreslucena committed May 6, 2022
1 parent 9fa85fe commit 11c8998
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions decidim-core/app/packs/src/decidim/map/controller/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export default class MapStaticController extends MapController {
this.map.tap.disable();
}

if (this.config.zoom) {
this.map.setZoom(this.config.zoom);
} else {
this.map.setZoom(15);
}

if (this.config.latitude && this.config.longitude) {
const coordinates = [this.config.latitude, this.config.longitude];

Expand All @@ -27,11 +33,6 @@ export default class MapStaticController extends MapController {
}).addTo(this.map);
marker._icon.removeAttribute("tabindex");
}
if (this.config.zoom) {
this.map.setZoom(this.config.zoom);
} else {
this.map.setZoom(15);
}

if (this.config.link) {
this.map._container.addEventListener("click", (ev) => {
Expand Down

0 comments on commit 11c8998

Please sign in to comment.