diff --git a/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.scss b/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.scss
index edc3985516..6024771745 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.scss
+++ b/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.scss
@@ -32,6 +32,7 @@
align-items: flex-start;
gap: 32px;
align-self: stretch;
+ margin-bottom: calc(24px + env(safe-area-inset-bottom));
}
.section {
diff --git a/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.ts b/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.ts
index 6a0cf2d13e..720815be34 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/map-layers-drawer-section/map-layers-drawer-section.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
+import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { SmkApi } from '@app/utils/smk';
@Component({
@@ -8,6 +8,9 @@ import { SmkApi } from '@app/utils/smk';
})
export class MapLayersDrawerSectionComponent implements OnChanges {
@Input() mapInitialized: boolean;
+ @Input() triggerRefresh: boolean;
+ @Output() triggerRefreshChange = new EventEmitter
();
+ @Output() layersChangedEvent = new EventEmitter();
activeWeatherStations = false;
airQuality = false; // TODO: add air quality layer
@@ -34,14 +37,18 @@ export class MapLayersDrawerSectionComponent implements OnChanges {
underControlWildfire = false;
wildfireOfNote = false;
+ constructor(private cdr: ChangeDetectorRef) {}
+
ngOnChanges(changes: SimpleChanges) {
console.log('onChanges', changes);
- if (this.mapInitialized) {
+ if (this.mapInitialized || (this.mapInitialized && this.triggerRefresh)) {
+ this.clearAll(false);
this.loadLayers();
}
}
- clearAll() {
+
+ clearAll(updateLayers: boolean) {
this.activeWeatherStations = false;
this.airQuality = false; // TODO: add air quality layer
this.areaRestrictions = false;
@@ -67,7 +74,9 @@ export class MapLayersDrawerSectionComponent implements OnChanges {
this.underControlWildfire = false;
this.wildfireOfNote = false;
- this.updateLayers();
+ if (updateLayers) {
+ this.updateLayers();
+ }
}
loadLayers() {
@@ -157,6 +166,9 @@ export class MapLayersDrawerSectionComponent implements OnChanges {
break;
}
});
+
+ this.triggerRefreshChange.emit(false);
+ this.cdr.detectChanges();
}
updateLayers() {
@@ -194,6 +206,7 @@ export class MapLayersDrawerSectionComponent implements OnChanges {
{ itemId: 'weather-stations', visible: this.activeWeatherStations },
];
- return smkApi.setDisplayContextItemsVisible(...layers);
+ smkApi.setDisplayContextItemsVisible(...layers);
+ this.layersChangedEvent.emit(true);
}
}
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.html b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.html
index 31da109613..53c9145f9c 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.html
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.html
@@ -3,7 +3,7 @@
To access this feature, please turn on location services in your device settings.
-
+
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.ts
index b3df00b5ad..ff488d6f63 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/dialog-location/dialog-location.component.ts
@@ -1,34 +1,49 @@
-import { Component } from '@angular/core';
-import { MatDialogRef } from '@angular/material/dialog';
-import { CapacitorService } from '@app/services/capacitor-service';
-import { NativeSettings, AndroidSettings, IOSSettings } from 'capacitor-native-settings';
-
+import { Component } from "@angular/core";
+import { MatDialogRef } from "@angular/material/dialog";
+import { CapacitorService } from "@app/services/capacitor-service";
+import {
+ AndroidSettings,
+ IOSSettings,
+ NativeSettings,
+} from "capacitor-native-settings";
@Component({
- selector: 'wfnews-dialog-location',
- templateUrl: './dialog-location.component.html',
- styleUrls: ['./dialog-location.component.scss']
+ selector: "wfnews-dialog-location",
+ templateUrl: "./dialog-location.component.html",
+ styleUrls: ["./dialog-location.component.scss"],
})
export class DialogLocationComponent {
- constructor(private dialogRef: MatDialogRef
, private capacitorService: CapacitorService) { }
+ showSettingsButton = false;
+
+ constructor(
+ private dialogRef: MatDialogRef,
+ private capacitorService: CapacitorService
+ ) {
+ this.checkOperatingSystem();
+ }
closeDialog() {
this.dialogRef.close();
}
-
+
+ async checkOperatingSystem() {
+ const device = await this.capacitorService.checkDeviceSystem();
+ this.showSettingsButton =
+ (device.operatingSystem === "ios" || device.operatingSystem === "android") &&
+ device.platform !== "web";
+ }
+
async goToSetting() {
- let device = (await this.capacitorService.checkDeviceSystem())
- if (device.operatingSystem === 'ios') {
+ const device = await this.capacitorService.checkDeviceSystem();
+ if (device.operatingSystem === "ios") {
NativeSettings.openIOS({
option: IOSSettings.App,
});
-
- }
- else if (device.operatingSystem === 'android') {
+ } else if (device.operatingSystem === "android") {
NativeSettings.openAndroid({
option: AndroidSettings.ApplicationDetails,
});
}
- this.dialogRef.close()
+ this.dialogRef.close();
}
}