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

feat(geoDB): service to load data from config file into the indexed-db #847

Merged
merged 1 commit into from
Nov 14, 2022
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
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"src/assets",
"src/config",
"src/contexts",
"src/data",
"src/locale",
{
"glob": "**/*",
Expand Down
8 changes: 6 additions & 2 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ import {
VectorLayer,
MapExtent,
moveToOlFeatures,
FeatureMotion
FeatureMotion,
ConfigFileToGeoDBService
} from '@igo2/geo';

import {
Expand Down Expand Up @@ -330,7 +331,8 @@ export class PortalComponent implements OnInit, OnDestroy {
private queryService: QueryService,
private storageService: StorageService,
private editionWorkspaceService: EditionWorkspaceService,
private directionState: DirectionState
private directionState: DirectionState,
private configFileToGeoDBService: ConfigFileToGeoDBService
) {
this.hasExpansionPanel = this.configService.getConfig('hasExpansionPanel');
this.hasHomeExtentButton =
Expand Down Expand Up @@ -490,6 +492,8 @@ export class PortalComponent implements OnInit, OnDestroy {
).subscribe((sidenavMediaAndOrientation: [boolean, string, string]) => {
this.computeToastPanelOffsetX();
});

this.configFileToGeoDBService.load('./data/geoDataToIDB.json');
}

setToastPanelHtmlDisplay(value) {
Expand Down
19 changes: 19 additions & 0 deletions src/data/geoDataToIDB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"geoDatas": [
{
"triggerDate": "2022-11-01",
"action": "delete",
"urls": [
"https://ws.mapserver.transports.gouv.qc.ca/swtq?service=WFS&request=GetFeature&version=1.1.0&typename=chantiers_mtmdet&outputFormat=geojson"
]
},
{
"triggerDate": "2022-11-01",
"action": "update",
"urls": [
"https://www.donneesquebec.ca/recherche/dataset/f647f5ed-a8f3-4a47-8ceb-977cbf090675/resource/68e0e20a-415d-44f5-af82-a90311784616/download/bornes-incendies.geojson"
],
"source": "nov2022"
}
]
}