Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFNEWS-1946 Turn on relevant layers when accessing from list view #1797

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -482,26 +482,37 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit {
},
);
}
} else if (params['areaRestriction'] && params['areaRestriction'] === "true"){
this.panToLocation(long, lat, 12);
} else if (params['bansProhibitions'] && params['bansProhibitions'] === "true"){
this.panToLocation(long, lat, 6);
} else if (params['evacuationAlert'] && params['evacuationAlert'] === "true"){
this.panToLocation(long, lat, 12);
} else {
this.panToLocation(long, lat);
}
}

// turn on layers
if (params['featureType'] === 'British_Columbia_Area_Restrictions') {
if (params['featureType'] === 'British_Columbia_Area_Restrictions' ||
(params['areaRestriction'] && params['areaRestriction'] === "true")) {
this.onSelectLayer('area-restrictions');
}

if (
params['featureType'] ===
'British_Columbia_Bans_and_Prohibition_Areas'
'British_Columbia_Bans_and_Prohibition_Areas' ||
(params['bansProhibitions'] && params['bansProhibitions'] === "true")
) {
this.onSelectLayer('bans-and-prohibitions');
}

if (params['featureType'] === 'Evacuation_Orders_and_Alerts') {
if (params['featureType'] === 'Evacuation_Orders_and_Alerts' ||
(params['evacuationAlert'] && params['evacuationAlert'] === "true")) {
this.onSelectLayer('evacuation-orders-and-alerts');
}

if (params['featureType'] === 'BCWS_ActiveFires_PublicView') {
if (params['featureType'] === 'BCWS_ActiveFires_PublicView' ||
(params['activeWildfires'] && params['activeWildfires'] === "true")) {
this.onSelectLayer('wildfire-stage-of-control');
}

Expand Down Expand Up @@ -556,12 +567,11 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit {
});
}

panToLocation(long, lat, noZoom?) {
panToLocation(long, lat, zoom?) {
this.mapConfigService.getMapConfig().then(() => {
getActiveMap().$viewer.panToFeature(
window['turf'].point([long, lat]),
noZoom ? null : 12,
);
window['turf'].point([long, lat]),
zoom ? zoom : null);
});
}

Expand Down Expand Up @@ -807,8 +817,7 @@ async onSelectIncidents(incidentRefs) {
if (this.incidentRefs.length && this.incidentRefs[0]._identifyPoint) {
this.panToLocation(
this.incidentRefs[0]._identifyPoint.longitude,
this.incidentRefs[0]._identifyPoint.latitude,
true
this.incidentRefs[0]._identifyPoint.latitude
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ console.error(
queryParams: {
longitude: this.incident.longitude,
latitude: this.incident.latitude,
activeWildfires: true
},
});
}, 200);
Expand Down
Loading