Skip to content

Commit

Permalink
feat: set legendUrl for wmts layers
Browse files Browse the repository at this point in the history
  • Loading branch information
mholthausen committed Dec 9, 2022
1 parent fe7359f commit a5d6a79
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/parser/SHOGunApplicationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,19 @@ class SHOGunApplicationUtil<T extends Application, S extends Layer> {

source.set('matrixSizes', matrixSizes);

let legendUrl = '';
capabilities.Contents?.Layer?.forEach((l: any) => {
if (l.Identifier === layerNames) {
l.Style?.forEach((s: any) => {
if (s.LegendURL) {
legendUrl = s.LegendURL[0].href;
}
});
}
});

source.set('legendUrl', legendUrl);

const wmtsLayer = new OlTileLayer({
source,
minResolution,
Expand Down

0 comments on commit a5d6a79

Please sign in to comment.