comparison client/src/store/fairway.js @ 2339:7dd7371702b9

client: use the name of constants instead of strings
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 19 Feb 2019 17:20:24 +0100
parents d6f2bf26099c
children 242c170e00ce
comparison
equal deleted inserted replaced
2338:918091d1df72 2339:7dd7371702b9
18 import LineString from "ol/geom/LineString.js"; 18 import LineString from "ol/geom/LineString.js";
19 import { generateFeatureRequest } from "../lib/geo.js"; 19 import { generateFeatureRequest } from "../lib/geo.js";
20 import { getLength } from "ol/sphere.js"; 20 import { getLength } from "ol/sphere.js";
21 import { displayError } from "../lib/errors.js"; 21 import { displayError } from "../lib/errors.js";
22 import { featureToFairwayCoordinates } from "../lib/geo.js"; 22 import { featureToFairwayCoordinates } from "../lib/geo.js";
23 import { LAYERS } from "@/store/map.js";
23 24
24 const DEMOLEVEL = 149.345; 25 const DEMOLEVEL = 149.345;
25 26
26 // initial state 27 // initial state
27 const init = () => { 28 const init = () => {
201 commit("profileLoading", true); 202 commit("profileLoading", true);
202 Promise.all(profileLoaders) 203 Promise.all(profileLoaders)
203 .then(() => { 204 .then(() => {
204 rootState.map.cutTool.setActive(false); 205 rootState.map.cutTool.setActive(false);
205 const los3 = rootGetters["map/getLayerByName"]( 206 const los3 = rootGetters["map/getLayerByName"](
206 "LOS 3 Fairway Dimensions" 207 LAYERS.FAIRWAYDIMENSIONSLOS3
207 ); 208 );
208 los3.data.getSource().forEachFeatureIntersectingExtent( 209 los3.data.getSource().forEachFeatureIntersectingExtent(
209 profileLine 210 profileLine
210 .clone() 211 .clone()
211 .transform("EPSG:4326", "EPSG:3857") 212 .transform("EPSG:4326", "EPSG:3857")
224 commit("application/showSplitscreen", true, { root: true }); 225 commit("application/showSplitscreen", true, { root: true });
225 } 226 }
226 } 227 }
227 ); 228 );
228 const los2 = rootGetters["map/getLayerByName"]( 229 const los2 = rootGetters["map/getLayerByName"](
229 "LOS 2 Fairway Dimensions" 230 LAYERS.FAIRWAYDIMENSIONSLOS2
230 ); 231 );
231 los2.data.getSource().forEachFeatureIntersectingExtent( 232 los2.data.getSource().forEachFeatureIntersectingExtent(
232 profileLine 233 profileLine
233 .clone() 234 .clone()
234 .transform("EPSG:4326", "EPSG:3857") 235 .transform("EPSG:4326", "EPSG:3857")
247 commit("application/showSplitscreen", true, { root: true }); 248 commit("application/showSplitscreen", true, { root: true });
248 } 249 }
249 } 250 }
250 ); 251 );
251 const los1 = rootGetters["map/getLayerByName"]( 252 const los1 = rootGetters["map/getLayerByName"](
252 "LOS 1 Fairway Dimensions" 253 LAYERS.FAIRWAYDIMENSIONSLOS1
253 ); 254 );
254 los1.data.getSource().forEachFeatureIntersectingExtent( 255 los1.data.getSource().forEachFeatureIntersectingExtent(
255 profileLine 256 profileLine
256 .clone() 257 .clone()
257 .transform("EPSG:4326", "EPSG:3857") 258 .transform("EPSG:4326", "EPSG:3857")