Closed laurenwalker closed 7 months ago
This feature was requested by Mike Brubaker and Mike Brook for the LEO Network layer. In particular, they would like to see sub-layers that categorize posts by topic.
Relevant parts of the original mockups for this feature:
The DRP portal has enough layers that this feature is really needed for usability. The PDG portal is getting close to that point as well.
A good place to start with this issue would be to decide how a portal can configure nested layers, and what sorts of options should be configurable (e.g. icon, label)
Here's a first shot at describing it based on how I imagine it in my head.
Config implementation:
{
"type": "group",
"label": "Weather",
"icon": "icon-location.svg",
"description": "Current weather conditions from NOAA nowCOAST",
"layers":
{
"type": "WebMapServiceImageryProvider",
"label": "Wind Speed",
"description": "This nowCOAST time-enabled map service provides...",
"visible": false,
"opacity": 0.7,
"cesiumOptions": {
"url": "https://nowcoast.noaa.gov/geoserver/forecasts/ndfd_wind/ows?SERVICE=WMS&",
"layers": "alaska_wind_speed",
"parameters": {
"transparent": "true",
"format": "image/png"
}
},
"attribution": "NWS National Digital Forecast Database (NDFD)",
"moreInfoLink": "https://nowcoast.noaa.gov/"
},
{
"type": "WebMapServiceImageryProvider",
"label": "Another layer",
...
}
},
{
"type": "group",
"label": "Another group",
...
},
{
"type": "GeoJSONDataLayer",
"label": "A third layer, this time outside any group",
...
}
Configurable:
UI functionality (in suggested order of importance):
This is excellent @iannesbitt thank you! An idea (maybe for a future enhancement): Could the nested layers inherit properties from their parent "group"? For example, if a group included a "citation", any child layer without a "citation" property would automatically use the citation text from the group its in. I imagine there might be a lot of duplicated properties within a layer group; this way the property only needs to be configured once. This could make things a lot more complicated though.
I was thinking about this yesterday too. It could be really useful to have the group settings apply to all child layers, and the child settings be able to override the group ones. That would also have the effect of cutting down on a little bit of config document length as well.
Because other portals (ex. DRP) also use layers, we probably need to make sure the solution is compatible with the current xml config structure. So the UI should be able to support both { layers: [...] } and { layerCategories: [ { ... layers: {} } ] }, but NOT both. Correct?
@yvonnesjy, yes, other portals use the Cesium map, and all Cesium maps in MetacatUI use the same configuration options to customize the map to suit the portal. So the solution needs to be flexible, such that each portal can choose their own categories to group layers by, or can even choose to not group layers at all.
We also don't want to make changes that aren't backwards compatible with the current map config options. In other words, existing portals that use Cesium (like the DRP) shouldn't break with the changes we make. If we were to rename am existing property, for example, that would cause all sorts of problems for other portals. So yes, if we were to add a new layerCategories
property, MetacatUI would need to also still support the layers
property.
The goal is to ADD the minimum required config options needed to inform MetacatUI how it should group layers together (and what that group should be called, and maybe what icon to use for it...)
In case you haven't seen the following yet, here are pointers to a few related resources:
<optionName>mapConfig</optionName>
), this XML also tells MetacatUI which pages belong in a portal, the title and which images to use, what colours to use, etc. ** It's not very typical to nest JSON (map config) within XML (portal config), and it's difficult to read that way, so for your reference, here is the JSON map config extracted from the PDG portal document:
e.g. the ice wedge polygon layer may want to have nested layers of high-center and low-center wedges. These might be different Cesium layers or just shortcuts for filtering the parent layer based on an attribute.