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