From 39f526cd77644bfd76767e13268b567b9c161aac Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Tue, 26 Nov 2024 12:10:51 -0800 Subject: [PATCH] Minor configure-beta parsing fixes --- API/templates/config_template.js | 213 +------------------------------ configure/src/core/Maker.js | 10 +- src/essence/Basics/Map_/Map_.js | 6 +- 3 files changed, 14 insertions(+), 215 deletions(-) diff --git a/API/templates/config_template.js b/API/templates/config_template.js index 5552331d..da731940 100644 --- a/API/templates/config_template.js +++ b/API/templates/config_template.js @@ -48,7 +48,7 @@ module.exports = { tools: [ { name: "Layers", - icon: "buffer", + icon: "layers", js: "LayersTool", }, { @@ -61,215 +61,6 @@ module.exports = { icon: "information-variant", js: "InfoTool", }, - { - name: "Sites", - icon: "pin", - js: "SitesTool", - variables: { - sites: [ - { - name: "Site1", - code: "S1", - view: [-4.667975771815966, 137.370253354311, 16], - }, - { - name: "Site2", - code: "S2", - view: [-4.667985128408622, 137.3702734708786, 20], - }, - ], - }, - }, - { - name: "Chemistry", - icon: "flask", - js: "ChemistryTool", - }, - { - name: "Draw", - icon: "lead-pencil", - js: "DrawTool", - }, - { - name: "FileManager", - icon: "folder-multiple", - js: "FileManagerTool", - }, - { - name: "Identifier", - icon: "map-marker", - js: "IdentifierTool", - variables: { - "Tile with DEM": { - url: "Data/missionDEM.tif", - unit: "m", - }, - }, - }, - { - name: "Measure", - icon: "chart-areaspline", - js: "MeasureTool", - variables: { - dem: "Data/missionDEM.tif", - }, - }, - ], - layers: [ - { - name: "A Header", - type: "header", - initialOpacity: 1, - sublayers: [ - { - name: "S1 Drawings", - kind: "none", - type: "vector", - url: "Drawn/S1_speDrawings.geojson", - tms: true, - visibility: false, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "s1drawings", - color: "undefined", - fillColor: "undefined", - weight: null, - fillOpacity: 1, - opacity: 1, - }, - variables: {}, - radius: 1, - }, - { - name: "S2 Drawings", - kind: "none", - type: "vector", - url: "Drawn/S2_speDrawings.geojson", - tms: true, - visibility: false, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "s2drawings", - color: "undefined", - fillColor: "undefined", - weight: null, - fillOpacity: 1, - opacity: 1, - }, - variables: {}, - radius: 1, - }, - { - name: "ChemCam", - kind: "none", - type: "vector", - url: "Layers/ChemCam/chemcam.json", - tms: true, - visibility: true, - visibilitycutoff: 17, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "chemcam", - color: "prop:color1", - fillColor: "prop:color3", - weight: 2, - fillOpacity: 1, - opacity: 1, - }, - variables: { - useKeyAsName: "TARGET", - chemistry: [ - "Al2O3", - "CaO", - "FeOT", - "K2O", - "MgO", - "Na2O", - "SiO2", - "TiO2", - ], - search: "(TARGET)", - }, - radius: 5, - }, - { - name: "Waypoints", - kind: "none", - type: "vector", - url: "Layers/Waypoints/waypoints.json", - legend: "Layers/Waypoints/legend.csv", - tms: true, - visibility: true, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "waypoints", - color: "white", - fillColor: "#000", - weight: 2, - fillOpacity: 1, - opacity: 1, - }, - variables: {}, - radius: 8, - }, - { - name: "Polygon", - kind: "none", - type: "vector", - url: "Layers/Polygon/polygon.geojson", - tms: true, - visibility: false, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "polygon", - color: "prop:somecolor", - fillColor: "prop:fill", - weight: 2, - fillOpacity: 0.7, - opacity: 1, - }, - variables: {}, - radius: 4, - }, - { - name: "Line", - kind: "none", - type: "vector", - url: "Layers/Line/line.json", - tms: true, - visibility: false, - initialOpacity: 1, - togglesWithHeader: true, - style: { - className: "line", - color: "white", - fillColor: "white", - weight: 5, - fillOpacity: 1, - opacity: 1, - }, - variables: {}, - radius: 1, - }, - { - name: "Tile with DEM", - type: "tile", - url: "Layers/TilewithDEM/Gale_HiRISE/{z}/{x}/{y}.png", - demtileurl: "Layers/TilewithDEM/Gale_HiRISE_DEM/{z}/{x}/{y}.png", - tms: true, - visibility: true, - initialOpacity: 1, - togglesWithHeader: true, - minZoom: 16, - maxNativeZoom: 17, - maxZoom: 22, - }, - ], - }, ], + layers: [], }; diff --git a/configure/src/core/Maker.js b/configure/src/core/Maker.js index e9b5939a..e8ee4566 100644 --- a/configure/src/core/Maker.js +++ b/configure/src/core/Maker.js @@ -285,6 +285,14 @@ const getComponent = ( true, conf ); + + conf = updateConfiguration( + "maxZoom", + maxNativeZoom, + layer, + true, + conf + ); updateConfiguration( "boundingBox", boundingBox, @@ -1055,7 +1063,7 @@ function tilePopulateFromXML( "," + xml.getElementsByTagName("BoundingBox")[0].attributes["maxy"].value; - cb(minZoom, maxNativeZoom, boundingBox); + cb(parseInt(minZoom), parseInt(maxNativeZoom), boundingBox.split(",")); } catch (err) { errorCallback(err); } diff --git a/src/essence/Basics/Map_/Map_.js b/src/essence/Basics/Map_/Map_.js index 1ec1da67..b303bb20 100644 --- a/src/essence/Basics/Map_/Map_.js +++ b/src/essence/Basics/Map_/Map_.js @@ -909,9 +909,9 @@ async function makeTileLayer(layerObj) { } else tileFormat = layerObj.tileformat L_.layers.layer[layerObj.name] = L.tileLayer.colorFilter(layerUrl, { - minZoom: layerObj.minZoom, - maxZoom: layerObj.maxZoom, - maxNativeZoom: layerObj.maxNativeZoom, + minZoom: parseInt(layerObj.minZoom), + maxZoom: parseInt(layerObj.maxZoom), + maxNativeZoom: parseInt(layerObj.maxNativeZoom), tileFormat: tileFormat, tms: tileFormat === 'tms', //noWrap: true,