Fix unfurls for lightning pages with no geodata
This commit is contained in:
parent
d931ddc731
commit
4ca87e730c
@ -58,7 +58,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md map-col">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md map-col">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,6 +22,7 @@ export class NodesChannelsMap implements OnInit {
|
|||||||
@Input() channel: any[] = [];
|
@Input() channel: any[] = [];
|
||||||
@Input() fitContainer = false;
|
@Input() fitContainer = false;
|
||||||
@Input() hasLocation = true;
|
@Input() hasLocation = true;
|
||||||
|
@Input() placeholder = false;
|
||||||
@Output() readyEvent = new EventEmitter();
|
@Output() readyEvent = new EventEmitter();
|
||||||
|
|
||||||
channelsObservable: Observable<any>;
|
channelsObservable: Observable<any>;
|
||||||
@ -201,11 +202,26 @@ export class NodesChannelsMap implements OnInit {
|
|||||||
|
|
||||||
prepareChartOptions(nodes, channels) {
|
prepareChartOptions(nodes, channels) {
|
||||||
let title: object;
|
let title: object;
|
||||||
if (channels.length === 0) {
|
if (channels.length === 0 && !this.placeholder) {
|
||||||
this.chartOptions = null;
|
this.chartOptions = null;
|
||||||
return;
|
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 = {
|
this.chartOptions = {
|
||||||
silent: this.style === 'widget',
|
silent: this.style === 'widget',
|
||||||
title: title ?? undefined,
|
title: title ?? undefined,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user