-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layers): Enhanced table of content for layers management (#625)
Co-authored-by: Pierre-Étienne Lord <[email protected]> Co-authored-by: Philippe <[email protected]> Co-authored-by: PhilippeL <[email protected]> Co-authored-by: Marc-André Barbeau <[email protected]>
- Loading branch information
1 parent
20253a4
commit 31c75a7
Showing
95 changed files
with
2,459 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { ModuleWithProviders } from '@angular/core'; | ||
|
||
import { AppLegendComponent } from './legend.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'legend', | ||
component: AppLegendComponent | ||
} | ||
]; | ||
|
||
export const AppLegendRoutingModule: ModuleWithProviders = RouterModule.forChild( | ||
routes | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<mat-card> | ||
<mat-card-subtitle>Geo</mat-card-subtitle> | ||
<mat-card-title>Simple Map with a legend list</mat-card-title> | ||
<mat-card-content> | ||
<li>Dependencies: LanguageService</li> | ||
|
||
<br> | ||
See the <a href="https://github.com/infra-geo-ouverte/igo2-lib/tree/master/demo/src/app/geo/layer">code of this | ||
example</a> | ||
<hr> | ||
</mat-card-content> | ||
|
||
<igo-map-browser [map]="map" [view]="view"> | ||
<igo-zoom-button [map]="map" color="primary"></igo-zoom-button> | ||
</igo-map-browser> | ||
|
||
<igo-panel title="Legends"> | ||
<igo-layer-legend-list [layers]="map.layers" | ||
[excludeBaseLayers]="true" | ||
[allowShowAllLegends]="true" | ||
[updateLegendOnResolutionChange]="false" | ||
[showAllLegendsValue]="false"> | ||
</igo-layer-legend-list> | ||
|
||
</igo-panel> | ||
|
||
</mat-card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
igo-map-browser { | ||
width: 100%; | ||
height: 300px; | ||
} | ||
|
||
igo-panel { | ||
width: 100%; | ||
padding-top: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { LanguageService } from '@igo2/core'; | ||
import { | ||
IgoMap, | ||
DataSourceService, | ||
LayerService, | ||
WMSDataSourceOptions, | ||
LayerOptions, | ||
WFSDataSourceOptions, | ||
OgcFilterableDataSourceOptions, | ||
MetadataLayerOptions | ||
} from '@igo2/geo'; | ||
|
||
@Component({ | ||
selector: 'app-legend', | ||
templateUrl: './legend.component.html', | ||
styleUrls: ['./legend.component.scss'] | ||
}) | ||
export class AppLegendComponent { | ||
public map = new IgoMap({ | ||
controls: { | ||
attribution: { | ||
collapsed: true | ||
} | ||
} | ||
}); | ||
|
||
public view = { | ||
center: [-73, 47.2], | ||
zoom: 7 | ||
}; | ||
|
||
constructor( | ||
private languageService: LanguageService, | ||
private dataSourceService: DataSourceService, | ||
private layerService: LayerService | ||
) { | ||
this.dataSourceService | ||
.createAsyncDataSource({ | ||
type: 'osm' | ||
}) | ||
.subscribe(dataSource => { | ||
this.map.addLayer( | ||
this.layerService.createLayer({ | ||
title: 'OSM', | ||
visible: true, | ||
baseLayer: true, | ||
source: dataSource | ||
}) | ||
); | ||
}); | ||
|
||
interface WFSoptions | ||
extends WFSDataSourceOptions, | ||
OgcFilterableDataSourceOptions {} | ||
|
||
const wfsDatasource: WFSoptions = { | ||
type: 'wfs', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/igo_gouvouvert.fcgi', | ||
params: { | ||
featureTypes: 'vg_observation_v_autre_wmst', | ||
fieldNameGeometry: 'geometry', | ||
maxFeatures: 10000, | ||
version: '2.0.0', | ||
outputFormat: undefined, | ||
outputFormatDownload: 'shp' | ||
}, | ||
ogcFilters: { | ||
enabled: true, | ||
editable: true, | ||
filters: { | ||
operator: 'PropertyIsEqualTo', | ||
propertyName: 'code_municipalite', | ||
expression: '10043' | ||
} | ||
} | ||
}; | ||
|
||
this.dataSourceService | ||
.createAsyncDataSource(wfsDatasource) | ||
.subscribe(dataSource => { | ||
const layer: LayerOptions = { | ||
title: 'WFS ', | ||
visible: true, | ||
source: dataSource | ||
}; | ||
this.map.addLayer(this.layerService.createLayer(layer)); | ||
}); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/igo_gouvouvert.fcgi', | ||
optionsFromCapabilities: true, | ||
params: { | ||
LAYERS: 'MELS_CS_ANGLO_S', | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'Réseau routier', | ||
visible: false, | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/swtq', | ||
params: { | ||
LAYERS: 'bgr_v_sous_route_res_sup_act', | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'lieu habité', | ||
visible: false, | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/swtq', | ||
optionsFromCapabilities: true, | ||
params: { | ||
LAYERS: 'lieuhabite', | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'sh_dis_eco', | ||
visible: false, | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/mffpecofor.fcgi', | ||
optionsFromCapabilities: true, | ||
params: { | ||
LAYERS: 'sh_dis_eco', | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'nurc:Arc_Sample_Parent', | ||
visible: false, | ||
legendOptions: { | ||
// collapsed: false, | ||
display: true, | ||
// url: 'https://v.seloger.com/s/width/1144/visuels/0/m/l/4/0ml42xbt1n3itaboek3qec5dtskdgw6nlscu7j69k.jpg', | ||
stylesAvailable: [ | ||
{ name: 'rain', title: 'Pluie' }, | ||
{ name: 'raster', title: 'Défaut' } | ||
] // | ||
}, | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://demo.geo-solutions.it/geoserver/ows', | ||
optionsFromCapabilities: true, | ||
params: { | ||
LAYERS: 'nurc:Arc_Sample', // , test:Linea_costa | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
this.layerService | ||
.createAsyncLayer({ | ||
title: 'Avertissements routier', | ||
visible: false, | ||
sourceOptions: { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/swtq', | ||
params: { | ||
LAYERS: 'evenements', | ||
VERSION: '1.3.0' | ||
} | ||
} | ||
}) | ||
.subscribe(l => this.map.addLayer(l)); | ||
|
||
const datasource: WMSDataSourceOptions = { | ||
type: 'wms', | ||
url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/igo_gouvouvert.fcgi', | ||
refreshIntervalSec: 15, | ||
params: { | ||
LAYERS: 'vg_observation_v_inondation_embacle_wmst', | ||
VERSION: '1.3.0' | ||
} | ||
}; | ||
|
||
interface LayerOptionsWithMetadata | ||
extends LayerOptions, | ||
MetadataLayerOptions {} | ||
|
||
this.dataSourceService | ||
.createAsyncDataSource(datasource) | ||
.subscribe(dataSource => { | ||
const layer: LayerOptionsWithMetadata = { | ||
title: 'Embâcle', | ||
source: dataSource, | ||
metadata: { | ||
url: | ||
'https://www.donneesquebec.ca/recherche/fr/dataset/historique-publique-d-embacles-repertories-au-msp', | ||
extern: true | ||
} | ||
}; | ||
this.map.addLayer(this.layerService.createLayer(layer)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { | ||
MatCardModule, | ||
MatButtonModule, | ||
MatIconModule | ||
} from '@angular/material'; | ||
|
||
import { IgoPanelModule } from '@igo2/common'; | ||
import { | ||
IgoMapModule, | ||
IgoLayerModule, | ||
IgoFilterModule, | ||
IgoMetadataModule, | ||
IgoDownloadModule | ||
} from '@igo2/geo'; | ||
|
||
import { AppLegendComponent } from './legend.component'; | ||
import { AppLegendRoutingModule } from './legend-routing.module'; | ||
|
||
@NgModule({ | ||
declarations: [AppLegendComponent], | ||
imports: [ | ||
AppLegendRoutingModule, | ||
MatCardModule, | ||
MatButtonModule, | ||
MatIconModule, | ||
IgoPanelModule, | ||
IgoMapModule, | ||
IgoLayerModule, | ||
IgoFilterModule, | ||
IgoMetadataModule, | ||
IgoDownloadModule | ||
], | ||
exports: [AppLegendComponent] | ||
}) | ||
export class AppLegendModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './shared'; | ||
export * from './share-map/share-map.component'; | ||
export * from './share-map/share-map-binding.directive'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.