Browse Source
Merge pull request #6091 from vvlladd28/bug/image-map/load-background-image
[3.3.4] UI: Fixed image map widget not updated image after firt load empty data
pull/6106/head
Igor Kulikov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/common-maps-utils.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/providers/image-map.ts
|
|
|
@ -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,8 +94,10 @@ export class ImageMap extends LeafletMap { |
|
|
|
type: widgetType.latest, |
|
|
|
callbacks: { |
|
|
|
onDataUpdated: (subscription) => { |
|
|
|
result.next([subscription.data[0]?.data, isUpdate]); |
|
|
|
isUpdate = true; |
|
|
|
if (subscription.data[0]?.data[0]?.length > 0) { |
|
|
|
result.next([subscription.data[0].data, isUpdate]); |
|
|
|
isUpdate = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
@ -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], |
|
|
|
|