diff --git a/docs/pages/Configure/Layers/Data/Data.md b/docs/pages/Configure/Layers/Data/Data.md index 4922d0a6..bed7d4f2 100644 --- a/docs/pages/Configure/Layers/Data/Data.md +++ b/docs/pages/Configure/Layers/Data/Data.md @@ -79,6 +79,7 @@ Data layers need a configured `shader` raw variable to be effective. Supported s - ramps: An array of arrays of hex color strings. "transparent" is a special keyword for a fully transparent ramp color. - "image": (Default) Simply shows the underlying raw data in an image form. Mainly for testing, it can also be useful for development for internal pass-tile-canvas-instead-of-url layers. + Example: ```javascript @@ -97,6 +98,9 @@ Example: "#0000FF" ] ] - } + }, + "downloadURL": "(str) url_to_data/data.tif" } ``` + +- `downloadURL`: Provides a menu option for users to download the specified source data file for the layer. diff --git a/docs/pages/Configure/Layers/Tile/Tile.md b/docs/pages/Configure/Layers/Tile/Tile.md index 4ed4ee55..4ca47c08 100644 --- a/docs/pages/Configure/Layers/Tile/Tile.md +++ b/docs/pages/Configure/Layers/Tile/Tile.md @@ -115,6 +115,7 @@ Example: "value_in_response_to_replace_with.use.dot.notation.to.traverse.objects", }, }, + "downloadURL": "(str) url_to_data/data.tif", "tools": { "measure": { "layerDems": [ @@ -141,3 +142,4 @@ Example: - `shortcutSuffix`: A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts. - `urlReplacements`: For the case where parts or all of a tileset's url comes from intermediary endpoints. For example a service may require sending a query to a server that then returns a uuid and that uuid is required in the tileset's url to query it. +- `downloadURL`: Provides a menu option for users to download the specified source data file for the layer. diff --git a/src/essence/Tools/Layers/LayersTool.js b/src/essence/Tools/Layers/LayersTool.js index 5fe08e41..402a072c 100644 --- a/src/essence/Tools/Layers/LayersTool.js +++ b/src/essence/Tools/Layers/LayersTool.js @@ -300,6 +300,24 @@ function interfaceWithMMGIS(fromInit) { '', ].join('\n') break + case 'data': + case 'tile': + layerExport = '' + // Add download URL for raster layers + if(node[i].hasOwnProperty('variables')) { + if(node[i].variables.hasOwnProperty('downloadURL')) { + layerExport = [ + '