Skip to content

Commit

Permalink
Merge pull request #231 from laughing0li/master
Browse files Browse the repository at this point in the history
remove wms previews or legends when blank
  • Loading branch information
jia020 authored Feb 14, 2023
2 parents c9d09f9 + db8392b commit fe1ed30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</p>
</div>
<p *ngIf="wmsUrl!=undefined">
<b>WMS Preview: </b><img appImgLoading src="{{wmsUrl}}" height="100" width="100"/>
<b>WMS Preview: </b><img appImgLoading src="{{wmsUrl}}" (error)="onImgError($event)" height="100" width="100"/>
</p>
<p *ngIf="legendUrl!=undefined">
<b>Legend: </b><img appImgLoading src="{{legendUrl}}" class="infopanel-legend"/>
<b>Legend: </b><img appImgLoading src="{{legendUrl}}" (error)="onImgError($event)" class="infopanel-legend"/>
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ export class InfoPanelSubComponent implements OnChanges {
+ ',' + bbox.eastBoundLongitude + ',' + bbox.northBoundLatitude
+ '&WIDTH=400&HEIGHT=400';
this.wmsUrl = UtilitiesService.addUrlParameters(UtilitiesService.rmParamURL(onlineResources[j].url), params);
console.log(this.wmsUrl)
}
}
}
}
public onImgError(event: Event) {
// (event.target as HTMLImageElement).style.display = 'none';
(event.target as HTMLImageElement).parentElement.style.display = 'none';
}

}

0 comments on commit fe1ed30

Please sign in to comment.