diff --git a/packages/geoview-core/public/configs/OSDP/osdp-land-swiper.json b/packages/geoview-core/public/configs/OSDP/osdp-land-swiper.json new file mode 100644 index 00000000000..24ada65f881 --- /dev/null +++ b/packages/geoview-core/public/configs/OSDP/osdp-land-swiper.json @@ -0,0 +1,10 @@ +{ + "orientation": "vertical", + "keyboardOffset": 10, + "layers": [ + "LYR1" + ], + "suportedLanguages": [ + "en" + ] +} \ No newline at end of file diff --git a/packages/geoview-core/public/configs/OSDP/osdp-land.json b/packages/geoview-core/public/configs/OSDP/osdp-land.json new file mode 100644 index 00000000000..b75e6cc8d66 --- /dev/null +++ b/packages/geoview-core/public/configs/OSDP/osdp-land.json @@ -0,0 +1,52 @@ +{ + "map": { + "interaction": "dynamic", + "viewSettings": { + "zoom": 8, + "center": [-113, 57.5], + "projection": 3978 + }, + "basemapOptions": { + "basemapId": "transport", + "shaded": true, + "labeled": true + }, + "listOfGeoviewLayerConfig": [ + { + "geoviewLayerId": "LYR1", + "geoviewLayerName": { "en": "2010 Land Cover of Canada" }, + "metadataAccessPath": { + "en": "https://datacube.services.geo.ca/web/landcover.xml" + }, + "geoviewLayerType": "ogcWms", + "listOfLayerEntryConfig": [ + { + "layerId": "landcover-2010" + } + ] + }, + { + "geoviewLayerId": "LYR2", + "geoviewLayerName": { "en": "2015 Land Cover of Canada" }, + "metadataAccessPath": { + "en": "https://datacube.services.geo.ca/web/landcover.xml" + }, + "geoviewLayerType": "ogcWms", + "listOfLayerEntryConfig": [ + { + "layerId": "landcover-2015" + } + ] + } + ] + }, + "components": ["north-arrow", "overview-map"], + "footerBar": { + "tabs": { + "core": ["legend", "layers", "details", "data-table"] + } + }, + "corePackages": [ "swiper"], + "theme": "geo.ca", + "suportedLanguages": ["en"] + } \ No newline at end of file diff --git a/packages/geoview-core/public/configs/package-swiper2-config.json b/packages/geoview-core/public/configs/package-swiper2-config.json index 5782ac2def8..b351d22a731 100644 --- a/packages/geoview-core/public/configs/package-swiper2-config.json +++ b/packages/geoview-core/public/configs/package-swiper2-config.json @@ -20,7 +20,7 @@ "metadataAccessPath": { "en": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/historical_flood_event_en/MapServer/" }, - "geoviewLayerType": "esriDynamic", + "geoviewLayerType": "esriFeature", "listOfLayerEntryConfig": [ { "layerId": "0" diff --git a/packages/geoview-core/public/css/style.css b/packages/geoview-core/public/css/style.css index a098e81811b..9a69fdd5903 100644 --- a/packages/geoview-core/public/css/style.css +++ b/packages/geoview-core/public/css/style.css @@ -12,6 +12,7 @@ html { body { margin: 0; padding: 50px; + background-color: #ffffff !important; } td { diff --git a/packages/geoview-core/public/index.html b/packages/geoview-core/public/index.html index 0347aca9621..e86531cf7e1 100644 --- a/packages/geoview-core/public/index.html +++ b/packages/geoview-core/public/index.html @@ -1,76 +1,74 @@ - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - -
- -

Plateforme Géospatiale Canadienne (PGC) - Projet GeoView -

-

Canadian Geospatial Platform (CGP) - GeoView Project -

-
-
-
-
-

Sandbox

- Sandbox -

Basic Maps

- Use Cases - Basemaps - Projections - Languages -

Basic Raw Components

- Basic Details - Basic Data Table - Basic Add Layers - Basic App Bar Tabs -

Basic Loading

- Default Configuration - API - loads - Type Of Layers - pygeoapi process - Layers - Temporal -

Internal Package

- Loading Packages - Package - Basemap Panel - Package - Swiper - Package - Time Slider - Package - GeoChart - Package - GeoChart (footer) -

API and Events

- API Functions Test - Events - Add Panels - Geometry - Footer bar (vanilla JS) -

UI Components

- UI Components - Theme Switching -

Interactions

- Interactions (all-in) - Select - Draw - Modify - Translate - Snap - Extent -

Other

- Responsive Page - Performance Test - CGDI Demo -
- - - \ No newline at end of file + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + +
+ +

Plateforme Géospatiale Canadienne (PGC) - Projet GeoView -

+

Canadian Geospatial Platform (CGP) - GeoView Project -

+
+
+
+
+

Sandbox

+ Sandbox +

Basic Maps

+ Use Cases + Basemaps + Projections + Languages +

Basic Raw Components

+ Basic Details + Basic Add Layers + Basic App Bar Tabs +

Basic Loading

+ Default Configuration + API loads + Type Of Layers + pygeoapi process + Layers - Temporal +

Internal Package

+ Loading Packages + Package - Basemap Panel + Package - Swiper + Package - Time Slider + Package - GeoChart + Package - GeoChart (footer) +

API and Events

+ API Functions Test + Events + Add Panels + Geometry + Footer bar (vanilla JS) +

UI Components

+ UI Components + Theme Switching +

Interactions

+ Interactions (all-in) + Select + Draw + Modify + Translate + Snap + Extent +

Demos

+ Specific Demos Pages +

Other

+ Responsive Page + Performance Test +
+ + diff --git a/packages/geoview-core/public/locales/en/translation.json b/packages/geoview-core/public/locales/en/translation.json index 8f830fee76f..04ed6c22d41 100644 --- a/packages/geoview-core/public/locales/en/translation.json +++ b/packages/geoview-core/public/locales/en/translation.json @@ -164,7 +164,8 @@ "changeDisplayLanguageLayers": "Layers can not be relaoded because the configuration does not support this language", "changeDisplayLanguage": "Only 'en' and 'fr' are supported", "changeDisplayTheme": "Theme unsuported", - "changeDisplayProjection": "Projection unsuported" + "changeDisplayProjection": "Projection unsuported", + "invalidConfig": "Invalid JSON config, default configuration applied" }, "exportModal": { "title": "Export Map as PNG", diff --git a/packages/geoview-core/public/locales/fr/translation.json b/packages/geoview-core/public/locales/fr/translation.json index e2c407ec772..52779dea063 100644 --- a/packages/geoview-core/public/locales/fr/translation.json +++ b/packages/geoview-core/public/locales/fr/translation.json @@ -164,7 +164,8 @@ "changeDisplayLanguageLayers": "Les couches ne peuvent être chargée(s) de nouveau car la configuration ne supporte pas ce langage", "changeDisplayLanguage": "Seulement 'en' et 'fr' sont supporées", "changeDisplayTheme": "Theme non supporté", - "changeDisplayProjection": "Projection non supportée" + "changeDisplayProjection": "Projection non supportée", + "invalidConfig": "Configuration JSON non valide, configuration par défaut appliquée" }, "exportModal": { "title": "Exporter la carte en PNG", diff --git a/packages/geoview-core/public/templates/add-panels.html b/packages/geoview-core/public/templates/add-panels.html index f831a225498..f1ed2d6fb06 100644 --- a/packages/geoview-core/public/templates/add-panels.html +++ b/packages/geoview-core/public/templates/add-panels.html @@ -75,9 +75,6 @@

Add Panels

}" >

