UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.15 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import e from"./Theme.js";function n(n){const t=n.themeDictionary,r=new Map;for(const s in t){const n=t[s];r.set(s,new e(n))}return r}function t(e,n){const t=[];return e.forEach((e=>{e.isBasemapSupported(n)&&t.push({name:e.name,label:e.label,description:e.description,basemaps:[...e.supportedBasemaps]})})),t}function r(e,n){if(!e)return;if(!n)return;let t=null;const r=[n.primaryScheme,...n.secondarySchemes];for(const s of r)if(s.name?.toLowerCase()===e.toLowerCase()){t=s;break}return t}function s(e,n,t){if(!e&&!n)return[];if(!t)return[];const r=!e?.length,s=!n?.length,o=[t.primaryScheme,...t.secondarySchemes],a=[];for(const c of o){const t=!!r||e.some((e=>c.tags.includes(e))),o=!s&&n.some((e=>c.tags.includes(e)));t&&!o&&a.push(c)}return a}function o(e){const n=e.theme;if(n)return n.getRawSchemes({basemap:e.basemap,geometryType:e.geometryType,basemapTheme:e.basemapTheme})}export{n as createThemes,r as filterSchemesByName,s as filterSchemesByTag,o as getRawSchemes,t as getThemesforBasemap};