NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 26 forks source link

add WMTS layer to portal via portal editor #2315

Open mbjones opened 5 months ago

mbjones commented 5 months ago

Describe the feature you'd like I'd like the ability to add a WMTS layer to a given portal by simply providing the WMTS layer metadata via the portal editor.

Is your feature request related to a problem? Please describe. There is no UI for adding, editing, or removing portal layers.

Additional context

A WMTS layer can currently be configured in a cesium portal using:

{
  "visible": false,
  "type": "WebMapTileServiceImageryProvider",
  "label": "Alaska High Resolution Imagery",
  "description": "A detailed and accurate color imagery of the State of Alaska, featuring a resolution of 50cm with images having less than 10% cloud cover.",
  "citation": "Alaska High Resolution Imagery (RGB). 2022. Maxar Products. Maxar Technologies Inc., Alaska Geospatial Office, USGS.",
  "moreInfoLink": "https://gis.data.alaska.gov/pages/imagery",
  "downloadLink": "https://geoportal.alaska.gov/portal/home/item.html?id=d462231cc1454e1abb2dccd9a709a476#overview",
  "cesiumOptions": {
    "url": "https://geoportal.alaska.gov/arcgis/rest/services/ahri_2020_rgb_cache/MapServer/WMTS/tile/1.0.0/ahri_2020_rgb_cache/default/GoogleMapsCompatible/{TileMatrix}/{TileRow}/{TileCol}"
  }
}

Seems like adding a WMTS URI to the layer list would be a great addition for the portal editor, and a step towards fully editable layers in Cesium. Basically, we'd need a layer add button, a modal or other panel to collect the metadata above, and the ability to serialize it into the portal XML doc and save. Extending the editor to support a "➕ Add Layer" button (probably on a panel listing the layers), and a way to collect those metadata fields above would be the crux of the implementation (maybe a panel listing layers in the editor, with a pane for editing layer metadata?). Some of the key metadata could probably be extracted from the WMTS document as well, so providing it first could save the user some typing.

See https://github.com/PermafrostDiscoveryGateway/pdg-portal/issues/39 for an example of a layer that works.

Once we had this feature, then any raster layer that went through the viz pipeline and was exposed on our servers with a WMTS metadata document could easily be added to any portal.

Here's a screenshot of a WMTS layer in a portal corresponding to the JSON above (with a vector layer turned on as well):

image
robyngit commented 5 months ago

Blocked by https://github.com/NCEAS/metacatui/issues/1995 (first we need the ability to add/remove the cesium map tab, then we can use that tab in the editor to add the UI for editing WMTS layers)