mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 15:41:42 +00:00
obtener el overlay antes que nada
This commit is contained in:
parent
a664c2dcd3
commit
c77fb50366
1 changed files with 3 additions and 3 deletions
|
@ -14,15 +14,15 @@ export default class extends Controller {
|
|||
static targets = [ 'lat', 'lng', 'map', 'overlay' ]
|
||||
|
||||
async connect () {
|
||||
const res = await fetch(this.element.dataset.map);
|
||||
this.overlayTarget.innerHTML = await res.text();
|
||||
|
||||
this.marker()
|
||||
|
||||
this.latTarget.addEventListener('change', event => this.marker())
|
||||
this.lngTarget.addEventListener('change', event => this.marker())
|
||||
window.addEventListener('resize', event => this.map.invalidateSize())
|
||||
|
||||
const res = await fetch(this.element.dataset.map);
|
||||
this.overlayTarget.innerHTML = await res.text();
|
||||
|
||||
this.map.on('click', event => {
|
||||
this.latTarget.value = event.latlng.lat
|
||||
this.lngTarget.value = event.latlng.lng
|
||||
|
|
Loading…
Reference in a new issue