Skip to content

Commit

Permalink
Minor configure-beta parsing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Nov 26, 2024
1 parent 2a9258e commit 39f526c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 215 deletions.
213 changes: 2 additions & 211 deletions API/templates/config_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
tools: [
{
name: "Layers",
icon: "buffer",
icon: "layers",
js: "LayersTool",
},
{
Expand All @@ -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: [],
};
10 changes: 9 additions & 1 deletion configure/src/core/Maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ const getComponent = (
true,
conf
);

conf = updateConfiguration(
"maxZoom",
maxNativeZoom,
layer,
true,
conf
);
updateConfiguration(
"boundingBox",
boundingBox,
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/essence/Basics/Map_/Map_.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 39f526c

Please sign in to comment.