- -

-    

diff --git a/packages/geoview-core/public/templates/codedoc.js b/packages/geoview-core/public/templates/codedoc.js
index 2c91ea4af93..dd22085f362 100644
--- a/packages/geoview-core/public/templates/codedoc.js
+++ b/packages/geoview-core/public/templates/codedoc.js
@@ -8,7 +8,7 @@ function sleep(milliseconds) {
 }
 
 function createCodeSnippet() {
-  sleep(1000);
+  sleep(500);
 
   const scripts = Array.prototype.filter.call(document.getElementsByTagName('script'), (obj) => {
     return obj.getAttribute('id') === null;
@@ -27,7 +27,7 @@ function createCodeSnippet() {
 }
 
 function createCodeSnippetUsingIDs() {
-  sleep(1000);
+  sleep(500);
 
   // Enhanced code snippet generator which allows to associate a script id with a code snippet script (og function is using indexes)
   // and write down different code snippet spreaded in the dom tree (og function always reuses 'script' variable which is the last script tag found in the dom)
@@ -48,7 +48,7 @@ function createCodeSnippetUsingIDs() {
 }
 
 function createConfigSnippet() {
-  sleep(1000);
+  sleep(500);
 
   let j = 0;
   // inject configuration snippet inside panel
diff --git a/packages/geoview-core/public/templates/cgdi-demo.html b/packages/geoview-core/public/templates/demos/demo-cgdi.html
similarity index 99%
rename from packages/geoview-core/public/templates/cgdi-demo.html
rename to packages/geoview-core/public/templates/demos/demo-cgdi.html
index 65e8043f7de..93ddb554afc 100644
--- a/packages/geoview-core/public/templates/cgdi-demo.html
+++ b/packages/geoview-core/public/templates/demos/demo-cgdi.html
@@ -26,7 +26,7 @@ 

CGDI Water Resources Demo

- Main
+ Main
diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-air.html b/packages/geoview-core/public/templates/demos/demo-osdp-air.html new file mode 100644 index 00000000000..6d1af35847b --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-air.html @@ -0,0 +1,125 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Air Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Air Quality in GeoView

+
+ + Original RAMP Air
+ +
+

Air Quality

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-biodiversity.html b/packages/geoview-core/public/templates/demos/demo-osdp-biodiversity.html new file mode 100644 index 00000000000..8451c6615bf --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-biodiversity.html @@ -0,0 +1,124 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Biodiversity Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Biodiversity in GeoView

+
+ + Original RAMP Biodiversity
+ +
+

Biodiversity

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-climate.html b/packages/geoview-core/public/templates/demos/demo-osdp-climate.html new file mode 100644 index 00000000000..dd6c9c7d2ba --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-climate.html @@ -0,0 +1,126 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Climate Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Climate in GeoView

+
+ + Original RAMP Climate
+ +
+

Climate

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-economy.html b/packages/geoview-core/public/templates/demos/demo-osdp-economy.html new file mode 100644 index 00000000000..dbe2596ced5 --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-economy.html @@ -0,0 +1,129 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Economy and Industry Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Economy and Industry in GeoView

+
+ + Original RAMP Economy and Industry
+ +
+

Economy Industry

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-health.html b/packages/geoview-core/public/templates/demos/demo-osdp-health.html new file mode 100644 index 00000000000..5de71355a00 --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-health.html @@ -0,0 +1,173 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Health Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Health in GeoView

+
+ + Original RAMP Health
+ +
+

Health

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/raw-data-table.html b/packages/geoview-core/public/templates/demos/demo-osdp-land.html similarity index 52% rename from packages/geoview-core/public/templates/raw-data-table.html rename to packages/geoview-core/public/templates/demos/demo-osdp-land.html index b77cfe1c74f..946aa210df8 100644 --- a/packages/geoview-core/public/templates/raw-data-table.html +++ b/packages/geoview-core/public/templates/demos/demo-osdp-land.html @@ -2,7 +2,7 @@ - + <%= htmlWebpackPlugin.options.title %> @@ -10,7 +10,7 @@ - + @@ -22,40 +22,51 @@ -

Package - Raw Data Table

+

OSDP Land Demo

- Main
+ Main
+ + + + + + +

Demonstration of Open Science Data Portal - Land in GeoView

-
-

1. Default Configuration

- Top -
-
- -
-
-
-
+ Original RAMP Land
-
-
+
+

Land

+ +

+    
+ diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-society.html b/packages/geoview-core/public/templates/demos/demo-osdp-society.html new file mode 100644 index 00000000000..12c62af41cc --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-society.html @@ -0,0 +1,140 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Society Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Society and Culture in GeoView

+
+ + Original RAMP Society and Culture
+ +
+

Society and Culture

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-water.html b/packages/geoview-core/public/templates/demos/demo-osdp-water.html new file mode 100644 index 00000000000..e3a1ed95403 --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demo-osdp-water.html @@ -0,0 +1,126 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ + + + + + + + + + +
+

OSDP Water Demo

+
Main
+ + + + + + +

Demonstration of Open Science Data Portal - Water in GeoView

+
+ + Original RAMP Water
+ +
+

Water

+
+ +

+    
+ + + + + + diff --git a/packages/geoview-core/public/templates/demos/demos.html b/packages/geoview-core/public/templates/demos/demos.html new file mode 100644 index 00000000000..867a719c555 --- /dev/null +++ b/packages/geoview-core/public/templates/demos/demos.html @@ -0,0 +1,42 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + +
+ +

Plateforme Géospatiale Canadienne (PGC) - Projet GeoView -

+

Canadian Geospatial Platform (CGP) - GeoView Project -

+
+
+ Main +
+
+
+

Canada's Spatial Data Infrastructure

+ Water Starter Kit +

Open Science Data Portal

+ Air Quality
+ Biodiversity
+ Climate
+ Economy and Industry
+ Health
+ Land
+ Society and Culture
+ Water
+
+ + diff --git a/packages/geoview-core/public/templates/geometry.html b/packages/geoview-core/public/templates/geometry.html index 2213fb239f2..e04c2f60fc2 100644 --- a/packages/geoview-core/public/templates/geometry.html +++ b/packages/geoview-core/public/templates/geometry.html @@ -83,9 +83,6 @@

Geometry

}" >

- -

-    

diff --git a/packages/geoview-core/public/templates/inter-all.html b/packages/geoview-core/public/templates/inter-all.html
index 98028ddb793..0ae59a9758f 100644
--- a/packages/geoview-core/public/templates/inter-all.html
+++ b/packages/geoview-core/public/templates/inter-all.html
@@ -351,8 +351,6 @@ 

1. Draw, Modify and Snap

Top diff --git a/packages/geoview-core/public/templates/inter-draw.html b/packages/geoview-core/public/templates/inter-draw.html index f13e0259540..664b015865e 100644 --- a/packages/geoview-core/public/templates/inter-draw.html +++ b/packages/geoview-core/public/templates/inter-draw.html @@ -109,9 +109,6 @@

1. Draw (simple case)

>
- -

-    

 
diff --git a/packages/geoview-core/public/templates/inter-extent.html b/packages/geoview-core/public/templates/inter-extent.html
index 405926c114a..603c79dd167 100644
--- a/packages/geoview-core/public/templates/inter-extent.html
+++ b/packages/geoview-core/public/templates/inter-extent.html
@@ -92,9 +92,6 @@ 

1. Extent (simple case)

>
- -

-    

     
diff --git a/packages/geoview-core/public/templates/inter-modify.html b/packages/geoview-core/public/templates/inter-modify.html
index 83548a463ff..d5509e86623 100644
--- a/packages/geoview-core/public/templates/inter-modify.html
+++ b/packages/geoview-core/public/templates/inter-modify.html
@@ -89,9 +89,6 @@ 

1. Modify (simple case)

>
- -

-    

     
diff --git a/packages/geoview-core/public/templates/inter-select.html b/packages/geoview-core/public/templates/inter-select.html
index 7c3a2ddca76..76945d91954 100644
--- a/packages/geoview-core/public/templates/inter-select.html
+++ b/packages/geoview-core/public/templates/inter-select.html
@@ -92,9 +92,6 @@ 

1. Select (simple case)

>
- -

-    

     
diff --git a/packages/geoview-core/public/templates/inter-snap.html b/packages/geoview-core/public/templates/inter-snap.html
index 72faca7c6d7..721af59ee11 100644
--- a/packages/geoview-core/public/templates/inter-snap.html
+++ b/packages/geoview-core/public/templates/inter-snap.html
@@ -92,9 +92,6 @@ 

1. Snap (simple case)

>
- -

-    

     
diff --git a/packages/geoview-core/public/templates/inter-translate.html b/packages/geoview-core/public/templates/inter-translate.html
index c149c287da6..fc828e12fcb 100644
--- a/packages/geoview-core/public/templates/inter-translate.html
+++ b/packages/geoview-core/public/templates/inter-translate.html
@@ -89,9 +89,6 @@ 

1. Translate (simple case)

>
- -

-    

     
diff --git a/packages/geoview-core/public/templates/languages.html b/packages/geoview-core/public/templates/languages.html
index 5fd0b413cda..da2322114a7 100644
--- a/packages/geoview-core/public/templates/languages.html
+++ b/packages/geoview-core/public/templates/languages.html
@@ -157,6 +157,10 @@ 

2. English

const lang = cgpv.api.maps['LNG1'].getDisplayLanguage() === 'en' ? 'fr' : 'en'; cgpv.api.maps['LNG1'].setLanguage(lang, true); }); + + // create snippets + createCodeSnippet(); + createConfigSnippet(); diff --git a/packages/geoview-core/public/templates/raw-feature-info.html b/packages/geoview-core/public/templates/raw-feature-info.html index 3e2789ff39b..ec9dc780d37 100644 --- a/packages/geoview-core/public/templates/raw-feature-info.html +++ b/packages/geoview-core/public/templates/raw-feature-info.html @@ -1,60 +1,59 @@ + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + +
+ + + + + + + + + + +
+

Panel - Feature Info

+
+ Main
+ 1. Basic map English Geo.ca theme
+ 2. Basic map French Dark theme
+ 3. Basic map English Light theme
+
+ + + + + + +
This page is used to test the creation and integration of the Feature Info component in a responsive design.
+
- - - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - - - - - - - -
- - - - - - - - - - -
-

Panel - Feature Info

-
- Main
- 1. Basic map English Geo.ca theme
- 1. Basic map French Dark theme
-
- - - - - - -
This page is used to test the creation and integration of the Feature Info component in a responsive - design.
-
- - -

-  
-

1. Basic Map English Geo.ca theme

- Top -
-
Click and Hover event listeners +

+    
+

1. Basic Map English Geo.ca theme

+ Top +
+
1. Basic Map English Geo.ca theme 'corePackages': [], 'externalPackages': [], 'suportedLanguages': ['en', 'fr'] - }">
-
-
Click on a layer on the map
-
- -

+    }"
+    >
+
+
Click on a layer on the map
+
+ +

 
-  
-

