diff --git a/apps/fxc-front/src/app/components/2d/map-element.ts b/apps/fxc-front/src/app/components/2d/map-element.ts index 69cd8b9d..3d348d1f 100644 --- a/apps/fxc-front/src/app/components/2d/map-element.ts +++ b/apps/fxc-front/src/app/components/2d/map-element.ts @@ -167,6 +167,7 @@ export class MapElement extends connect(store)(LitElement) { TopoOtm.mapTypeId, TopoFrance.mapTypeId, TopoFrance.mapTypeIdScan, + TopoFrance.mapTypeIdScanOACI, TopoSpain.mapTypeId, ], style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, @@ -200,6 +201,8 @@ export class MapElement extends connect(store)(LitElement) { } }); + this.map.addListener('zoom_changed', () => console.log(this.map?.getZoom())); + this.subscriptions.push( msg.centerMap.subscribe(({ lat, lon }) => this.center(lat, lon)), msg.centerZoomMap.subscribe(({ lat, lon }, delta) => { diff --git a/apps/fxc-front/src/app/components/2d/topo-elements.ts b/apps/fxc-front/src/app/components/2d/topo-elements.ts index e3a4939b..9f110bd3 100644 --- a/apps/fxc-front/src/app/components/2d/topo-elements.ts +++ b/apps/fxc-front/src/app/components/2d/topo-elements.ts @@ -18,11 +18,14 @@ export class TopoSpain extends WMTSMapTypeElement { const IGNFR_PLAN = 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2'; const IGNFR_SCAN = 'GEOGRAPHICALGRIDSYSTEMS.MAPS'; +const IGNFR_SCAN_OACI = 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-OACI'; @customElement('topo-france') export class TopoFrance extends WMTSMapTypeElement { static mapTypeId = 'topo.france.classique'; static mapTypeIdScan = 'topo.france.scan'; + static mapTypeIdScanOACI = 'topo.france.scan-oaci'; + mapName = 'France'; copyright = { html: ``, @@ -65,25 +68,42 @@ export class TopoFrance extends WMTSMapTypeElement { minZoom: 6, maxZoom: 17, name: 'France (scan)', - alt: 'France (scan)', + alt: 'France', + }); + } + + protected getScanOACIMapType(): google.maps.ImageMapType { + return new google.maps.ImageMapType({ + getTileUrl: (...args): string => this.getTileUrl(...args), + tileSize: new google.maps.Size(256, 256), + minZoom: 6, + maxZoom: 11, + name: 'OACI (France)', + alt: 'OACI ', }); } protected init(map: google.maps.Map): void { super.init(map); this.registerMapType(TopoFrance.mapTypeIdScan, this.getScanMapType()); + this.registerMapType(TopoFrance.mapTypeIdScanOACI, this.getScanOACIMapType()); } protected visibilityHandler(mapTypeId: string): void { if (this.copyrightEl) { - if (mapTypeId === TopoFrance.mapTypeId) { - this.layerName = IGNFR_PLAN; - this.copyrightEl.hidden = false; - } else if (mapTypeId === TopoFrance.mapTypeIdScan) { - this.layerName = IGNFR_SCAN; - this.copyrightEl.hidden = false; - } else { - this.copyrightEl.hidden = true; + this.copyrightEl.hidden = false; + switch (mapTypeId) { + case TopoFrance.mapTypeIdScanOACI: + this.layerName = IGNFR_SCAN_OACI; + break; + case TopoFrance.mapTypeIdScan: + this.layerName = IGNFR_SCAN; + break; + case TopoFrance.mapTypeId: + this.layerName = IGNFR_PLAN; + break; + default: + this.copyrightEl.hidden = true; } } super.visibilityHandler(mapTypeId);