comparison client/src/components/layers/LegendElement.vue @ 3031:f99f0cbb843f

client:linting
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 12 Apr 2019 13:07:48 +0200
parents 81c2e561fe03
children b8b95292d45f
comparison
equal deleted inserted replaced
3030:3524bbc5067e 3031:f99f0cbb843f
63 }, 63 },
64 mounted() { 64 mounted() {
65 if (this.layer.getType() == "VECTOR") { 65 if (this.layer.getType() == "VECTOR") {
66 this.initMap(); 66 this.initMap();
67 } else { 67 } else {
68 if (this.layer.get("id") === "OPENSTREETMAP" || 68 if (
69 this.layer.get("id") === "OPENSTREETMAP" ||
69 this.layer.get("id") === "INLANDECDIS" || 70 this.layer.get("id") === "INLANDECDIS" ||
70 this.layer.get("id") === "BOTTLENECKISOLINE" || 71 this.layer.get("id") === "BOTTLENECKISOLINE" ||
71 this.layer.get("id") === "DIFFERENCES" 72 this.layer.get("id") === "DIFFERENCES"
72 ) { 73 ) {
73 // TODO: Do something useful? 74 // TODO: Do something useful?
74 return 75 return;
75 } 76 }
76 let img = document.createElement("img") 77 let img = document.createElement("img");
77 img.setAttribute("style", "margin: 0 auto;display: flex;") 78 img.setAttribute("style", "margin: 0 auto;display: flex;");
78 if (this.layer.get("id") === "DISTANCEMARKSAXIS") { 79 if (this.layer.get("id") === "DISTANCEMARKSAXIS") {
79 img.setAttribute("src", require("@/assets/distancemarks-axis.png")) 80 img.setAttribute("src", require("@/assets/distancemarks-axis.png"));
80 } 81 } else {
81 else {
82 // for simple WMS legends. 82 // for simple WMS legends.
83 let url = `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=`+this.layer.getSource().getParams().LAYERS + `&legend_options=columns:4;fontAntiAliasing:true` 83 let url =
84 `/internal/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=` +
85 this.layer.getSource().getParams().LAYERS +
86 `&legend_options=columns:4;fontAntiAliasing:true`;
84 HTTP.get(url, { 87 HTTP.get(url, {
85 headers: { 88 headers: {
86 "X-Gemma-Auth": localStorage.getItem("token") 89 "X-Gemma-Auth": localStorage.getItem("token")
87 }, 90 },
88 responseType: "blob" 91 responseType: "blob"