From 8df4b458992635469a6fd28639c469afed3cb8c2 Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Fri, 13 Oct 2023 08:55:19 -0700 Subject: [PATCH 1/6] wip --- .../active-wildfire-map.component.html | 4 ++-- .../active-wildfire-map.component.ts | 24 +++++++++++++++++-- .../wf-map-container.component.ts | 4 ++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html index b88c09d1f2..7ac733006a 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html +++ b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html @@ -147,14 +147,14 @@

selectedPanel === 'local-authorities' ? 'Local Authorities' : ''}}
- +
diff --git a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts index af98654896..704ea4b145 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, Component, ElementRef, Input, NgZone, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, NgZone, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; import { MatExpansionPanel } from '@angular/material/expansion'; import { AppConfigService } from '@wf1/core-ui'; @@ -30,6 +30,7 @@ declare const window: any; selector: 'active-wildfire-map', templateUrl: './active-wildfire-map.component.html', styleUrls: ['./active-wildfire-map.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush }) export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { @Input() incidents: any; @@ -64,7 +65,7 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { markers: any[]; url; sortedAddressList: string[]; - + temp: any[] =[]; public isMobileView = mobileView public snowPlowHelper = snowPlowHelper @@ -77,6 +78,7 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { private publishedIncidentService: PublishedIncidentService, private commonUtilityService: CommonUtilityService, protected dialog: MatDialog, + protected cdr: ChangeDetectorRef ) { this.incidentsServiceUrl = this.appConfig.getConfig().rest['newsLocal']; this.placeData = new PlaceData(); @@ -503,4 +505,22 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { return 'Disclaimer and Legal Links'; } } + + selectIncidents(incidentRefs){ + const SMK = window['SMK']; + let viewer = null; + for (const smkMap in SMK.MAP) { + if (Object.prototype.hasOwnProperty.call(SMK.MAP, smkMap)) { + viewer = SMK.MAP[smkMap].$viewer; + incidentRefs = viewer.identified.featureSet + let temp = Object.keys(incidentRefs).map(key => incidentRefs[key]); + if (temp.length) { + console.log(temp.length) + this.temp = temp + this.cdr.detectChanges(); + } + } + } + + } } diff --git a/client/wfnews-war/src/main/angular/src/app/components/wf-map-container/wf-map-container.component.ts b/client/wfnews-war/src/main/angular/src/app/components/wf-map-container/wf-map-container.component.ts index 29fea6f95a..03e73343d5 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/wf-map-container/wf-map-container.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/components/wf-map-container/wf-map-container.component.ts @@ -3,6 +3,7 @@ import { PointIdService } from '../../services/point-id.service'; import { WFMapService } from '../../services/wf-map.service'; import { IncidentIdentifyPanelComponent } from '../incident-identify-panel/incident-identify-panel.component'; import { WeatherPanelComponent } from '../weather-panel/weather-panel.component'; +import { ActiveWildfireMapComponent } from '@app/components/active-wildfire-map/active-wildfire-map.component'; let mapIndexAuto = 0; let initPromise = Promise.resolve(); @@ -113,6 +114,9 @@ export class WFMapContainerComponent implements OnDestroy, OnChanges { addSelectedIncidentPanels (smk) { const self = this; const identified = smk.$viewer.identified; + let mobileCompRef = self.makeComponent(ActiveWildfireMapComponent); + (mobileCompRef.instance as any).selectIncidents(identified.featureSet); + for (const fid in identified.featureSet) { if (Object.prototype.hasOwnProperty.call(identified.featureSet, fid)) { const feature = identified.featureSet[fid]; From 20a9b0f0296985804e9a4e31fe2513b2b36e856f Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Fri, 13 Oct 2023 14:05:35 -0700 Subject: [PATCH 2/6] panel list --- .../src/main/angular/src/app/app.component.ts | 5 +++ .../active-wildfire-map.component.html | 34 +++++++++++-------- .../active-wildfire-map.component.scss | 28 +++++++++++++++ .../active-wildfire-map.component.ts | 22 +++++++++++- .../wf-map-container.component.ts | 5 +-- .../src/assets/images/svg-icons/arrow.svg | 6 ++++ 6 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 client/wfnews-war/src/main/angular/src/assets/images/svg-icons/arrow.svg diff --git a/client/wfnews-war/src/main/angular/src/app/app.component.ts b/client/wfnews-war/src/main/angular/src/app/app.component.ts index 4397ec5faf..b34da2f5ef 100644 --- a/client/wfnews-war/src/main/angular/src/app/app.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/app.component.ts @@ -49,6 +49,7 @@ export const ICON = { MORE: 'more', REPORT: 'report', SAVED: 'saved', + ARROW: 'arrow', }; @Component({ @@ -454,6 +455,10 @@ export class AppComponent implements OnDestroy, OnInit, AfterViewInit { ICON.SAVED, this.domSanitizer.bypassSecurityTrustResourceUrl('assets/images/svg-icons/saved.svg') ); + this.matIconRegistry.addSvgIcon( + ICON.ARROW, + this.domSanitizer.bypassSecurityTrustResourceUrl("assets/images/svg-icons/arrow.svg") + ); } isAdminPage() { diff --git a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html index 7ac733006a..fc7f438bcc 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html +++ b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.html @@ -132,21 +132,27 @@

local_fire_department{{ activeFireCount | async }} Active Wildfires
- + -
-
-
-
{{selectedPanel === 'wildfire-stage-of-control' ? 'Wildfires' : - selectedPanel === 'evacuation-orders-and-alerts' ? 'Evacuation Orders' : - selectedPanel === 'area-restrictions' ? 'Area Restrictions' : - selectedPanel === 'bans-and-prohibitions' ? 'Bans & Prohibitions' : - selectedPanel === 'smoke-forecast' ? 'smoke-forecast' : - selectedPanel === 'fire-danger' ? 'Fire Danger' : - selectedPanel === 'routes-impacted' ? 'Drive BC' : - selectedPanel === 'local-authorities' ? 'Local Authorities' : ''}}
-
-
+
+ +
+
+ {{incidentRefs.length}} Results +
+
+
Wildfires
+
+
+ {{wildfire.title}} + +
+
+ +
+ - + +
+
Area Restrictions
+
+
+
+ + {{areaRestriction.properties.NAME}} +
+
+ +
+
+
+
+ +
+
Fire Bans and Prohibitions
+
+
+
+ + Fire Ban on {{ban.title}} +
+
+ +
+
+
+
+ +
+
Fire Danger Rating
+
+
+
+
+ + {{danger.properties.DANGER_RATING_DESC}} Fire Danger +
+
+ + {{danger.properties.DANGER_RATING_DESC}} Fire Danger +
+
+ + {{danger.properties.DANGER_RATING_DESC}} Fire Danger +
+
+ + {{danger.properties.DANGER_RATING_DESC}} Fire Danger +
+
+ + {{danger.properties.DANGER_RATING_DESC}} Fire Danger +
+
+
+ +
+
+
+
+ +
+
Road Events
+
+
+
+ + {{event.title}} +
+
+ +
+
+
+
+ +
+
Closed Recreation Sites
+
+
+
+ + {{closedRecreationSite.title}} +
+
+ +
+
+
+
+ +
+
Forest Service Roads
+
+
+
+ {{forestServiceRoad.title}} +
+
+ +
+
+
+
+ +
+
Protected Lands Access Restrictions
+
+
+
+ {{protectedLandsAccessRestriction.title}} +
+
+ +
+
+
+
+ +
+
Regional Districts
+
+
+
+ + {{regionalDistrict.title}} +
+
+ +
+
+
+
+ +
+
Municipalities
+
+
+
+ + {{municipality.title}} +
+
+ +
+
+
+
+ +
+
First Nations Treaty Land
+
+
+
+ + {{firstNationsTreatyLand.title}} +
+
+ +
+
+
+
+ +
+
Indian Reserve
+
+
+
+ + {{indianReserve.title}} +
+
+ +
+
+
+
diff --git a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts index b758cbe021..074785205d 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts @@ -67,8 +67,21 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { sortedAddressList: string[]; incidentRefs: any[]; filteredWildfires: any[]; + filteredFirePerimeters: any[]; filteredEvacs: any[]; - showPanel: boolean + filteredAreaRestrictions: any[]; + filteredBansAndProhibitions: any[]; + filteredDangerRatings: any[]; + filteredRoadEvents: any[]; + filteredClosedRecreationSites: any[]; + filteredForestServiceRoads: any[]; + filteredProtectedLandsAccessRestrictions: any[]; + filteredRegionalDistricts: any[]; + filteredMunicipalities: any[]; + filteredFirstNationsTreatyLand: any[]; + filteredIndianReserve: any[]; + + showPanel: boolean; wildfireLayerIds: string[] = [ 'active-wildfires-fire-of-note', @@ -333,11 +346,22 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { onSelectIncidents(incidentRefs){ this.showPanel = true; this.incidentRefs = Object.keys(incidentRefs).map(key => incidentRefs[key]); - console.log(this.incidentRefs) - if (this.incidentRefs.length > 1) { + if (this.incidentRefs.length >= 1) { + console.log(this.incidentRefs) // multiple features within clicked area this.filteredWildfires = this.incidentRefs.filter(item => this.wildfireLayerIds.includes(item.layerId)); + this.filteredFirePerimeters = this.incidentRefs.filter(item => item.layerId === 'fire-perimeters'); this.filteredEvacs = this.incidentRefs.filter(item => item.layerId === 'evacuation-orders-and-alerts-wms'); + this.filteredBansAndProhibitions = this.incidentRefs.filter(item => item.layerId === 'bans-and-prohibitions-cat1' || item.layerId === 'bans-and-prohibitions-cat2' || item.layerId === 'bans-and-prohibitions-cat3'); + this.filteredDangerRatings = this.incidentRefs.filter(item => item.layerId === 'danger-rating'); + this.filteredRoadEvents = this.incidentRefs.filter(item => item.layerId === 'drive-bc-active-events'); + this.filteredClosedRecreationSites = this.incidentRefs.filter(item => item.layerId === 'closed-recreation-sites'); + this.filteredForestServiceRoads = this.incidentRefs.filter(item => item.layerId === 'bc-fsr'); + this.filteredProtectedLandsAccessRestrictions = this.incidentRefs.filter(item => item.layerId === 'protected-lands-access-restrictions'); + this.filteredRegionalDistricts = this.incidentRefs.filter(item => item.layerId === 'abms-regional-districts'); + this.filteredMunicipalities = this.incidentRefs.filter(item => item.layerId === 'abms-municipalities'); + this.filteredFirstNationsTreatyLand = this.incidentRefs.filter(item => item.layerId === 'fnt-treaty-land'); + this.filteredIndianReserve = this.incidentRefs.filter(item => item.layerId === 'clab-indian-reserves'); } } diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/area-restriction.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/area-restriction.svg new file mode 100644 index 0000000000..2d44898b33 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/area-restriction.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/ban.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/ban.svg new file mode 100644 index 0000000000..6f456b74c1 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/ban.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/brown-square.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/brown-square.svg new file mode 100644 index 0000000000..88a6017c3b --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/brown-square.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/closed-recreation-site.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/closed-recreation-site.svg new file mode 100644 index 0000000000..b1b2f1790f --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/closed-recreation-site.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-extreme.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-extreme.svg new file mode 100644 index 0000000000..44b377ce40 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-extreme.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-high.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-high.svg new file mode 100644 index 0000000000..20c1926b97 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-high.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-low.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-low.svg new file mode 100644 index 0000000000..7e7fd6968b --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-low.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-moderate.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-moderate.svg new file mode 100644 index 0000000000..3bfa0c45bb --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-moderate.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-very-low.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-very-low.svg new file mode 100644 index 0000000000..1ca54c7427 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/fire-danger-very-low.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/indian-reserve.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/indian-reserve.svg new file mode 100644 index 0000000000..864ca71e55 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/indian-reserve.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/regional-districts.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/regional-districts.svg new file mode 100644 index 0000000000..ca2f2dc3de --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/regional-districts.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/road-event.svg b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/road-event.svg new file mode 100644 index 0000000000..477bb18069 --- /dev/null +++ b/client/wfnews-war/src/main/angular/src/assets/images/svg-icons/road-event.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 369c68fe95d18b9ab42d2b232c01a7bd73e79f37 Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Sun, 15 Oct 2023 23:48:58 -0700 Subject: [PATCH 6/6] remaining layers --- .../active-wildfire-map/active-wildfire-map.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts index 074785205d..c65e5d551a 100644 --- a/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts +++ b/client/wfnews-war/src/main/angular/src/app/components/active-wildfire-map/active-wildfire-map.component.ts @@ -347,7 +347,6 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit { this.showPanel = true; this.incidentRefs = Object.keys(incidentRefs).map(key => incidentRefs[key]); if (this.incidentRefs.length >= 1) { - console.log(this.incidentRefs) // multiple features within clicked area this.filteredWildfires = this.incidentRefs.filter(item => this.wildfireLayerIds.includes(item.layerId)); this.filteredFirePerimeters = this.incidentRefs.filter(item => item.layerId === 'fire-perimeters');