Use Stimulus values for maker#go

This commit is contained in:
2025-05-30 18:01:05 +02:00
parent 4d7bfb4bfa
commit e095270fb3
2 changed files with 96 additions and 93 deletions

View File

@@ -1,7 +1,8 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ['coords'];
static values = {'coords': String };
END_ZOOM = 19;
mapAnimate = {
animate: true,
@@ -12,10 +13,12 @@ export default class extends Controller {
/**
* @param {Event} event
*/
go(event) {
go() {
let map = window.LMap;
const coords = event.currentTarget
.getAttribute('data-coords').split(' ');
console.log(this.coordsValue);
const coords = this.coordsValue.split(' ');
map.setView(
coords,