UI: Fixed image map widget - incorrect process first empty data
This commit is contained in:
		
							parent
							
								
									58461c8106
								
							
						
					
					
						commit
						ca7da9e396
					
				@ -123,6 +123,7 @@ export function aspectCache(imageUrl: string): Observable<number> {
 | 
			
		||||
      return aspect;
 | 
			
		||||
    }));
 | 
			
		||||
  }
 | 
			
		||||
  return of(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export type TranslateFunc = (key: string, defaultTranslation?: string) => string;
 | 
			
		||||
 | 
			
		||||
@ -94,10 +94,12 @@ export class ImageMap extends LeafletMap {
 | 
			
		||||
        type: widgetType.latest,
 | 
			
		||||
        callbacks: {
 | 
			
		||||
          onDataUpdated: (subscription) => {
 | 
			
		||||
            result.next([subscription.data[0]?.data, isUpdate]);
 | 
			
		||||
            if (subscription.data[0]?.data[0]?.length > 0) {
 | 
			
		||||
              result.next([subscription.data[0].data, isUpdate]);
 | 
			
		||||
              isUpdate = true;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      };
 | 
			
		||||
      this.ctx.subscriptionApi.createSubscription(imageUrlSubscriptionOptions, true).subscribe((subscription) => {
 | 
			
		||||
        const pageLink: EntityDataPageLink = {
 | 
			
		||||
@ -126,7 +128,6 @@ export class ImageMap extends LeafletMap {
 | 
			
		||||
 | 
			
		||||
    private imageFromAlias(alias: Observable<[DataSet, boolean]>): Observable<MapImage> {
 | 
			
		||||
      return alias.pipe(
 | 
			
		||||
        filter(result => result[0].length > 0),
 | 
			
		||||
        mergeMap(res => {
 | 
			
		||||
          const mapImage: MapImage = {
 | 
			
		||||
            imageUrl: res[0][0][1],
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user