diff --git a/app-starter/static/app-conf-projected.json b/app-starter/static/app-conf-projected.json index 1e558bd1..b5db21f3 100644 --- a/app-starter/static/app-conf-projected.json +++ b/app-starter/static/app-conf-projected.json @@ -89,6 +89,7 @@ "selectable": true, "hoverable": true, "hoverAttribute": "naam", + "opacityControl": true, "style": { "strokeColor": "white", "strokeWidth": 2, @@ -111,6 +112,7 @@ "tileGridRef": "dutch_rd", "isBaseLayer": false, "visible": false, + "opacityControl": true, "crossOrigin": "anonymous" }, { diff --git a/app-starter/static/app-conf-sidebar.json b/app-starter/static/app-conf-sidebar.json index bfda360c..eabfca96 100644 --- a/app-starter/static/app-conf-sidebar.json +++ b/app-starter/static/app-conf-sidebar.json @@ -163,7 +163,8 @@ "isBaseLayer": false, "visible": false, "displayInLayerList": true, - "legend": true + "legend": true, + "opacityControl": true }, { "type": "IMAGEWMS", @@ -176,7 +177,8 @@ "attribution": "Kindly provided by @ahocevar", "isBaseLayer": false, "visible": false, - "displayInLayerList": true + "displayInLayerList": true, + "opacityControl": true }, { "type": "VECTORTILE", @@ -185,6 +187,7 @@ "format": "MVT", "visible": false, "attribution": "Kindly provided by @ahocevar", + "opacityControl": true, "style": { "strokeColor": "gray", "strokeWidth": 1, diff --git a/app-starter/static/app-conf.json b/app-starter/static/app-conf.json index 3aaeab45..b5e1ba64 100644 --- a/app-starter/static/app-conf.json +++ b/app-starter/static/app-conf.json @@ -156,7 +156,8 @@ "isBaseLayer": false, "visible": false, "displayInLayerList": true, - "legend": true + "legend": true, + "opacityControl": true }, { "type": "IMAGEWMS", @@ -170,7 +171,8 @@ "attribution": "Kindly provided by @ahocevar", "isBaseLayer": false, "visible": false, - "displayInLayerList": true + "displayInLayerList": true, + "opacityControl": true }, { "type": "VECTORTILE", @@ -179,6 +181,7 @@ "format": "MVT", "attribution": "Kindly provided by @ahocevar", "visible": false, + "opacityControl": true, "style": { "strokeColor": "gray", "strokeWidth": 1, diff --git a/docs/map-layer-configuration.md b/docs/map-layer-configuration.md index 2cc161e8..a467e6bb 100644 --- a/docs/map-layer-configuration.md +++ b/docs/map-layer-configuration.md @@ -15,6 +15,7 @@ The following properties can be applied to all map layer types | visible | Boolean value, whether the layer should be initially visible. Defaults to `true`. | `"visible": false` | | extent | Array containing the bounding extent for layer rendering. The layer will not be rendered outside of this extent. Per default the extent of the layer is not constrained. | `"extent": [600584.4677702306, 5906357.431606389, 1864172.5237905537, 7388769.588491274]` | | opacity | Numeric value ranging from 0 to 1 describing the opaqueness of the layer. Defaults to `1.0`. | `"opacity": 0.5` | +| opacityControl | Boolean value, whether a slider control to customize the layers opacity should appear in the LayerList. Defaults to `false`. | `"opacityControl": true`| | zIndex | Numeric value specifying the stack order of layers. Layers will be ordered by z-index and then by order of declaration. Defaults to `-1` for background layers and `0` for all other layers. | `"zIndex": 2` | | displayInLayerList | Boolean value, whether the layer should appear in the LayerList. Ignored if the layer is a background layer - see option `isBaseLayer` | `"displayInLayerList": true` | | supportsPermalink | Boolean value, whether the layers state should be considered in permanent links - see also [permalink](wegue-configuration?id=permalink). Defaults to `true`. | `"supportsPermalink": true` | diff --git a/docs/module-configuration.md b/docs/module-configuration.md index c2a25a16..9ad2a180 100644 --- a/docs/module-configuration.md +++ b/docs/module-configuration.md @@ -88,6 +88,7 @@ Module identifier: `wgu-layerlist` | Property | Meaning | Example | |----------------------|:---------:|---------| | showLegends | Flag to enable/disable rendering of layer legend images in the LayerList. Defaults to `true`. | `"showLegends": false` | +| showOpacityControls | Flag to enable/disable rendering of slider controls to customize the layers opacity. Defaults to `true`. | `"showOpacityControls": false` | ## MeasureTool diff --git a/docs/wegue-configuration.md b/docs/wegue-configuration.md index 5f8e7173..99963957 100644 --- a/docs/wegue-configuration.md +++ b/docs/wegue-configuration.md @@ -540,11 +540,14 @@ Example configurations can be found in the `app-starter/static` directory. Below "attribution": "Kindly provided by @ahocevar", "isBaseLayer": false, "visible": false, - "displayInLayerList": true + "displayInLayerList": true, + "legend": true, + "opacityControl": true }, { "type": "IMAGEWMS", "lid": "ahocevar-imagewms", + "ratio": 1.5, "format": "image/png", "layers": "ne:ne_10m_populated_places", "url": "https://ahocevar.com/geoserver/wms", @@ -553,14 +556,17 @@ Example configurations can be found in the `app-starter/static` directory. Below "attribution": "Kindly provided by @ahocevar", "isBaseLayer": false, "visible": false, - "displayInLayerList": true + "displayInLayerList": true, + "opacityControl": true }, { "type": "VECTORTILE", "lid": "ahocevar-vectortyle", "url": "https://ahocevar.com/geoserver/gwc/service/tms/1.0.0/ne:ne_10m_admin_0_countries@EPSG%3A900913@pbf/{z}/{x}/{-y}.pbf", "format": "MVT", + "attribution": "Kindly provided by @ahocevar", "visible": false, + "opacityControl": true, "style": { "strokeColor": "gray", "strokeWidth": 1, @@ -662,6 +668,11 @@ Example configurations can be found in the `app-starter/static` directory. Below }, "wgu-localeswitcher": { "target": "toolbar" + }, + "sample-module": { + "target": "toolbar", + "win": "floating", + "icon": "star" } } } diff --git a/src/components/layerlist/LayerList.vue b/src/components/layerlist/LayerList.vue index 0de102a2..80921841 100644 --- a/src/components/layerlist/LayerList.vue +++ b/src/components/layerlist/LayerList.vue @@ -6,7 +6,8 @@ :key="layer.get('lid')" :layer="layer" :mapView="map.getView()" - :showDetails="showDetails(layer)" + :showLegends="showLegends" + :showOpacityControls="showOpacityControls" /> @@ -22,7 +23,8 @@ }, mixins: [Mapable], props: { - showLegends: { type: Boolean, required: true } + showLegends: { type: Boolean, required: true }, + showOpacityControls: { type: Boolean, required: true } }, data () { return { @@ -36,12 +38,6 @@ */ onMapBound () { this.layers = this.map.getLayers().getArray(); - }, - /** - * Returns true, if the layer item should show an extension slider with layer details. - **/ - showDetails (layer) { - return this.showLegends && !!layer.get('legend'); } }, computed: { diff --git a/src/components/layerlist/LayerListItem.vue b/src/components/layerlist/LayerListItem.vue index eabd9a71..9b78b971 100644 --- a/src/components/layerlist/LayerListItem.vue +++ b/src/components/layerlist/LayerListItem.vue @@ -18,7 +18,17 @@ {{ layer.get('name') }} - + + + +