Skip to content

Commit

Permalink
Merge branch 'wegue-oss:master' into attribute-table-unregister-events
Browse files Browse the repository at this point in the history
  • Loading branch information
sronveaux authored Jun 20, 2024
2 parents 8995f6f + 85e4364 commit e7937c5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
10 changes: 6 additions & 4 deletions docs/wegue-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This describes the Wegue application configuration, which is modelled as JSON do

### colorTheme

Wegue supports the Vuetify (light and dark) theme configuration out of the box. This property expects a json object with the same format described in the [vuetify documentation](https://vuetifyjs.com/en/features/theme/#customizing).
Wegue supports the Vuetify (light and dark) theme configuration out of the box. This property expects a json object with the same format described in the [vuetify documentation](https://v2.vuetifyjs.com/en/features/theme/#customizing).

Example:
```json
Expand Down Expand Up @@ -76,6 +76,8 @@ In addition, Wegue also supports the following "on" colors:
| onprimary | color over primary color | typography/icons over primary color |
| onsecondary | color over secondary color | typography/icons over secondary color |

Moreover, custom colors which are not listed in the Vuetify documentation can also be defined here. Lighten and darken variants will also be generated for them like for the default ones.

To simplify the theming configuration, if the "themes" property isn't configured, Wegue will fallback to the default colors in the example above. Otherwise, both the "light" and "dark" themes will be built based on the respective configured colors. The following tables specify which colors are mandatory and their respective default values.

#### Light theme:
Expand Down Expand Up @@ -273,14 +275,14 @@ Below is an example for such a configuration object:

### legend

Wegue supports rendering of layer legend images, which will be displayed in the [LayerList module](module-configuration?id=LayerList). The optional property `legend` in the main Wegue configuration provides sensible defaults to legend request parameters for all layers in the application. This can be useful e.g. for parameters like fonts, font-sizes and other common options, which you want to share between all legends.
Wegue supports rendering of layer legend images, which will be displayed in the [LayerList module](module-configuration?id=LayerList). The optional property `legend` in the main Wegue configuration provides sensible defaults to legend request parameters for all layers in the application. This can be useful e.g. for parameters like fonts, font-sizes and other common options, which you want to share between all legends.

Supported options may be vendor specific, e.g. see [GeoServer Docs](https://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/index.html) for the options supported for WMS layers in GeoServer.

Example:
```json
"legend": {
"transparent": true,
"transparent": true,
"width": 14,
"height": 16,
}
Expand Down Expand Up @@ -596,7 +598,7 @@ Example configurations can be found in the `app-starter/static` directory. Below
"format": "MVT",
"attribution": "Kindly provided by @ahocevar",
"visible": false,
"opacityControl": true,
"opacityControl": true,
"style": {
"strokeColor": "gray",
"strokeWidth": 1,
Expand Down
16 changes: 16 additions & 0 deletions src/util/ColorTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ const ColorThemeUtil = {
merged.light.warning = light.warning ? light.warning : LIGHT_WARNING;
merged.light.error = light.error ? light.error : LIGHT_ERROR;

// apply unknown / custom theme properties to light theme
for (const themeProp in light) {
const hasProp = themeProp in merged.light;
if (!hasProp) {
merged.light[themeProp] = light[themeProp];
}
}

// If light theme is configured with at least the secondary color
if (!dark || !dark.secondary) {
// fallback to default dark theme
Expand Down Expand Up @@ -144,6 +152,14 @@ const ColorThemeUtil = {
merged.dark.warning = dark.warning ? dark.warning : DARK_WARNING;
merged.dark.error = dark.error ? dark.error : DARK_ERROR;

// apply unknown / custom theme properties to dark theme
for (const themeProp in dark) {
const hasProp = themeProp in merged.dark;
if (!hasProp) {
merged.dark[themeProp] = dark[themeProp];
}
}

return merged;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('maprecorder/MapRecorderWin.vue', () => {
expect(vm.error).to.equal(false);
// Supported codecs under chrome.
expect(vm.mimeType).to.equal('video/webm');
expect(vm.mimeTypes.length).to.equal(2);
expect(vm.mimeTypes.length).to.equal(3);
});

afterEach(() => {
Expand All @@ -65,9 +65,10 @@ describe('maprecorder/MapRecorderWin.vue', () => {

it('correct supported mime types under chrome', () => {
const mimeTypes = vm.getSupportedMimeTypes();
expect(mimeTypes.length).to.equal(2);
expect(mimeTypes.length).to.equal(3);
expect(mimeTypes[0]).to.equal('video/webm');
expect(mimeTypes[1]).to.equal('video/x-matroska');
expect(mimeTypes[1]).to.equal('video/mp4');
expect(mimeTypes[2]).to.equal('video/x-matroska');
});

it('start / stop recording sets correct states', () => {
Expand Down

0 comments on commit e7937c5

Please sign in to comment.