diff --git a/app-starter/WguAppTemplate.vue b/app-starter/WguAppTemplate.vue index 285d3709..0dd4f9b3 100644 --- a/app-starter/WguAppTemplate.vue +++ b/app-starter/WguAppTemplate.vue @@ -35,6 +35,7 @@ + @@ -69,6 +70,7 @@ import AppSidebar from './components/AppSidebar' import AppLogo from '../src/components/AppLogo' import BgLayerSwitcher from '../src/components/bglayerswitcher/BgLayerSwitcher.vue' + import OverviewMap from '../src/components/overviewmap/OverviewMap.vue' import MeasureWin from '../src/components/measuretool/MeasureWin' import LayerListWin from '../src/components/layerlist/LayerListWin' import HelpWin from '../src/components/helpwin/HelpWin' @@ -86,6 +88,7 @@ 'wgu-app-sidebar': AppSidebar, 'wgu-app-logo': AppLogo, 'wgu-bglayerswitcher': BgLayerSwitcher, + 'wgu-overviewmap': OverviewMap, 'wgu-measuretool-win': MeasureWin, 'wgu-layerlist-win': LayerListWin, 'wgu-helpwin-win': HelpWin, @@ -98,6 +101,7 @@ return { isEmbedded: false, sidebarConfig: this.getSidebarConfig(), + overviewMapConfig: this.getOverviewMapConfig(), floatingWins: this.getModuleWinData('floating'), sidebarWins: this.getModuleWinData('sidebar'), showCopyrightYear: Vue.prototype.$appConfig.showCopyrightYear @@ -131,6 +135,14 @@ const appConfig = Vue.prototype.$appConfig || {}; return appConfig['sidebar']; }, + /** + * Returns the configuration object for the overview map from app-config. + * @return {Object} Overview map configuration object. + */ + getOverviewMapConfig () { + const appConfig = Vue.prototype.$appConfig || {}; + return appConfig['overviewMap']; + }, /** * Determines the module window configuration objects from app-config: * moduleWins: [ diff --git a/app-starter/static/app-conf-projected.json b/app-starter/static/app-conf-projected.json index c1e9698d..5fab018f 100644 --- a/app-starter/static/app-conf-projected.json +++ b/app-starter/static/app-conf-projected.json @@ -42,6 +42,10 @@ ] ], + "overviewMap" : { + "visible": false + }, + "viewAnimation": { "type": "fly", "options": { diff --git a/app-starter/static/app-conf-sidebar.json b/app-starter/static/app-conf-sidebar.json index 6dcb3b2b..178279fc 100644 --- a/app-starter/static/app-conf-sidebar.json +++ b/app-starter/static/app-conf-sidebar.json @@ -27,6 +27,10 @@ "displayInLayerList": true }, + "overviewMap" : { + "visible": false + }, + "viewAnimation": { "type": "fly", "options": { diff --git a/app-starter/static/app-conf.json b/app-starter/static/app-conf.json index ced664d3..44ea0313 100644 --- a/app-starter/static/app-conf.json +++ b/app-starter/static/app-conf.json @@ -27,6 +27,10 @@ "displayInLayerList": true }, + "overviewMap" : { + "visible": false + }, + "viewAnimation": { "type": "fly", "options": { diff --git a/docs/wegue-configuration.md b/docs/wegue-configuration.md index a6dd353d..de0483b1 100644 --- a/docs/wegue-configuration.md +++ b/docs/wegue-configuration.md @@ -21,6 +21,7 @@ This describes the Wegue application configuration, which is modelled as JSON do | mapGeodataDragDop | Configuration object for geodata file drag/drop functionality on the map. Only by setting the config this function will be enabled. | see [mapGeodataDragDop](wegue-configuration?id=mapGeodataDragDop) | | **modules** | Array of module configuration objects | See [modules](module-configuration) | | **mapLayers** | Array of map layer configuration objects | See [mapLayers](map-layer-configuration) | +| overviewMap | Configuration object for the overview map. | See [overviewMap](wegue-configuration?id=overviewMap) | projectionDefs | Array of CRS / projection definition objects compatible to proj4js | See [projectionDefs](wegue-configuration?id=projectiondefs) | | tileGridDefs | Array of tile grid definition objects | See [tileGridDefs](wegue-configuration?id=tilegriddefs) | | viewAnimation | Configuration object for view animations | See [viewAnimation](wegue-configuration?id=viewAnimation) | @@ -303,6 +304,31 @@ Below is an example for a sidebar configuration object: } ``` +### overviewMap +Wegue integrates an overview map control, if the optional `overviewMap` property is declared. + +The `overviewMap` object supports the following properties: + +| Property | Meaning | Example | +|--------------------|:---------:|---------| +| icon | Provide a customized map icon. Defaults to `zoom_out_map`. | `"icon": "zoom_out_map"` | +| visible | Specifies whether the overviewMap appears in open or closed state on application start. Defaults to true. | `"visible": true` | +| rotateWithView | Whether the control view should rotate with the main map view. Defaults to true. | `"rotateWithView": true` | +| width | Width of the overview map panel in viewport coordinates. Defaults to 164px. | `"width": 164` | +| height | Height of the overview map panel in viewport coordinates. Defaults to 178px. | `"height": 178` | + +Below is an example for an overview map configuration object: + + +``` + "overviewMap": { + "visible": true, + "rotateWithView": true, + "width": 164, + "height": 178 + } +``` + ## Example configuration Example configurations can be found in the `app-starter/static` directory. Below an example as used in the Demo: @@ -311,7 +337,7 @@ Example configurations can be found in the `app-starter/static` directory. Below { "colorTheme": { - "dark": false, + "dark": false }, "logo": "https://dummyimage.com/100x100/aaa/fff&text=Wegue", @@ -337,6 +363,10 @@ Example configurations can be found in the `app-starter/static` directory. Below "displayInLayerList": true }, + "overviewMap" : { + "visible": false + }, + "viewAnimation": { "type": "fly", "options": { @@ -560,6 +590,10 @@ Example configurations can be found in the `app-starter/static` directory. Below "wgu-geolocator": { "target": "toolbar" }, + "wgu-themeswitcher": { + "target": "toolbar", + "icon": "dark_mode" + }, "wgu-attributetable": { "target": "menu", "win": "floating", diff --git a/src/assets/css/wegue.css b/src/assets/css/wegue.css index c75926f0..01c229c7 100644 --- a/src/assets/css/wegue.css +++ b/src/assets/css/wegue.css @@ -25,20 +25,59 @@ html { bottom: 45px; } -.wgu-bglayerswitcher { +/* + Common style for action buttons placed over the map. + This is to match the look and feel of the OL buttons to give + them a border for better map contrast. +*/ +.wgu-map-button { position: absolute; z-index: 2; - left: 15px; - top: 70px; padding: 3px; border-radius: 50%; - background-color: rgba(255,255,255,0.4) !important; + background-color: rgba(255,255,255,0.4) !important; } -.wgu-bglayerswitcher:hover { +.wgu-map-button:hover { background-color: rgba(255,255,255,0.6) !important; } +/* + Background layer switcher positioning and styles. +*/ +.wgu-bglayerswitcher { + left: 15px; + top: 70px; +} + +/* + Overview map positioning and styles. +*/ +.wgu-overviewmap { + left: 15px; + top: calc(50% - 23px); +} + +.wgu-overviewmap-ctrl { + position: relative; +} + +.wgu-overviewmap-ctrl, +.wgu-overviewmap-ctrl.ol-uncollapsible { + width: 100%; + height: 100%; +} + +.wgu-overviewmap-ctrl .ol-overviewmap-map { + border: none; + width: 100%; + height: 100%; +} + +.wgu-overviewmap-ctrl .ol-overviewmap-box { + border: 2px dotted var(--v-secondary-base); +} + /* TODO Review ccs colorization. Used to force the onprimary color for solo fields (light theme only). diff --git a/src/components/bglayerswitcher/BgLayerSwitcher.vue b/src/components/bglayerswitcher/BgLayerSwitcher.vue index a3d0ec45..a60ae3fb 100644 --- a/src/components/bglayerswitcher/BgLayerSwitcher.vue +++ b/src/components/bglayerswitcher/BgLayerSwitcher.vue @@ -7,7 +7,7 @@ attach="#wgu-bglayerswitcher-wrapper" >