From b9cd6859ccb18e6319fc0f2443e17be2466d7d94 Mon Sep 17 00:00:00 2001 From: "MAXIME LAMER (LAMM26)" Date: Wed, 19 May 2021 13:41:11 -0400 Subject: [PATCH 1/3] ajout bouton zoom on Layer --- demo/src/app/geo/layer/layer.component.ts | 1 + .../datasource/shared/capabilities.service.ts | 3 + .../layer-list/layer-list.component.html | 24 ++++++++ .../layer/layer-list/layer-list.component.ts | 56 +++++++++++++++++++ .../layer/shared/layers/layer.interface.ts | 4 +- .../src/lib/map/shared/controllers/view.ts | 17 +++++- .../geo/src/lib/map/shared/map.interface.ts | 2 +- packages/geo/src/lib/map/shared/map.ts | 4 ++ packages/geo/src/locale/en.geo.json | 2 + packages/geo/src/locale/fr.geo.json | 2 + 10 files changed, 111 insertions(+), 4 deletions(-) diff --git a/demo/src/app/geo/layer/layer.component.ts b/demo/src/app/geo/layer/layer.component.ts index 8d0228cbac..50b8917266 100644 --- a/demo/src/app/geo/layer/layer.component.ts +++ b/demo/src/app/geo/layer/layer.component.ts @@ -28,6 +28,7 @@ export class AppLayerComponent { public view = { center: [-73, 47.2], + maxLayerZoomExtent: [-11000000, 4500000, -4500000, 10000000], zoom: 7 }; diff --git a/packages/geo/src/lib/datasource/shared/capabilities.service.ts b/packages/geo/src/lib/datasource/shared/capabilities.service.ts index 1e9d1b6c1b..ecfb47bc4a 100644 --- a/packages/geo/src/lib/datasource/shared/capabilities.service.ts +++ b/packages/geo/src/lib/datasource/shared/capabilities.service.ts @@ -36,6 +36,7 @@ import { TimeFilterType, TimeFilterStyle } from '../../filter/shared/time-filter.enum'; +import * as olproj from 'ol/proj'; export enum TypeCapabilities { wms = 'wms', @@ -251,6 +252,7 @@ export class CapabilitiesService { const timeFilter = this.getTimeFilter(layer); const timeFilterable = timeFilter && Object.keys(timeFilter).length > 0; const legendOptions = layer.Style ? this.getStyle(layer.Style) : undefined; + const extent = olproj.transformExtent(layer.EX_GeographicBoundingBox, 'EPSG:4326', 'EPSG:3857'); let queryFormat: QueryFormat; const queryFormatMimeTypePriority = [ @@ -284,6 +286,7 @@ export class CapabilitiesService { title: layer.Title, maxResolution: getResolutionFromScale(layer.MaxScaleDenominator), minResolution: getResolutionFromScale(layer.MinScaleDenominator), + extent, metadata: { url: metadata ? metadata.OnlineResource : undefined, extern: metadata ? true : undefined, diff --git a/packages/geo/src/lib/layer/layer-list/layer-list.component.html b/packages/geo/src/lib/layer/layer-list/layer-list.component.html index 1f666029e4..e7517224ed 100644 --- a/packages/geo/src/lib/layer/layer-list/layer-list.component.html +++ b/packages/geo/src/lib/layer/layer-list/layer-list.component.html @@ -40,6 +40,18 @@ + + +