Skip to content

Commit

Permalink
add zoom level 8 to show approximate 100km radius on viewing saved lo…
Browse files Browse the repository at this point in the history
…cation (bcgov#2123)
  • Loading branch information
yzlucas authored Nov 4, 2024
1 parent ab824bf commit 28dca1b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
3 changes: 1 addition & 2 deletions client/wfnews-war/src/main/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export class AppComponent implements OnDestroy, OnInit, AfterViewInit {
public url;
public snowPlowHelper = snowPlowHelper;
public isMobileView = mobileView;
public TOOLTIP_DELAY = 500;

constructor(
protected appConfigService: AppConfigService,
Expand Down Expand Up @@ -409,7 +408,7 @@ export class AppComponent implements OnDestroy, OnInit, AfterViewInit {
}

initFooterMenu() {
this.footerMenu = (this.applicationConfig.device == 'desktop'
this.footerMenu = (this.applicationConfig.device === 'desktop'
? [
new RouterLink(
'Home',
Expand Down
3 changes: 2 additions & 1 deletion client/wfnews-war/src/main/angular/src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { MoreComponent } from '@app/components/more/more.component';
import { ContactWidgetDialogComponent } from './components/sticky-widget/contact-widget-dialog/contact-widget-dialog.component';
import { AddSavedLocationComponent } from '@app/components/saved/add-saved-location/add-saved-location.component';
import { SavedLocationFullDetailsComponent } from './components/saved/saved-location-full-details/saved-location-full-details.component';
import { SavedLocationWeatherDetailsComponent } from './components/saved/saved-location-weather-details/saved-location-weather-details.component';
import { SavedLocationWeatherDetailsComponent }
from './components/saved/saved-location-weather-details/saved-location-weather-details.component';
import { PublicEventPageComponent } from '@app/components/public-event-page/public-event-page.component';
import { DeviceRedirectGuard } from '@app/services/device-redirect-guard';
// Components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,37 +487,39 @@ export class ActiveWildfireMapComponent implements OnInit, AfterViewInit {
},
);
}
} else if ((params['areaRestriction'] && params['areaRestriction'] === "true") ||
(params['evacuationAlert'] && params['evacuationAlert'] === "true") ||
(params['activeWildfires'] && params['activeWildfires'] === "true")){
} else if ((params['areaRestriction'] && params['areaRestriction'] === 'true') ||
(params['evacuationAlert'] && params['evacuationAlert'] === 'true') ||
(params['activeWildfires'] && params['activeWildfires'] === 'true')){
this.panToLocation(long, lat, 12);
} else if (params['bansProhibitions'] && params['bansProhibitions'] === "true"){
} else if (params['bansProhibitions'] && params['bansProhibitions'] === 'true'){
this.panToLocation(long, lat, 6);
} else if (params['savedLocation'] && params['savedLocation'] === 'true') {
this.panToLocation(long, lat, 8);
} else {
this.panToLocation(long, lat);
}

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

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

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

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

Expand Down Expand Up @@ -787,18 +789,20 @@ return;

async onSelectIncidents(incidentRefs) {
this.showPanel = true;
let tempIncidentRefs = Object.keys(incidentRefs).map((key) => incidentRefs[key]);
const tempIncidentRefs = Object.keys(incidentRefs).map((key) => incidentRefs[key]);

if (this.useNearMe && getActiveMap().$viewer.displayContext.layers.itemId['weather-stations'] && getActiveMap().$viewer.displayContext.layers.itemId['weather-stations'][0].isVisible) {
if (this.useNearMe && getActiveMap().$viewer.displayContext.layers.itemId['weather-stations']
&& getActiveMap().$viewer.displayContext.layers.itemId['weather-stations'][0].isVisible) {
try {
const station = await this.pointIdService.fetchNearestWeatherStation(this.userLocation?.coords.latitude, this.userLocation?.coords.longitude);
const station = await
this.pointIdService.fetchNearestWeatherStation(this.userLocation?.coords.latitude, this.userLocation?.coords.longitude);
for (const hours of station.hourly) {
if (hours.temp !== null) {
station.validHour = hours;
break;
}
}
let weatherStation = {
const weatherStation = {
type: 'Feature',
layerId: 'weather-stations',
title: station.stationName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ export class BansFullDetailsComponent implements OnInit {
}

navToBulletinUrl() {
window.open(this.banData.bulletinUrl ? this.banData.bulletinUrl : this.appConfigService.getConfig().externalAppConfig['currentRestrictions'] as unknown as string, '_blank');
window.open(this.banData.bulletinUrl ? this.banData.bulletinUrl
: this.appConfigService.getConfig().externalAppConfig['currentRestrictions'] as unknown as string, '_blank');
}

shareMobile() {
Expand Down

0 comments on commit 28dca1b

Please sign in to comment.