Zoom levels for clusters
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user