mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +00:00
address selection: add leaflet css + add fields for the address extra information (WIP)'
This commit is contained in:
@@ -3,6 +3,7 @@ import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
import { addressMessages } from './js/i18n'
|
||||
import { getDataPromise } from './store'
|
||||
|
||||
|
||||
import App from './App.vue';
|
||||
|
||||
getDataPromise.then(store => {
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
import { getReferenceAddress } from '../api';
|
||||
import { initMap, updateMap } from '../map';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
@@ -11,7 +10,7 @@ const getDataPromise = getReferenceAddress()
|
||||
const store = createStore({
|
||||
strict: debug,
|
||||
state: {
|
||||
referenceAddresses: referenceAddresses.results,
|
||||
referenceAddresses: referenceAddresses.results, //TODO-> move to data
|
||||
countries: [
|
||||
{id: 1, name: 'France', countryCode: 'FR'},
|
||||
{id: 2, name: 'Belgium', countryCode: 'BE'}
|
||||
@@ -25,9 +24,14 @@ const getDataPromise = getReferenceAddress()
|
||||
selectedCity: null,
|
||||
selectedAddress: null,
|
||||
addressMap: {
|
||||
//map: initMap(), //-> the map container is not initialised when store is created.
|
||||
center : [48.8589, 2.3469],
|
||||
zoom: 12
|
||||
},
|
||||
form: {
|
||||
isNoAddress: false,
|
||||
floor: null,
|
||||
corridor: null,
|
||||
steps: null
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@@ -48,11 +52,14 @@ const getDataPromise = getReferenceAddress()
|
||||
setSelectedAddress(state, value) {
|
||||
console.log(value)
|
||||
state.selectedAddress = value;
|
||||
state.addressMap.center = value.point.coordinates; //TODO is it OK to put this here?
|
||||
//updateMap(state); //TODO where to listen to map center change?
|
||||
state.addressMap.center = value.point.coordinates; //TODO is it OK to put this here? //call setMapCenter
|
||||
updateMap(state); //TODO where to listen to map center change? -> action avec dispatch
|
||||
},
|
||||
setMapCenter(state, value) {
|
||||
state.addressMap.center = value;
|
||||
},
|
||||
setIsNoAddress(state, value) {
|
||||
state.form.isNoAddress = value;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
Reference in New Issue
Block a user