changeset 938:fe923c8ef08f

client: add static legend image to contour_lines * Add a new image asset `legend_contour_lines.png` and display it for the "Bottleneck isolines" layer's legend. * Ensure that the "Bottleneck isolines" layer is not visible at startup. * Remove some outdated TODOISO and TODOSTYLE comments.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 09 Oct 2018 00:12:12 +0200
parents 72430f050d90
children a22f66acfd96
files client/src/application/assets/application.scss client/src/application/assets/legend_contour_lines.png client/src/layers/Layerselect.vue client/src/map/Maplayer.vue client/src/map/store.js
diffstat 5 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/application/assets/application.scss	Mon Oct 08 19:48:51 2018 +0200
+++ b/client/src/application/assets/application.scss	Tue Oct 09 00:12:12 2018 +0200
@@ -5,7 +5,7 @@
 $icon-width: 2rem;
 $large-offset: 2rem;
 $layerselect-height: 20rem;
-$layerselect-width: 20rem;
+$layerselect-width: 22rem;
 $identify-height: 20rem;
 $identify-width: 20rem;
 $offset: 1rem;
Binary file client/src/application/assets/legend_contour_lines.png has changed
--- a/client/src/layers/Layerselect.vue	Mon Oct 08 19:48:51 2018 +0200
+++ b/client/src/layers/Layerselect.vue	Tue Oct 09 00:12:12 2018 +0200
@@ -1,9 +1,15 @@
 <template>
+  <div>
     <div class="form-check d-flex flex-row flex-start selection">
         <input class="form-check-input" @change="visibilityToggled" :id="layername" type="checkbox" :checked="isVisible">
         <LegendElement :layername="layername" :layerindex="layerindex"></LegendElement>
         <label class="layername form-check-label">{{layername}}</label>
     </div>
+    <div v-if="isVisible && (layername == 'Bottleneck isolines')" class="card">
+      <img src="../application/assets/legend_contour_lines.png"
+           class="rounded mx-auto d-block">
+    </div>
+  </div>
 </template>
 
 <style lang="scss">
--- a/client/src/map/Maplayer.vue	Mon Oct 08 19:48:51 2018 +0200
+++ b/client/src/map/Maplayer.vue	Tue Oct 09 00:12:12 2018 +0200
@@ -292,7 +292,6 @@
       };
       return loader;
     },
-    // TODOISO call if new survey is selected
     updateBottleneckFilter(bottleneck_id, datestr) {
       console.log("updating filter with", bottleneck_id, datestr);
       var layer = this.getLayerByName("Bottleneck isolines");
@@ -503,8 +502,6 @@
         layer.data.getSource()
       )
     );
-    // TODOSTYLE add backend request (like search for 'HTTP')
-    // and use result to construct a new style like
     HTTP.get("/system/style/Bottlenecks/stroke", {
       headers: { "X-Gemma-Auth": localStorage.getItem("token") }
     })
@@ -538,9 +535,7 @@
     window.addEventListener("afterprint", this.onAfterPrint);
 
     // so none is shown
-    // this.updateBottleneckFilter("1999-10-01", "AT_Bottleneck_44");
-    // test date
-    this.updateBottleneckFilter("AT_Bottleneck_44", "2018-08-30");
+    this.updateBottleneckFilter("does_not_exist", "1999-10-01");
     this.activateIdentifyMode();
   }
 };
--- a/client/src/map/store.js	Mon Oct 08 19:48:51 2018 +0200
+++ b/client/src/map/store.js	Tue Oct 09 00:12:12 2018 +0200
@@ -194,7 +194,7 @@
             } // TODO  tile.setState(TileState.ERROR);
           })
         }),
-        isVisible: true
+        isVisible: false
       }
     ],
     // note that some identified features may not have an id