comparison client/src/store/fairway.js @ 3146:b6cc4838d2c0

client: implemented pane mechanic for diagrams regressions: diagrams are currently not collapsible anymore, animations were removed
author Markus Kottlaender <markus@intevation.de>
date Fri, 03 May 2019 10:33:51 +0200
parents 583b6748431f
children f64cc98746a1
comparison
equal deleted inserted replaced
3145:d33a5c1522dc 3146:b6cc4838d2c0
107 }, 107 },
108 clearFairwayData: state => { 108 clearFairwayData: state => {
109 state.fairwayData = []; 109 state.fairwayData = [];
110 }, 110 },
111 clearCurrentProfile: state => { 111 clearCurrentProfile: state => {
112 state.additionalSurvey = null;
113 state.currentProfile = {}; 112 state.currentProfile = {};
114 state.minAlt = null; 113 state.minAlt = null;
115 state.maxAlt = null; 114 state.maxAlt = null;
116 state.totalLength = null; 115 state.totalLength = null;
117 state.fairwayData = []; 116 state.fairwayData = [];
130 selectedCut: (state, cut) => { 129 selectedCut: (state, cut) => {
131 state.selectedCut = cut; 130 state.selectedCut = cut;
132 } 131 }
133 }, 132 },
134 actions: { 133 actions: {
135 clearSelection({ commit, dispatch, rootState }) { 134 clearCurrentProfile({ commit, rootState }) {
136 dispatch("bottlenecks/setSelectedBottleneck", null, { root: true });
137 commit("clearCurrentProfile"); 135 commit("clearCurrentProfile");
138 commit("map/cutToolEnabled", false, { root: true }); 136 commit("map/cutToolEnabled", false, { root: true });
139 rootState.map.openLayersMaps.forEach(m => { 137 rootState.map.openLayersMaps.forEach(m => {
140 m.getLayer("CUTTOOL") 138 m.getLayer("CUTTOOL")
141 .getSource() 139 .getSource()
211 profileLoaders.push( 209 profileLoaders.push(
212 dispatch("loadProfile", state.additionalSurvey) 210 dispatch("loadProfile", state.additionalSurvey)
213 ); 211 );
214 } 212 }
215 213
216 commit("application/showSplitscreen", true, { root: true });
217 commit("application/splitscreenLoading", true, { root: true });
218 commit("profileLoading", true); 214 commit("profileLoading", true);
219 Promise.all(profileLoaders) 215 Promise.all(profileLoaders)
220 .then(() => { 216 .then(() => {
221 commit("map/cutToolEnabled", false, { root: true }); 217 commit("map/cutToolEnabled", false, { root: true });
222 const los3 = rootGetters["map/openLayersMap"]().getLayer( 218 const los3 = rootGetters["map/openLayersMap"]().getLayer(
293 title: "Backend Error", 289 title: "Backend Error",
294 message: `${status ? status + ":" : ""} ${data.message || data}` 290 message: `${status ? status + ":" : ""} ${data.message || data}`
295 }); 291 });
296 }) 292 })
297 .finally(() => { 293 .finally(() => {
298 let splitscreenConf = { 294 commit("application/paneRotate", 1, { root: true });
299 id: "fairwayprofile", 295 if (state.additionalSurvey) {
300 component: "fairwayprofile", 296 commit(
301 title: `${rootState.bottlenecks.selectedBottleneck} (${ 297 "application/paneSetup",
302 rootState.bottlenecks.selectedSurvey.date_info 298 "COMPARESURVEYS_FAIRWAYPROFILE",
303 })`, 299 { root: true }
304 icon: "chart-area", 300 );
305 closeCallback: () => { 301 } else {
306 dispatch("clearSelection"); 302 commit("application/paneSetup", "FAIRWAYPROFILE", {
307 }, 303 root: true
308 expandCallback: () => { 304 });
309 let bottleneck = rootState.bottlenecks.bottlenecksList.find( 305 }
310 bn =>
311 bn.properties.name ===
312 rootState.bottlenecks.selectedBottleneck
313 );
314 dispatch(
315 "map/moveToFeauture",
316 {
317 feature: bottleneck,
318 zoom: 17,
319 preventZoomOut: true
320 },
321 { root: true }
322 );
323 }
324 };
325 commit("application/addSplitscreen", splitscreenConf, {
326 root: true
327 });
328 commit("application/activeSplitscreenId", "fairwayprofile", {
329 root: true
330 });
331 commit("application/splitscreenLoading", false, { root: true });
332 commit("profileLoading", false); 306 commit("profileLoading", false);
333 }); 307 });
334 } 308 }
335 }); 309 });
336 }, 310 },