Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legend show/collapse, and legend for QGIS #5517

Merged
merged 2 commits into from
Feb 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions contribs/gmf/src/layertree/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,19 @@ Controller.prototype.getLegendsObject = function(treeCtrl) {
const scale = this.getScale_();
// QGIS can handle multiple layers natively. Use Multiple URLs for other map
// servers
if (gmfOgcServer.type !== ServerType.QGISSERVER) {
const layerNamesList = layersNames.split(',');
layerNamesList.forEach((layerName) => {
const wmtsLegendURL = this.layerHelper_.getWMSLegendURL(gmfOgcServer.url, layerName, scale);
if (!wmtsLegendURL) {
throw new Error('Missing wmtsLegendURL');
}
legendsObject[layerName] = wmtsLegendURL;
});
let layerNamesList;
if (gmfOgcServer.type === ServerType.QGISSERVER) {
layerNamesList = [layersNames];
} else {
layerNamesList = layersNames.split(',');
}
layerNamesList.forEach((layerName) => {
const wmtsLegendURL = this.layerHelper_.getWMSLegendURL(gmfOgcServer.url, layerName, scale);
if (!wmtsLegendURL) {
throw new Error('Missing wmtsLegendURL');
}
legendsObject[layerName] = wmtsLegendURL;
});
return legendsObject;
}
};
Expand Down Expand Up @@ -933,7 +936,7 @@ Controller.prototype.toggleSwipeLayer = function(treeCtrl) {
Controller.prototype.toggleNodeLegend = function(legendNodeId) {
const div = document.querySelector(legendNodeId);
if (div) {
div.classList.toggle('d-none');
div.classList.toggle('show');
adube marked this conversation as resolved.
Show resolved Hide resolved
}
};

Expand Down