Use Stimulus values for maker#go
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user