mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-05 04:49:44 +00:00
address selection: fix leaflet icon url + others fix (WIP)
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
</div>
|
||||
<div class="address_form__map">
|
||||
<address-map>
|
||||
<address-map ref="addressMap">
|
||||
</address-map>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
this.$store.commit('setIsNoAddress', v);
|
||||
},
|
||||
get() {
|
||||
return this.$store.state.form.isNoAddress; //this.add_address.form.isNoAddress
|
||||
return this.$store.state.form.isNoAddress; //TODO could be this.add_address.form.isNoAddress
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div id='address_map' v-bind='init' style='height:400px; width:400px;'></div>
|
||||
<div id='address_map' style='height:400px; width:400px;'></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import L from 'leaflet';
|
||||
import markerIconPng from 'leaflet/dist/images/marker-icon.png'
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
|
||||
let map;
|
||||
@@ -25,11 +26,6 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
// watch: {
|
||||
// center: get() {
|
||||
// console.log()
|
||||
// }
|
||||
// },
|
||||
methods:{
|
||||
init() {
|
||||
map = L.map('address_map').setView([48.8589, 2.3469], 12);
|
||||
@@ -38,16 +34,16 @@ export default {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
|
||||
L.marker([48.8589, 2.3469]).addTo(map)
|
||||
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
|
||||
.openPopup();
|
||||
const markerIcon = L.icon({
|
||||
iconUrl: markerIconPng,
|
||||
});
|
||||
|
||||
L.marker([48.8589, 2.3469], {icon: markerIcon}).addTo(map);
|
||||
|
||||
console.log(map);
|
||||
},
|
||||
update() {
|
||||
console.log('update map', this.$store.state.addressMap.center)
|
||||
map.setView(this.$store.state.addressMap.center, 12);
|
||||
//TODO update map view based on the store map centerS
|
||||
console.log('update map with : ', this.$store.getMapCenter())
|
||||
map.setView(this.$store.getMapCenter(), 12);
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
Reference in New Issue
Block a user