PermafrostDiscoveryGateway / pdg-portal

Design and mockup documents for the PDG portal
Apache License 2.0
0 stars 0 forks source link

Config changes following "R1.5" release #91

Closed robyngit closed 2 months ago

robyngit commented 2 months ago

@hngrtr has a couple of new/different base layers that we'd like to use on the next version of the PDG portal

robyngit commented 2 months ago

From https://github.com/NCEAS/metacatui/issues/2360 (duplicate):

Having more base layer options is (almost) always preferable. Sometimes a feature is easier to visualize on a topo map versus the flat OSM.

OSM image

OTM image

hngrtr commented 2 months ago

These are the changes I made locally:

  1. models/maps/assets/CesiumImagery.js: Added a getter for saturation in the initialAppearance object
  2. models/maps/assets/MapAsset.js: Added a saturation value of 1 to the defaults config
  3. models/maps/Map.js: Updated the base layers to add a desaturated OpenTopoMaps and desaturate OpenStreetMaps
{
              label: "OpenTopoMap",
              icon: "urn:uuid:ff153eab-490b-46a4-b11e-47e0592735f6",
              type: "OpenStreetMapImageryProvider",
              visible: false,
              description: "OpenTopoMap is a free topographic map generated from OpenStreetMap and SRTM elevation data. The map style is based on the official maps and relies on good readability through high contrast and balanced signatures.",
              attribution: "Stefan Erhardt",
              moreInfoLink: "https://opentopomap.org/credits",
              cesiumOptions: {
                url: "https://a.tile.opentopomap.org/"
              },
              opacity: 0.4,
              // Make the base map grayscale
              saturation: 0.1
            },
            {
              label: "OpenStreetMaps",
              icon: "urn:uuid:ff153eab-490b-46a4-b11e-47e0592735f6",
              type: "OpenStreetMapImageryProvider",
              description: "OpenStreetMap is built by a community of mappers that contribute and maintain data about roads, trails, cafés, railway stations, and much more, all over the world.",
              attribution: "OpenStreetMap's community is diverse, passionate, and growing every day. Our contributors include enthusiast mappers, GIS professionals, engineers running the OSM servers, humanitarians mapping disaster-affected areas, and many more.",
              moreInfoLink: "https://www.openstreetmap.org/about",
              // No need to set cesiumOptions since the OSM URL is the default
              opacity: 0.6,
              // Make the base map grayscale
              saturation: 0.1,
              visible: true
            }

I think Yvonne is working on the saturation piece already.

yvonnesjy commented 2 months ago

Repurposing this ticket to track all config changes instead of just the base maps

Items from Doug and I:

@ianguerin to add items from his side

ianguerin commented 2 months ago

This feature requires that all of the layers have a unique ID field (layerId). The layer IDs above are a bit arbitrarily created. otm="OpenTopoMap" ls="Local Stories" (what Local News Stories layer is to be renamed as) dlbns1419="Drained Lake Basins, North Slope, 2014-2019" osm="OpenStreetMaps" bsi="Bing Satellite Imagery" pe="Permafrost Extent" iwplmir="Ice Wedge Polygons (low & medium ice regions)" iwphir="Ice-Wedge Polygons (high ice regions)" isv1="Infrastructure (SACHI version 1)"

These are arbitrary, but must match with the layers specified in layers or layerCategories config field layerId

ianguerin commented 2 months ago

And then to enable the feature in viewfinder UI:

robyngit commented 2 months ago

✅ Done!

⚠️ ...But note: The viewfinder presets were built with the layers in demo, not the layers in production, I had to make the following changes:

^ @ianguerin @yvonnesjy

ianguerin commented 2 months ago

Thank you Robyn for making those alterations to the configuration!