Skip to content

Commit

Permalink
🐛 Get legend from wms layer through internal qgisserver if set intern…
Browse files Browse the repository at this point in the history
…al (#714)

* 🐛 Get legend from wms layer through internal qgisserver if set internal

* 🐛 show loading legend image bar

* ✨ Set legend tab background color transparent or white based on transparent legend setting value

(cherry picked from commit dcce3b7)
  • Loading branch information
volterra79 authored and github-actions[bot] committed Feb 5, 2025
1 parent e149eb1 commit e595354
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/components/Catalog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
role = "tabpanel"
id = "legend"
class = "tab-pane"
:style = "{ backgroundColor: backgroundLegend }"
:class = "{ active: 'legend' === activeTab }"
>
<div v-for = "t in tree.tree" class = "legend-item"> <!-- TODO: check if such nesting level really necessary.. -->
Expand Down Expand Up @@ -320,6 +321,7 @@ export default {
legend_position: ApplicationState.project.state.legend_position || 'tab',
iframe: ApplicationState.iframe,
showlegend: false,
backgroundLegend: ApplicationState.gui.layout.app.legend.transparent ? 'transparent' : '#FFFFFF', //@since 3.11.3 set transparent or white background
currentBaseLayer: null,
activeTab: 'layers',
loading: false,
Expand Down Expand Up @@ -370,13 +372,13 @@ export default {

methods: {

onLegendError(legendurl) {
legendurl.error = true;
legendurl.loading = false;
onLegendError(url) {
url.error = true;
url.loading = false;
},

onLegendLoad(legendurl) {
legendurl.loading = false;
onLegendLoad(url) {
url.loading = false;
},

/**
Expand Down Expand Up @@ -522,8 +524,6 @@ export default {
} catch (e) {
console.warn(e);
}

obj.loading = false;
}
}
return legendurls;
Expand Down
2 changes: 1 addition & 1 deletion src/map/layers/imagelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ class ImageLayer extends GeoLayerMixin(Layer) {
return (
source && (
('map' !== type || (this.isExternalWMS() && this.isLayerProjectionASMapProjection())) &&
('legend' === type || source.external)
('legend' !== type || source.external)
)
);
}
Expand Down

0 comments on commit e595354

Please sign in to comment.