mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Merge pull request #2414 from mononaut/fix-ln-map-unfurls
Fix unfurls for lightning pages with no geodata
This commit is contained in:
commit
a83b2ddeea
@ -58,7 +58,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md map-col">
|
||||
<app-nodes-channels-map *ngIf="!error" [style]="'channelpage'" [channel]="channelGeo" [fitContainer]="true" (readyEvent)="onMapReady()"></app-nodes-channels-map>
|
||||
<app-nodes-channels-map *ngIf="!error" [style]="'channelpage'" [channel]="channelGeo" [fitContainer]="true" [placeholder]="true" (readyEvent)="onMapReady()"></app-nodes-channels-map>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md map-col">
|
||||
<app-nodes-channels-map *ngIf="!error" [style]="'nodepage'" [publicKey]="node.public_key" [fitContainer]="true" (readyEvent)="onMapReady()"></app-nodes-channels-map>
|
||||
<app-nodes-channels-map *ngIf="!error" [style]="'nodepage'" [publicKey]="node.public_key" [fitContainer]="true" [placeholder]="true" [hasLocation]="!!node.as_number" (readyEvent)="onMapReady()"></app-nodes-channels-map>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,6 +22,7 @@ export class NodesChannelsMap implements OnInit {
|
||||
@Input() channel: any[] = [];
|
||||
@Input() fitContainer = false;
|
||||
@Input() hasLocation = true;
|
||||
@Input() placeholder = false;
|
||||
@Output() readyEvent = new EventEmitter();
|
||||
|
||||
channelsObservable: Observable<any>;
|
||||
@ -201,11 +202,26 @@ export class NodesChannelsMap implements OnInit {
|
||||
|
||||
prepareChartOptions(nodes, channels) {
|
||||
let title: object;
|
||||
if (channels.length === 0) {
|
||||
if (channels.length === 0 && !this.placeholder) {
|
||||
this.chartOptions = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// empty map fallback
|
||||
if (channels.length === 0 && this.placeholder) {
|
||||
title = {
|
||||
textStyle: {
|
||||
color: 'white',
|
||||
fontSize: 18
|
||||
},
|
||||
text: $localize`No geolocation data available`,
|
||||
left: 'center',
|
||||
top: 'center'
|
||||
};
|
||||
this.zoom = 1.5;
|
||||
this.center = [0, 20];
|
||||
}
|
||||
|
||||
this.chartOptions = {
|
||||
silent: this.style === 'widget',
|
||||
title: title ?? undefined,
|
||||
|
Loading…
Reference in New Issue
Block a user