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

5 sélectionner un ou plusieurs sp #38

Merged
merged 3 commits into from
Jan 30, 2025
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
Binary file removed lib/geopf-extensions-openlayers-1.0.0-beta.1-296.tgz
Binary file not shown.
Binary file not shown.
82 changes: 52 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"dependencies": {
"@edugouvfr/ngx-dsfr": "^1.12.6",
"@gouvfr/dsfr": "^1.11.0",
"geopf-extensions-openlayers": "./lib/geopf-extensions-openlayers-1.0.0-beta.1-296.tgz",
"geopf-extensions-openlayers": "./lib/geopf-extensions-openlayers-1.0.0-beta.1-335.tgz",
"geoportal-access-lib": "^3.4.4",
"ol": "^9.1.0"
"ol": "latest"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.6",
Expand Down
29 changes: 17 additions & 12 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,32 @@
link: 'https://cartes.gouv.fr/donnees-personnelles'
}
]"
[partnerMain]="{imagePath: 'assets/images/logos/ditp.svg', imageAlt: 'logo DITP', link: 'https://www.modernisation.gouv.fr/'}"
[partnersSub]="[
{
imagePath: 'assets/img/logo-ign.png',
imageAlt: 'IGN',
imagePath: 'assets/images/logos/ign.svg',
imageAlt: 'logo IGN',
link: 'https://www.ign.fr'
},
{
imagePath: 'assets/img/logo-ministere-transformation.jpg',
imageAlt: 'MINISTÈRE DE LA TRANSFORMATION ET DE LA FONCTION PUBLIQUES',
link: 'https://www.transformation.gouv.fr/'
imagePath: 'assets/images/logos/anct.svg',
imageAlt: 'logo ANCT',
link: 'https://agence-cohesion-territoires.gouv.fr/'
},
{
imagePath: 'assets/img/logo-ministere-ecologie.jpg',
imageAlt:
'MINISTÈRE DE LA TRANSITION ÉCOLOGIQUE ET DE LA COHÉSION DES TERRITOIRES',
link: 'https://www.ecologie.gouv.fr/'
imagePath: 'assets/images/logos/dila.svg',
imageAlt: 'logo DILA',
link: 'https://www.dila.premier-ministre.gouv.fr/'
},
{
imagePath: 'assets/img/logo-rf-cnig.jpg',
imageAlt: 'Conseil National de l’Information Géolocalisée',
link: 'https://cnig.gouv.fr/'
imagePath: 'assets/images/logos/dinum.svg',
imageAlt: 'logo DINUM',
link: 'https://www.numerique.gouv.fr/'
},
{
imagePath: 'assets/images/logos/insee.svg',
imageAlt: 'logo INSEE',
link: 'https://www.insee.fr/fr/accueil'
}
]"
[reboundLinks]="[]"
Expand Down
6 changes: 6 additions & 0 deletions src/app/carte/carte.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, ElementRef } from '@angular/core';

import Map from 'ol/Map';
import Feature from 'ol/Feature';
import { bbox as bboxStrategy } from 'ol/loadingstrategy';
import { LayerWMTS as GeoportalLayerWMTS, LayerWFS as GeoportalLayerWFS } from "geopf-extensions-openlayers/src";

Expand All @@ -17,6 +18,7 @@ export class CarteComponent implements OnInit {
constructor(private elementRef: ElementRef) {}

ngOnInit() {

this.map.setLayers([
new GeoportalLayerWMTS({
layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2",
Expand All @@ -27,6 +29,10 @@ export class CarteComponent implements OnInit {
new GeoportalLayerWFS({
layer: "mvp_carto20241219_bis_gpkg_20-12-2024_wfs:mvp_carto20241219_bis",
olParams : {
minZoom: 10,
style: function(feature: Feature){
return undefined;
},
sourceParams: {
strategy: bboxStrategy,
}
Expand Down
23 changes: 23 additions & 0 deletions src/app/controls/spwfsfilter/spwfsfilter.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SpwfsfilterComponent } from './spwfsfilter.component';

describe('SpwfsfilterComponent', () => {
let component: SpwfsfilterComponent;
let fixture: ComponentFixture<SpwfsfilterComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SpwfsfilterComponent]
})
.compileComponents();

fixture = TestBed.createComponent(SpwfsfilterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
94 changes: 94 additions & 0 deletions src/app/controls/spwfsfilter/spwfsfilter.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { Component, OnInit, Input, ElementRef } from '@angular/core';

import Map from 'ol/Map';
import Control from 'ol/control/Control';
import Style from 'ol/style/Style';
import Icon from 'ol/style/Icon';
import { WfsFilter } from "geopf-extensions-openlayers/src";

@Component({
selector: 'app-spwfsfilter',
standalone: true,
imports: [],
template: '',
styles: []
})
export class SpwfsfilterComponent implements OnInit {
@Input() map!: Map;
control!: Control;

constructor(private elementRef: ElementRef) {}

ngOnInit() {

var styleCache = {
"Administration locale": new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/administrations-locales/implantation.svg',
})
}),
"Droit, justice": new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/droit-justice/implantation.svg',
})
}),
"Economie, finances, consommation" : new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/finance/implantation.svg',
})
}),
"Enseignement, recherche" : new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/droit-justice/implantation.svg',
})
}),
"Social, santé" : new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/social-sante/implantation.svg',
})
}),

"Travail, emploi, formation": new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/emploi-formation/implantation.svg',
})
}),

"Environnement, logement, transports": new Style({
image: new Icon({
anchor: [0.5, 37],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'assets/images/mapmarker/environnement/implantation.svg',
})
})
} as any;

this.control = new WfsFilter({
position: "top-left",
cartospLayerName: "mvp_carto20241219_bis_gpkg_20-12-2024_wfs:mvp_carto20241219_bis",
zoomLevelLimit: 10,
cartospStyles: styleCache
});

this.map.addControl(this.control);
}
}
8 changes: 7 additions & 1 deletion src/app/home/home.component.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#map-container, #loading{
#app-content{
display: flex;
height: 800px;
width: 100%;
}

#map-container, #loading{
height: 100%;
width: 100%;
}

#loading{
text-align: center;
vertical-align: middle;
Expand Down
Loading
Loading