How to use the @here/harp-utils.composeUrlResolvers function in @here/harp-utils

To help you get started, we’ve selected a few @here/harp-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-mapview / lib / ThemeLoader.ts View on Github external
static resolveUrls(theme: Theme): Theme {
        // Ensure that all resources referenced in theme by relative URLs are in fact relative to
        // theme.
        if (theme.url === undefined) {
            return theme;
        }

        const childUrlResolver = composeUrlResolvers(
            (childUrl: string) => resolveReferenceUrl(theme.url, childUrl),
            defaultUrlResolver
        );

        if (theme.extends) {
            if (typeof theme.extends === "string") {
                theme.extends = childUrlResolver(theme.extends);
            } else {
                if (theme.extends.url === undefined) {
                    theme.extends.url = theme.url;
                    theme.extends = this.resolveUrls(theme.extends);
                }
            }
        }

        if (theme.sky && theme.sky.type === "cubemap") {