2. Basic Map French Dark theme

- Top -
-
+

2. Basic Map French Dark theme

+ Top +
+
2. Basic Map French Dark theme 'corePackages': [], 'externalPackages': [], 'suportedLanguages': ['en', 'fr'] - }">
-
+ }" + > +
-
-

2. Basic Map English Light theme

- Top -
-
+

3. Basic Map English Light theme

+ Top +
+
2. Basic Map English Light theme 'corePackages': [], 'externalPackages': [], 'suportedLanguages': ['en', 'fr'] - }">
-
+ }" + > +
- - + - + }); - \ No newline at end of file + //create snippets + createConfigSnippet(); + createCodeSnippet(); + }); + + + diff --git a/packages/geoview-core/public/templates/sandbox.html b/packages/geoview-core/public/templates/sandbox.html index 85219a3b4f3..758cdef4892 100644 --- a/packages/geoview-core/public/templates/sandbox.html +++ b/packages/geoview-core/public/templates/sandbox.html @@ -122,6 +122,11 @@

Sandbox Configuration

}] }, 'components': ['overview-map'], + 'footerBar': { + 'tabs': { + 'core': ['legend', 'layers', 'details', 'data-table'] + } + }, 'corePackages': [], 'theme': 'dark', 'suportedLanguages': ['en'] @@ -248,6 +253,11 @@

