From 10c269486f6c98633c241e1d0dabe8f4402b19ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Wed, 31 May 2017 10:47:11 -0400 Subject: [PATCH] feat(metadata): add metadata for layers --- src/demo-app/contexts/embacle.json | 6 +++- .../datasources/datasource.interface.ts | 2 ++ src/lib/index.ts | 1 + src/lib/language.extract.ts | 4 +++ .../layer-item/layer-item.component.html | 10 ++++++ .../layer-item/layer-item.component.spec.ts | 4 +++ .../layer/layer-item/layer-item.component.ts | 6 +++- src/lib/metadata/index.ts | 2 ++ src/lib/metadata/module.ts | 24 ++++++++++++++ src/lib/metadata/shared/index.ts | 2 ++ src/lib/metadata/shared/metadata.interface.ts | 4 +++ .../metadata/shared/metadata.service.spec.ts | 21 +++++++++++++ src/lib/metadata/shared/metadata.service.ts | 16 ++++++++++ src/lib/module.ts | 31 ++++++++++--------- src/locale/en.json | 3 +- src/locale/fr.json | 3 +- 16 files changed, 121 insertions(+), 18 deletions(-) create mode 100644 src/lib/metadata/index.ts create mode 100644 src/lib/metadata/module.ts create mode 100644 src/lib/metadata/shared/index.ts create mode 100644 src/lib/metadata/shared/metadata.interface.ts create mode 100644 src/lib/metadata/shared/metadata.service.spec.ts create mode 100644 src/lib/metadata/shared/metadata.service.ts diff --git a/src/demo-app/contexts/embacle.json b/src/demo-app/contexts/embacle.json index 4549ac1ba8..bf8dc95791 100644 --- a/src/demo-app/contexts/embacle.json +++ b/src/demo-app/contexts/embacle.json @@ -29,7 +29,7 @@ "width" : 3 }, "fill": { - "color": "rgba(140, 140, 255, 0.3)" + "color": "rgba(140, 140, 255, 0.3)" } }, "version" : "1.3.0", @@ -57,6 +57,10 @@ }, "projection": "EPSG:3857" }, + "metadata": { + "url": "https://www.donneesquebec.ca/recherche/fr/dataset/historique-publique-d-embacles-repertories-au-msp", + "extern": true + }, "timeFilter": { "min": "2017-01-01", "max": "2018-01-01", diff --git a/src/lib/datasource/shared/datasources/datasource.interface.ts b/src/lib/datasource/shared/datasources/datasource.interface.ts index e337263a50..a9de343e66 100644 --- a/src/lib/datasource/shared/datasources/datasource.interface.ts +++ b/src/lib/datasource/shared/datasources/datasource.interface.ts @@ -1,5 +1,6 @@ import { TimeFilterOptions } from '../../../filter'; import { QueryFormat, QueryOptions } from '../../../query'; +import { MetadataOptions } from '../../../metadata'; import { DataSource } from './datasource'; @@ -8,6 +9,7 @@ export interface DataSourceOptions { title: string; alias?: string; legend?: DataSourceLegendOptions; + metadata?: MetadataOptions; } export interface DataSourceContext extends DataSourceOptions { diff --git a/src/lib/index.ts b/src/lib/index.ts index ddfc77d883..70cc290d6c 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -8,6 +8,7 @@ export * from './filter'; export * from './form'; export * from './layer'; export * from './map'; +export * from './metadata'; export * from './overlay'; export * from './query'; export * from './search'; diff --git a/src/lib/language.extract.ts b/src/lib/language.extract.ts index 9707ea5bec..f85a24bc54 100644 --- a/src/lib/language.extract.ts +++ b/src/lib/language.extract.ts @@ -2,4 +2,8 @@ import { _ } from '@biesbjerg/ngx-translate-extract'; _('igo.map'); _('igo.searchResults'); +_('igo.contexts'); _('igo.timeAnalysis'); +_('igo.landscape'); +_('igo.portrait'); +_('igo.orientation'); diff --git a/src/lib/layer/layer-item/layer-item.component.html b/src/lib/layer/layer-item/layer-item.component.html index b9b5b9f800..5a0f544204 100644 --- a/src/lib/layer/layer-item/layer-item.component.html +++ b/src/lib/layer/layer-item/layer-item.component.html @@ -55,6 +55,16 @@

{{layer.title}}

+ +