Mercurial > gemma
comparison client/src/components/Maplayer.vue @ 2190:ecb0ad836aa0
linting
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 12 Feb 2019 10:04:01 +0100 |
parents | 005da2c21b11 |
children | 4eeaba4ef573 |
comparison
equal
deleted
inserted
replaced
2189:1e99a4226f3d | 2190:ecb0ad836aa0 |
---|---|
36 import "ol/ol.css"; | 36 import "ol/ol.css"; |
37 import { Map, View } from "ol"; | 37 import { Map, View } from "ol"; |
38 import { WFS, GeoJSON } from "ol/format.js"; | 38 import { WFS, GeoJSON } from "ol/format.js"; |
39 import { equalTo } from "ol/format/filter.js"; | 39 import { equalTo } from "ol/format/filter.js"; |
40 import { Stroke, Style, Fill } from "ol/style.js"; | 40 import { Stroke, Style, Fill } from "ol/style.js"; |
41 import { displayError } from "@/lib/errors.js"; | |
41 | 42 |
42 /* for the sake of debugging */ | 43 /* for the sake of debugging */ |
43 /* eslint-disable no-console */ | 44 /* eslint-disable no-console */ |
44 export default { | 45 export default { |
45 name: "maplayer", | 46 name: "maplayer", |
184 headers: { | 185 headers: { |
185 "X-Gemma-Auth": localStorage.getItem("token"), | 186 "X-Gemma-Auth": localStorage.getItem("token"), |
186 "Content-type": "text/xml; charset=UTF-8" | 187 "Content-type": "text/xml; charset=UTF-8" |
187 } | 188 } |
188 }) | 189 }) |
189 .then((response) => { | 190 .then(response => { |
190 this.$store.commit("map/moveToBoundingBox", { | 191 this.$store.commit("map/moveToBoundingBox", { |
191 boundingBox: [ | 192 boundingBox: [ |
192 response.data.extent.x1, | 193 response.data.extent.x1, |
193 response.data.extent.y1, | 194 response.data.extent.y1, |
194 response.data.extent.x2, | 195 response.data.extent.x2, |
195 response.data.extent.y2 | 196 response.data.extent.y2 |
196 ], zoom: 17, preventZoomOut:true}); | 197 ], |
197 }) | 198 zoom: 17, |
198 .catch(error => { | 199 preventZoomOut: true |
199 const { status, data } = error.response; | 200 }); |
200 displayError({ | 201 }) |
201 title: this.$gettext("Backend Error"), | 202 .catch(error => { |
202 message: `${status}: ${data.message || data}` | 203 const { status, data } = error.response; |
204 displayError({ | |
205 title: this.$gettext("Backend Error"), | |
206 message: `${status}: ${data.message || data}` | |
207 }); | |
203 }); | 208 }); |
204 }); | |
205 | 209 |
206 // TODO make display of layers more dynamic, e.g. from a list | 210 // TODO make display of layers more dynamic, e.g. from a list |
207 | 211 |
208 // load different fairway dimension layers (level of service) | 212 // load different fairway dimension layers (level of service) |
209 ["1", "2", "3"].forEach(los => { | 213 ["1", "2", "3"].forEach(los => { |
210 // loading the full WFS layer without bboxStrategy | 214 // loading the full WFS layer without bboxStrategy |
211 var source = this.getVSourceByName("Fairway Dimensions LOS " + los); | 215 var source = this.getVSourceByName("Fairway Dimensions LOS " + los); |
216 /*eslint-disable no-unused-vars */ | |
212 var loader = function(extent, resolution, projection) { | 217 var loader = function(extent, resolution, projection) { |
213 var featureRequest = new WFS().writeGetFeature({ | 218 var featureRequest = new WFS().writeGetFeature({ |
214 srsName: "EPSG:3857", | 219 srsName: "EPSG:3857", |
215 featureNS: "gemma", | 220 featureNS: "gemma", |
216 featurePrefix: "gemma", | 221 featurePrefix: "gemma", |