Skip to content

Commit

Permalink
Route back to previous zoom level for bans, evacs, area restrictions …
Browse files Browse the repository at this point in the history
…on desktop
  • Loading branch information
ssylver93 committed Dec 19, 2024
1 parent 123f36f commit 0bdccd9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,22 @@ export class AreaRestrictionPreviewComponent {


enterFullDetail() {
const currentZoomLevel = getActiveMap().$viewer?.map?._zoom;
const url = this.router.serializeUrl(
this.router.createUrlTree([ResourcesRoutes.PUBLIC_EVENT], {
queryParams: {
eventType: 'area-restriction',
eventNumber: this.data.PROT_RA_SYSID,
eventName: this.data.NAME,
source: [ResourcesRoutes.ACTIVEWILDFIREMAP]
source: [ResourcesRoutes.ACTIVEWILDFIREMAP],
zoom: currentZoomLevel
},
}),
);
this.capacitorService.redirect(url, true);
}

zoomIn(level?: number, polygon?: boolean) {
const viewer = getActiveMap().$viewer;
this.agolService
.getAreaRestrictions(
`NAME='${this.data.NAME}'`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { AGOLService } from '@app/services/AGOL-service';
import { CapacitorService } from '@app/services/capacitor-service';
import { CommonUtilityService } from '@app/services/common-utility.service';
import { ResourcesRoutes, convertToDateYear, hidePanel, showPanel } from '@app/utils';
import { ResourcesRoutes, convertToDateYear, hidePanel, showPanel, getActiveMap } from '@app/utils';
import { MapUtilityService } from '../map-share-service';

@Component({
Expand Down Expand Up @@ -49,14 +49,16 @@ export class EvacuationsPreviewComponent {
}

enterFullDetail() {
const currentZoomLevel = getActiveMap().$viewer?.map?._zoom;
if (this.data) {
const url = this.router.serializeUrl(
this.router.createUrlTree([ResourcesRoutes.PUBLIC_EVENT], {
queryParams: {
eventType: this.data.ORDER_ALERT_STATUS,
id: this.data.EMRG_OAA_SYSID,
eventNumber: this.data.EVENT_NUMBER,
source: [ResourcesRoutes.ACTIVEWILDFIREMAP]
source: [ResourcesRoutes.ACTIVEWILDFIREMAP],
zoom: currentZoomLevel
},
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,22 @@ export class FireBanPreviewComponent {
}

enterFullDetail() {
const currentZoomLevel = getActiveMap().$viewer?.map?._zoom;
const url = this.router.serializeUrl(
this.router.createUrlTree([ResourcesRoutes.PUBLIC_EVENT], {
queryParams: {
eventType: 'ban',
eventNumber: this.data.PROT_BAP_SYSID,
eventName: this.data.ACCESS_PROHIBITION_DESCRIPTION,
source: [ResourcesRoutes.ACTIVEWILDFIREMAP]
source: [ResourcesRoutes.ACTIVEWILDFIREMAP],
zoom: currentZoomLevel
},
}),
);
this.capacitorService.redirect(url, true);
}

zoomIn(level?: number, polygon?: boolean) {
const viewer = getActiveMap().$viewer;
this.agolService
.getBansAndProhibitionsById(
this.data.PROT_BAP_SYSID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class IncidentHeaderPanelComponent implements AfterViewInit, OnInit {
weight: 2,
fillOpacity: 0
})
})
});

private evacOrdersLayer = esri.featureLayer({
url: this.appConfigService.getConfig()['externalAppConfig']['AGOLevacOrders'].toString(),
Expand All @@ -107,7 +107,7 @@ export class IncidentHeaderPanelComponent implements AfterViewInit, OnInit {
};
}
}
})
});


constructor(
Expand Down Expand Up @@ -418,7 +418,7 @@ export class IncidentHeaderPanelComponent implements AfterViewInit, OnInit {
style: '7734'
})
.addTo(this.map);
})
});
}
const icon = L.icon({
iconUrl: '/assets/images/local_fire_department.png',
Expand Down Expand Up @@ -549,13 +549,16 @@ export class IncidentHeaderPanelComponent implements AfterViewInit, OnInit {


backToMap() {
const zoom = this.params?.['zoom'];

const navigateToMap = (longitude: number, latitude: number, queryParamKey: string) => {
setTimeout(() => {
this.router.navigate([ResourcesRoutes.ACTIVEWILDFIREMAP], {
queryParams: {
longitude,
latitude,
[queryParamKey]: true
[queryParamKey]: true,
zoom
},
});
}, 100);
Expand Down

0 comments on commit 0bdccd9

Please sign in to comment.