# HG changeset patch # User Markus Kottlaender # Date 1541153086 -3600 # Node ID dfe3966bb308e8b33171f47b86b2ab7f1c566efe # Parent 67e9355e7a58e45938b4dfea8b0c3e14400a5e21 removed unnecessary methods and renamed variable Those three methods were only used onced and can be inlined. The 2 in featureRequest2 was confusing because there is no featureRequest(1) in the same scope. diff -r 67e9355e7a58 -r dfe3966bb308 client/src/map/Maplayer.vue --- a/client/src/map/Maplayer.vue Fri Nov 02 08:32:58 2018 +0100 +++ b/client/src/map/Maplayer.vue Fri Nov 02 11:04:46 2018 +0100 @@ -80,18 +80,9 @@ mapfull: !this.split, mapsplit: this.split }; - }, - layerData() { - const l = this.layers.map(x => { - return x.data; - }); - return [...l, this.vectorLayer]; } }, methods: { - createVectorSource() { - this.vectorSource = new VectorSource({ wrapX: false }); - }, drawStyleFunction(feature) { // adapted from OpenLayer's LineString Arrow Example var geometry = feature.getGeometry(); @@ -132,12 +123,6 @@ } return styles; }, - createVectorLayer() { - this.vectorLayer = new VectorLayer({ - source: this.vectorSource, - style: this.drawStyleFunction - }); - }, removeCurrentInteraction() { this.$store.commit("identifystore/setCurrentMeasurement", null); this.vectorSource.clear(); @@ -419,10 +404,13 @@ } }, mounted() { - this.createVectorSource(); - this.createVectorLayer(); + this.vectorSource = new VectorSource({ wrapX: false }); + this.vectorLayer = new VectorLayer({ + source: this.vectorSource, + style: this.drawStyleFunction + }); let map = new Map({ - layers: this.layerData, + layers: [...this.layers.map(x => x.data), this.vectorLayer], target: "map", controls: [], view: new View({ @@ -437,7 +425,7 @@ // loading the full WFS layer, by not setting the loader function // and without bboxStrategy - var featureRequest2 = new WFS().writeGetFeature({ + var featureRequest = new WFS().writeGetFeature({ srsName: "EPSG:3857", featureNS: "gemma", featurePrefix: "gemma", @@ -449,7 +437,7 @@ // that all are available for the intersection with the profile HTTP.post( "/internal/wfs", - new XMLSerializer().serializeToString(featureRequest2), + new XMLSerializer().serializeToString(featureRequest), { headers: { "X-Gemma-Auth": localStorage.getItem("token"),