MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getLayerInfosFromCatalogs

Function getLayerInfosFromCatalogs

src/common/mapping/utils/util.js:151–166  ·  view source on GitHub ↗
(catalogs, catalogTypeField = 'type')

Source from the content-addressed store, hash-verified

149}
150
151export function getLayerInfosFromCatalogs(catalogs, catalogTypeField = 'type') {
152 const results = [];
153 for (let i = 0; i < catalogs.length; i++) {
154 const catalogType = catalogs[i][catalogTypeField];
155 if (catalogType !== 'group') {
156 results.push(catalogs[i]);
157 continue;
158 }
159 const { children } = catalogs[i];
160 if (children && children.length > 0) {
161 const result = getLayerInfosFromCatalogs(children, catalogTypeField);
162 results.push(...result);
163 }
164 }
165 return results;
166}
167
168function isSameRasterUrl(urlA, urlB) {
169 if (urlA === urlB) {

Callers 3

_createLegendInfoMethod · 0.90
toggleLayerVisibleMethod · 0.90
_generateLayersMethod · 0.90

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected