code: function getQueryableLayersInfoFromThemes(
    themes, ogcServers
  ) {
    const queryableLayersInfo = [];
    let theme;
    let group;
    let nodes;
  
    for (let i = 0, ii = themes.length; i < ii; i++) {
      theme = /** @type {import('gmf/themes.js').GmfTheme} */ (themes[i]);
      for (let j = 0, jj = theme.children.length; j < jj; j++) {
        group = /** @type {import('gmf/themes.js').GmfGroup} */ (theme.children[j]);
  
        // Skip groups that don't have an ogcServer set
        if (!group.ogcServer) {
          continue;
        }
  
        nodes = [];
        getFlatNodes(group, nodes);
  
        for (let k = 0, kk = nodes.length; k < kk; k++) {
          const nodeGroup = /** @type {import('gmf/themes.js').GmfGroup} */ (nodes[k]);
          // Skip groups within groups
          if (nodeGroup.children && nodeGroup.children.length) {
            continue;
          }
  
          const nodeWMS = /** @type {import('gmf/themes.js').GmfLayerWMS} */ (nodes[k]);
  
          if (nodeWMS.childLayers &&
            nodeWMS.childLayers[0] &&
            nodeWMS.childLayers[0].queryable
          ) {
            queryableLayersInfo.push({
              layerNode: nodeWMS,
              ogcServer: ogcServers[group.ogcServer]
            });
          }
        }
      }
    }
  
    return queryableLayersInfo;
  }
docs: From a list of theme nodes, collect all WMS layer nodes that are queryable.
  A list of OGC servers is given in order to bind each queryable layer node
  to its associated server and be able to build requests.
  
  @param {Array.<import('gmf/themes.js').GmfTheme>} themes List of theme nodes.
  @param {import('gmf/themes.js').GmfOgcServers} ogcServers List of ogc servers
  @return {Array.<import('gmf/objectediting/toolsComponent.js').ObjectEditingQueryableLayerInfo>} List of
  queryable layers information.
  @private
  @hidden