Sanbox Map

}] }, 'components': ['overview-map'], + 'footerBar': { + 'tabs': { + 'core': ['legend', 'layers', 'details', 'data-table'] + } + }, 'corePackages': [], 'theme': 'dark', 'suportedLanguages': ['en'] diff --git a/packages/geoview-core/public/templates/ui-components.html b/packages/geoview-core/public/templates/ui-components.html index 088de1a361e..dc7416fc8c3 100644 --- a/packages/geoview-core/public/templates/ui-components.html +++ b/packages/geoview-core/public/templates/ui-components.html @@ -74,7 +74,7 @@

1. Slider MUI Component

'metadataAccessPath': { 'en': 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/historical_flood_event_en/MapServer' }, - 'geoviewLayerType': 'esriDynamic', + 'geoviewLayerType': 'esriFeature', 'listOfLayerEntryConfig': [ { 'layerId': '0' @@ -147,7 +147,7 @@

Accessing slider value from outside of the core viewer using api event liste track: 'normal', customOnChange: (dates) => { const field = cgpv.api.maps.UI1.layer.geoviewLayer('historical-flood/0').getTemporalDimension().field; - cgpv.api.maps.UI1.layer.geoviewLayer('historical-flood/0)').applyViewFilter(`${field} >= date '${dates[0]}-01-01' and ${field} <= date '${dates[1]}-12-31'`); + cgpv.api.maps.UI1.layer.geoviewLayer('historical-flood/0').applyViewFilter(`${field} >= date '${dates[0]}-01-01' and ${field} <= date '${dates[1]}-12-31'`); }, }) ); diff --git a/packages/geoview-core/src/core/utils/config/reader/div-config-reader.ts b/packages/geoview-core/src/core/utils/config/reader/div-config-reader.ts index 98348b7c488..36d99817b35 100644 --- a/packages/geoview-core/src/core/utils/config/reader/div-config-reader.ts +++ b/packages/geoview-core/src/core/utils/config/reader/div-config-reader.ts @@ -2,6 +2,7 @@ import { TypeMapFeaturesConfig } from '@/core/types/global-types'; import { isJsonString, removeCommentsFromJSON } from '../../utilities'; import { logger } from '@/core/utils/logger'; +import { api } from '@/app'; // ****************************************************************************************************************************** // ****************************************************************************************************************************** @@ -45,6 +46,7 @@ export class InlineDivConfigReader { if (!isJsonString(configObjStr)) { logger.logWarning(`- Map: ${mapId} - Invalid JSON configuration object in div, a fallback strategy will be used -`); + api.utilities.showError(mapId, api.utilities.getLocalizedMessage(mapId, 'validation.invalidConfig'), true); } else { mapConfig = { ...JSON.parse(configObjStr) }; } diff --git a/packages/geoview-core/src/geo/map/map-viewer.ts b/packages/geoview-core/src/geo/map/map-viewer.ts index 6f198516d7e..8d6ccd8b7f8 100644 --- a/packages/geoview-core/src/geo/map/map-viewer.ts +++ b/packages/geoview-core/src/geo/map/map-viewer.ts @@ -202,7 +202,7 @@ export class MapViewer { let allGeoviewLayerReady = this.mapFeaturesConfig.map.listOfGeoviewLayerConfig?.length === 0 || Object.keys(geoviewLayers).length !== 0; Object.keys(geoviewLayers).forEach((geoviewLayerId) => { - const layerIsReady = geoviewLayers[geoviewLayerId].allLayerStatusAreIn(['error', 'loaded']); + const layerIsReady = geoviewLayers[geoviewLayerId].allLayerStatusAreIn(['processed', 'error', 'loaded']); logger.logTraceDetailed('map-viewer.mapReady? geoview layer ready?', geoviewLayerId, layerIsReady); allGeoviewLayerReady &&= layerIsReady; }); @@ -210,7 +210,9 @@ export class MapViewer { // Log logger.logInfo('Map is ready', this.mapId); logger.logMarkerCheck(`mapReady-${this.mapId}`, 'for map to be ready'); - MapEventProcessor.setMapLoaded(this.mapId); + // ! We added processed to layers check so this map loaded event is fired faster + // TODO: solve this without using a timeout... + setTimeout(() => MapEventProcessor.setMapLoaded(this.mapId), 1000); clearInterval(layerInterval); } } diff --git a/packages/geoview-core/webpack.common.js b/packages/geoview-core/webpack.common.js index 84b98ae23eb..48269befb7a 100644 --- a/packages/geoview-core/webpack.common.js +++ b/packages/geoview-core/webpack.common.js @@ -18,7 +18,7 @@ const hash = JSON.stringify(childProcess.execSync('git rev-parse HEAD').toString console.log(`Build CGP Viewer: ${major}.${minor}.${patch} - ${date}`); // inject all sample files -const multipleHtmlPlugins1 = glob.sync('./public/templates/*.html').map((name) => { +const multipleHtmlPluginsSamples = glob.sync('./public/templates/*.html').map((name) => { return new HtmlWebpackPlugin({ template: `${name}`, filename: `${name.substring(name.lastIndexOf('/') + 1, name.length)}`, @@ -30,7 +30,19 @@ const multipleHtmlPlugins1 = glob.sync('./public/templates/*.html').map((name) = }); // inject all layer files -const multipleHtmlPlugins2 = glob.sync('./public/templates/layers/*.html').map((name) => { +const multipleHtmlPluginsLayers = glob.sync('./public/templates/layers/*.html').map((name) => { + return new HtmlWebpackPlugin({ + template: `${name}`, + filename: `${name.substring(name.lastIndexOf('/') + 1, name.length)}`, + title: 'Canadian Geospatial Platform Viewer', + inject: 'head', + scriptLoading: 'blocking', + chunks: ['cgpv-main'], + }); +}); + +// inject all demos files +const multipleHtmlPluginsDemos = glob.sync('./public/templates/demos/*.html').map((name) => { return new HtmlWebpackPlugin({ template: `${name}`, filename: `${name.substring(name.lastIndexOf('/') + 1, name.length)}`, @@ -175,8 +187,9 @@ const config = { }, }), ] - .concat(multipleHtmlPlugins1) - .concat(multipleHtmlPlugins2), + .concat(multipleHtmlPluginsSamples) + .concat(multipleHtmlPluginsLayers) + .concat(multipleHtmlPluginsDemos), }; module.exports = config; diff --git a/packages/geoview-swiper/src/swiper.tsx b/packages/geoview-swiper/src/swiper.tsx index 5d83f7b98da..c908bd32c85 100644 --- a/packages/geoview-swiper/src/swiper.tsx +++ b/packages/geoview-swiper/src/swiper.tsx @@ -268,7 +268,7 @@ export function Swiper(props: SwiperProps): JSX.Element { if (payloadIsLayerSetUpdated(payload) && payload.resultsSet[payload.layerPath]?.layerStatus === 'loaded') { const layerId = payload.layerPath.split('/')[0]; const ids = [...layersIds]; - if (ids.indexOf(layerId) === -1) { + if (ids.indexOf(layerId) === -1 && config.layers.includes(layerId)) { ids.push(layerId); setLayersIds(ids); } diff --git a/rush.json b/rush.json index e7849a0e0ba..190bc61827b 100644 --- a/rush.json +++ b/rush.json @@ -2,7 +2,7 @@ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", "rushVersion": "5.113.4", "pnpmVersion": "8.15.2", - "nodeSupportedVersionRange": ">=16.0.0 <21.8.0", + "nodeSupportedVersionRange": ">=20.11.0 <21.8.0", "pnpmOptions": { "strictPeerDependencies": false, "useWorkspaces": true