Skip to content

Commit

Permalink
fix: fix extraction of legend url (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbllmnn authored Dec 9, 2022
1 parent f0dcf60 commit 931797e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/CapabilitiesUtil/CapabilitiesUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ class CapabilitiesUtil {
const wmsGetFeatureInfoConfig = _get(capabilities, 'Capability.Request.GetFeatureInfo');
const getMapUrl = _get(wmsGetMapConfig, 'DCPType[0].HTTP.Get.OnlineResource');
const getFeatureInfoUrl = _get(wmsGetFeatureInfoConfig, 'DCPType[0].HTTP.Get.OnlineResource');
const legendUrl = layersInCapabilities.length > 0
? _get(layersInCapabilities[0], 'Style[0].LegendURL[0].OnlineResource')
: null;

return layersInCapabilities.map((layerObj: any) => {
const title = _get(layerObj, 'Attribution.Title');
const onlineResource = _get(layerObj, 'Attribution.OnlineResource');
const attributions = [onlineResource ? `<a target="_blank" href="${onlineResource}">${title}</a>` : title];
const legendUrl = _get(layerObj, 'Style[0].LegendURL[0].OnlineResource');

return new OlLayerImage({
opacity: 1,
Expand Down

0 comments on commit 931797e

Please sign in to comment.