diff --git a/packages/geoview-core/public/configs/navigator/14-wms-layer.json b/packages/geoview-core/public/configs/navigator/14-wms-layer.json index 98af18fd3cc..fb446f5b70b 100644 --- a/packages/geoview-core/public/configs/navigator/14-wms-layer.json +++ b/packages/geoview-core/public/configs/navigator/14-wms-layer.json @@ -10,6 +10,26 @@ "labeled": true }, "listOfGeoviewLayerConfig": [ + { + "geoviewLayerId": "Hydro", + "geoviewLayerName": "Hydro - Scale" , + "metadataAccessPath": "https://maps.geogratis.gc.ca/wms/hydro_network_en", + "geoviewLayerType": "ogcWms", + "listOfLayerEntryConfig": [ + { + "layerId": "nhn:nhn", + "layerName": "National Hydro Network (NHN)" + }, + { + "layerId": "nhn:nhnda", + "layerName": "Drainage Areas" + }, + { + "layerId": "nhn:toponyms", + "layerName": "Toponyms" + } + ] + }, { "geoviewLayerId": "wmsLYR1-Root", "geoviewLayerName": "Weather Group", @@ -91,6 +111,17 @@ } } ] + }, + { + "geoviewLayerId": "LYR1", + "geoviewLayerName": "Canada Energy Regulator", + "metadataAccessPath": "https://maps-cartes.services.geo.ca/server_serveur/services/NRCan/CER_Assessments_EN/MapServer/WMSServer", + "geoviewLayerType": "ogcWms", + "listOfLayerEntryConfig": [ + { + "layerId": "0" + } + ] } ] }, diff --git a/packages/geoview-core/public/configs/navigator/16-esri-dynamic.json b/packages/geoview-core/public/configs/navigator/16-esri-dynamic.json index f80d9f4698a..6b0d30b5f3e 100644 --- a/packages/geoview-core/public/configs/navigator/16-esri-dynamic.json +++ b/packages/geoview-core/public/configs/navigator/16-esri-dynamic.json @@ -214,6 +214,213 @@ "layerId": "0" } ] + }, + { + "geoviewLayerId": "classBreaksId", + "geoviewLayerName": "classBreaks", + "metadataAccessPath": "https://maps-cartes.ec.gc.ca/arcgis/rest/services/DMS/CSO_volume/MapServer/", + "geoviewLayerType": "esriDynamic", + "listOfLayerEntryConfig": [ + { + "layerId": "8", + "layerFilter": "Total_CSO_Volume > 5000000", + "style": { + "Point": { + "styleId": "classBreaksId", + "styleType": "classBreaks", + "defaultLabel": "Pas de données de volume / No volume data", + "defaultSettings": { + "symbol": "square", + "type": "simpleSymbol", + "color": "rgba(255,127,127,1)", + "offset": [0, 0], + "rotation": 0, + "size": 2.0010000000000003, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + }, + "defaultVisible": true, + "field": "Total_CSO_Volume", + "classBreakStyleInfo": [ + { + "label": "0 m3", + "minValue": 0, + "maxValue": 0, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(76,230,0,1)", + "offset": [0, 0], + "rotation": 0, + "size": 2.6679999999999997, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "0.0001 - ≤ 5,000,000 m3", + "minValue": 0, + "maxValue": 5000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 5.114407777777778, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 5,000,000 - ≤ 10,000,000 m3", + "minValue": 5000000, + "maxValue": 10000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 7.560815555555555, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 10,000,000 - ≤ 15,000,000 m3", + "minValue": 10000000, + "maxValue": 15000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 10.007223333333332, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 15,000,000 - ≤ 20,000,000 m3", + "minValue": 15000000, + "maxValue": 20000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 12.453631111111111, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 20,000,000 - ≤ 25,000,000 m3", + "minValue": 20000000, + "maxValue": 25000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 14.90003888888889, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 25,000,000 - ≤ 30,000,000 m3", + "minValue": 25000000, + "maxValue": 30000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 17.346446666666665, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 30,000,000 - ≤ 35,000,000 m3", + "minValue": 30000000, + "maxValue": 35000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 19.792854444444444, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 35,000,000 m3", + "minValue": 35000000, + "maxValue": 999000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 22.239262222222223, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + } + ] + } + } + } + ] } ] }, diff --git a/packages/geoview-core/public/configs/navigator/17-esri-feature.json b/packages/geoview-core/public/configs/navigator/17-esri-feature.json index 7e4981703c3..80155137948 100644 --- a/packages/geoview-core/public/configs/navigator/17-esri-feature.json +++ b/packages/geoview-core/public/configs/navigator/17-esri-feature.json @@ -43,6 +43,213 @@ "layerId": "0" } ] + }, + { + "geoviewLayerId": "classBreaksId", + "geoviewLayerName": "classBreaks", + "metadataAccessPath": "https://maps-cartes.ec.gc.ca/arcgis/rest/services/DMS/CSO_volume/MapServer/", + "geoviewLayerType": "esriFeature", + "listOfLayerEntryConfig": [ + { + "layerId": "8", + "layerFilter": "Total_CSO_Volume > 5000000", + "style": { + "Point": { + "styleId": "classBreaksId", + "styleType": "classBreaks", + "defaultLabel": "Pas de données de volume / No volume data", + "defaultSettings": { + "symbol": "square", + "type": "simpleSymbol", + "color": "rgba(255,127,127,1)", + "offset": [0, 0], + "rotation": 0, + "size": 2.0010000000000003, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + }, + "defaultVisible": true, + "field": "Total_CSO_Volume", + "classBreakStyleInfo": [ + { + "label": "0 m3", + "minValue": 0, + "maxValue": 0, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(76,230,0,1)", + "offset": [0, 0], + "rotation": 0, + "size": 2.6679999999999997, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "0.0001 - ≤ 5,000,000 m3", + "minValue": 0, + "maxValue": 5000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 5.114407777777778, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 5,000,000 - ≤ 10,000,000 m3", + "minValue": 5000000, + "maxValue": 10000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 7.560815555555555, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 10,000,000 - ≤ 15,000,000 m3", + "minValue": 10000000, + "maxValue": 15000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 10.007223333333332, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 15,000,000 - ≤ 20,000,000 m3", + "minValue": 15000000, + "maxValue": 20000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 12.453631111111111, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 20,000,000 - ≤ 25,000,000 m3", + "minValue": 20000000, + "maxValue": 25000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 14.90003888888889, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 25,000,000 - ≤ 30,000,000 m3", + "minValue": 25000000, + "maxValue": 30000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 17.346446666666665, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 30,000,000 - ≤ 35,000,000 m3", + "minValue": 30000000, + "maxValue": 35000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 19.792854444444444, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + }, + { + "label": "> 35,000,000 m3", + "minValue": 35000000, + "maxValue": 999000000, + "visible": true, + "settings": { + "symbol": "circle", + "type": "simpleSymbol", + "color": "rgba(196,97,255,1)", + "offset": [0, 0], + "rotation": 0, + "size": 22.239262222222223, + "stroke": { + "color": "rgba(0,0,0,1)", + "lineStyle": "solid", + "width": 0.5 + } + } + } + ] + } + } + } + ] } ] }, diff --git a/packages/geoview-core/public/configs/navigator/20-wfs.json b/packages/geoview-core/public/configs/navigator/20-wfs.json index fcf84317c33..daeb02b100b 100644 --- a/packages/geoview-core/public/configs/navigator/20-wfs.json +++ b/packages/geoview-core/public/configs/navigator/20-wfs.json @@ -35,6 +35,19 @@ "layerName": "Current Conditions" } ] + }, + { + "geoviewLayerId": "wfsLYR4", + "geoviewLayerName": "USGS mrds bbox strategy", + "metadataAccessPath": "https://mrdata.usgs.gov/services/wfs/mrds?request=GetCapabilities&service=WFS&version=1.1.0", + "geoviewLayerType": "ogcWfs", + "listOfLayerEntryConfig": [ + { + "layerId": "mrds", + "source": { "strategy": "bbox" }, + "layerName": "USGS mrds" + } + ] } ] }, diff --git a/packages/geoview-core/public/configs/navigator/28-geocore.json b/packages/geoview-core/public/configs/navigator/28-geocore.json new file mode 100644 index 00000000000..4d265953b33 --- /dev/null +++ b/packages/geoview-core/public/configs/navigator/28-geocore.json @@ -0,0 +1,50 @@ +{ + "map": { + "interaction": "dynamic", + "viewSettings": { + "projection": 3978 + }, + "basemapOptions": { + "basemapId": "transport", + "shaded": true, + "labeled": false + }, + "listOfGeoviewLayerConfig": [ + { + "geoviewLayerType": "geoCore", + "geoviewLayerId": "21b821cf-0f1c-40ee-8925-eab12d357668" + }, + { + "geoviewLayerType": "geoCore", + "geoviewLayerId": "ccc75c12-5acc-4a6a-959f-ef6f621147b9" + }, + { + "geoviewLayerType": "geoCore", + "geoviewLayerId": "0fca08b5-e9d0-414b-a3c4-092ff9c5e326" + }, + { + "geoviewLayerType": "geoCore", + "geoviewLayerId": "03ccfb5c-a06e-43e3-80fd-09d4f8f69703" + } + ] + }, + "components": [ + "overview-map" + ], + "overviewMap": { + "hideOnZoom": 7 + }, + "footerBar": { + "tabs": { + "core": [ + "legend", + "layers", + "details", + "geochart", + "data-table" + ] + } + }, + "corePackages": [], + "theme": "geo.ca" +} \ No newline at end of file diff --git a/packages/geoview-core/public/configs/navigator/29-geopackages.json b/packages/geoview-core/public/configs/navigator/29-geopackages.json new file mode 100644 index 00000000000..8ef252f2af1 --- /dev/null +++ b/packages/geoview-core/public/configs/navigator/29-geopackages.json @@ -0,0 +1,69 @@ +{ + "map": { + "interaction": "dynamic", + "viewSettings": { + "projection": 3978 + }, + "basemapOptions": { + "basemapId": "transport", + "shaded": true, + "labeled": false + }, + "listOfGeoviewLayerConfig": [ + { + "geoviewLayerId": "GeoPackageLYR1", + "geoviewLayerName": "Natural Earth", + "geoviewLayerType": "GeoPackage", + "listOfLayerEntryConfig": [ + { + "layerId": "Natural_Earth_QGIS_layers_and_styles.gpkg", + "layerName": "Natural Earth", + "source": { + "dataAccessPath": "./datasets/geopackages" + } + } + ] + }, + { + "geoviewLayerId": "GeoPackageLYR2", + "geoviewLayerName": "Rivers and Canals", + "geoviewLayerType": "GeoPackage", + "listOfLayerEntryConfig": [ + { + "layerId": "QGIS Packaged Layers (D+S Canal).gpkg", + "layerName": "D+S Canal", + "source": { + "dataAccessPath": "./datasets/geopackages" + } + }, + { + "layerId": "rivers.gpkg", + "layerName": "Rivers", + "source": { + "dataAccessPath": "./datasets/geopackages" + } + } + ] + } + ] + }, + "components": [ + "overview-map" + ], + "overviewMap": { + "hideOnZoom": 7 + }, + "footerBar": { + "tabs": { + "core": [ + "legend", + "layers", + "details", + "geochart", + "data-table" + ] + } + }, + "corePackages": [], + "theme": "geo.ca" +} \ No newline at end of file diff --git a/packages/geoview-core/public/css/style.css b/packages/geoview-core/public/css/style.css index 8b799c3d473..253d96f945f 100644 --- a/packages/geoview-core/public/css/style.css +++ b/packages/geoview-core/public/css/style.css @@ -28,6 +28,7 @@ td { color: white; cursor: pointer; padding: 18px; + margin: 3px 0px; width: 100%; border: none; text-align: left; @@ -42,12 +43,12 @@ td { .panel { display: none; - width: 100%; background: #ffffff; + margin: 2px 0px 5px 0px; box-shadow: 0px 0px 2px 2px #666666; -webkit-box-shadow: 2px 2px 5px 5x #666666; -moz-box-shadow: 2px 2px 5px 5px #666666; - padding: 10px; + padding: 5px; font-size: 12px; overflow: auto; max-height: 400px; diff --git a/packages/geoview-core/public/index.html b/packages/geoview-core/public/index.html index 2f792518d6e..d495a837c7d 100644 --- a/packages/geoview-core/public/index.html +++ b/packages/geoview-core/public/index.html @@ -29,7 +29,6 @@
${script.textContent - .replace('//create snippets\n', '') - .replace('createConfigSnippet();\n', '') - .replace('createCodeSnippet();\n', '')}`; - } else loop = false; - } -} - -function createCodeSnippetUsingIDs() { - 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) - // Get all scripts on page which has an id - const scripts = Array.prototype.filter.call(document.getElementsByTagName('script'), (obj) => { - return obj.getAttribute('id') !== null; - }); - - // Loop on each script - for (let i = 0; i < scripts.length; i++) { - // Try to find a codeSnippet flag interested in that script - const script = scripts[i]; - document.querySelectorAll(`[id-script="${script.id}"]`).forEach((el) => { - // eslint-disable-next-line no-param-reassign - el.innerHTML = `
${script.textContent}`; - }); - } -} - -function createConfigSnippet() { - sleep(500); - - let j = 0; - // inject configuration snippet inside panel - for (j = 0; j < document.getElementsByClassName('geoview-map').length; j++) { - let configSnippet = ''; - const mapID = document.getElementsByClassName('geoview-map')[j].id; - configSnippet = document.getElementById(mapID).attributes['data-config']; - const el = document.getElementById(`${mapID}CS`); - - // check if JSON can be parsed, if not do nothing - try { - if (configSnippet !== undefined && el !== null) { - // Erase comments in the configSnippet. - const uncommentedConfigSnippet = configSnippet.value - .split(/(? { - if (index % 2) return fragment.replaceAll(/\/\*/gm, String.fromCharCode(1)).replaceAll(/\*\//gm, String.fromCharCode(2)); - return fragment; // .replaceAll(/\/\*(?<=\/\*)((?:.|\n|\r)*?)(?=\*\/)\*\//gm, ''); - }) - .join("'") - .replaceAll(/\/\*(?<=\/\*)((?:.|\n|\r)*?)(?=\*\/)\*\//gm, '') - .replaceAll(String.fromCharCode(1), '/*') - .replaceAll(String.fromCharCode(2), '*/'); - - el.textContent = JSON.stringify( - JSON.parse( - uncommentedConfigSnippet - // remove CR and LF from the map config - .replace(/(\r\n|\n|\r)/gm, '') - // replace apostrophes not preceded by a backslash with quotes - .replace(/(? { + return obj.getAttribute('id') === null; + }); + + const script = scripts[scripts.length - 1]; + for (let i = 0, loop = true; loop; i++) { + const el = document.getElementById(`codeSnippet${i || ''}`); + if (el !== null) { + el.innerHTML = `
${script.textContent + .replace('//create snippets\n', '') + .replace('createConfigSnippet();\n', '') + .replace('createCodeSnippet();\n', '')}`; + } else loop = false; + } +} + +function createCodeSnippetUsingIDs() { + 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) + // Get all scripts on page which has an id + const scripts = Array.prototype.filter.call(document.getElementsByTagName('script'), (obj) => { + return obj.getAttribute('id') !== null; + }); + + // Loop on each script + for (let i = 0; i < scripts.length; i++) { + // Try to find a codeSnippet flag interested in that script + const script = scripts[i]; + document.querySelectorAll(`[id-script="${script.id}"]`).forEach((el) => { + // eslint-disable-next-line no-param-reassign + el.innerHTML = `
${script.textContent}`; + }); + } +} + +function createConfigSnippet() { + sleep(500); + + let j = 0; + // inject configuration snippet inside panel + for (j = 0; j < document.getElementsByClassName('geoview-map').length; j++) { + let configSnippet = ''; + const mapID = document.getElementsByClassName('geoview-map')[j].id; + configSnippet = document.getElementById(mapID).attributes['data-config']; + const el = document.getElementById(`${mapID}CS`); + + // check if JSON can be parsed, if not do nothing + try { + if (configSnippet !== undefined && el !== null) { + // Erase comments in the configSnippet. + const uncommentedConfigSnippet = configSnippet.value + .split(/(? { + if (index % 2) return fragment.replaceAll(/\/\*/gm, String.fromCharCode(1)).replaceAll(/\*\//gm, String.fromCharCode(2)); + return fragment; // .replaceAll(/\/\*(?<=\/\*)((?:.|\n|\r)*?)(?=\*\/)\*\//gm, ''); + }) + .join("'") + .replaceAll(/\/\*(?<=\/\*)((?:.|\n|\r)*?)(?=\*\/)\*\//gm, '') + .replaceAll(String.fromCharCode(1), '/*') + .replaceAll(String.fromCharCode(2), '*/'); + + el.textContent = JSON.stringify( + JSON.parse( + uncommentedConfigSnippet + // remove CR and LF from the map config + .replace(/(\r\n|\n|\r)/gm, '') + // replace apostrophes not preceded by a backslash with quotes + .replace(/(? { + const { resultSet } = payload; + const outputHeader = '
Name | Status |
---|---|
${layerName} | ${layerStatus} |