Zoom levels for clusters

This commit is contained in:
2024-11-29 17:30:07 +01:00
parent 4ea00e9555
commit 1a0c5c1766
5 changed files with 35 additions and 15 deletions

View File

@@ -2,7 +2,7 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ['coords'];
END_ZOOM = 20;
END_ZOOM = 19;
mapAnimate = {
animate: true,
duration: 1,

View File

@@ -3,6 +3,24 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ['close', 'modal'];
current(id) {
return this.modalTargets.find(m => m.getAttribute('data-id') === id);
}
homeOpen(event) {
const id = event.currentTarget.getAttribute('data-id');
const current = this.current(id);
current.classList.add('is-active');
}
homeClose(event) {
const id = event.currentTarget.getAttribute('data-id');
const current = this.current(id);
current.classList.remove('is-active');
}
open() {
this.modalTarget.classList.add('is-active');
}