mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
address selection: move marker on the leaflet map on update map
This commit is contained in:
parent
743b456030
commit
0afcf3d79e
@ -11,6 +11,7 @@ import markerIconPng from 'leaflet/dist/images/marker-icon.png'
|
|||||||
import 'leaflet/dist/leaflet.css';
|
import 'leaflet/dist/leaflet.css';
|
||||||
|
|
||||||
let map;
|
let map;
|
||||||
|
let marker;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddressMap',
|
name: 'AddressMap',
|
||||||
@ -32,11 +33,12 @@ export default {
|
|||||||
iconUrl: markerIconPng,
|
iconUrl: markerIconPng,
|
||||||
});
|
});
|
||||||
|
|
||||||
L.marker([48.8589, 2.3469], {icon: markerIcon}).addTo(map);
|
marker = L.marker([48.8589, 2.3469], {icon: markerIcon}).addTo(map);
|
||||||
|
|
||||||
},
|
},
|
||||||
update() {
|
update() {
|
||||||
console.log('update map with : ', this.address.addressMap.center)
|
console.log('update map with : ', this.address.addressMap.center)
|
||||||
|
marker.setLatLng(this.address.addressMap.center);
|
||||||
map.setView(this.address.addressMap.center, 12);
|
map.setView(this.address.addressMap.center, 12);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user