TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.18k stars 362 forks source link

Items in init `workbench` should load parent groups #6868

Open nf-s opened 1 year ago

nf-s commented 1 year ago

Related to #6867

For example - here is a wms-group with a manually defined member - which will also be added to the workbench on map load.

Currently, the wms-group isn't loaded before it is added to the workbench

{
  "homeCamera": {
    "north": -8,
    "east": 158,
    "south": -45,
    "west": 109
  },
  "workbench": [
    "gsky-ows/chirps"
  ],
  "catalog": [
    {
      "id": "gsky-ows",
      "type": "wms-group",
      "name": "gsky ows geoglam",
      "url": "https://gsky.nci.org.au/ows/geoglam",
      "members": [
        {
          "type": "wms",
          "localId": "chirps",
          "name": "Monthly Precipitation CHIRPS v2.0 (overridden)"
        }
      ]
    }
  ],
  "viewerMode": "3dSmooth",
  "baseMaps": {
    "defaultBaseMapId": "basemap-positron",
    "previewBaseMapId": "basemap-positron"
  }
}
  1. Test link
  2. Item in workbench is broken
  3. Open Data Catalog
  4. Click on "gsky ows geoglam" group to trigger loadGroup
  5. Item in workbench is now working

This happens inside Terria.pushAndLoadMapItems().

Note, Terria.loadModelStratum does load parent groups

https://github.com/TerriaJS/terriajs/blob/b14835b75232eb8be722c6255f9c6e1789b1f5cb/lib/Models/Terria.ts#L1425-L1427

nf-s commented 1 year ago

Related