How to use the @here/harp-mapview.ThemeLoader.loadAsync function in @here/harp-mapview

To help you get started, we’ve selected a few @here/harp-mapview 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-examples / src / styling_textured-areas.ts View on Github external
function initializeMapView(id: string): MapView {
        const canvas = document.getElementById(id) as HTMLCanvasElement;
        const themePromise: Promise = ThemeLoader.loadAsync(
            "resources/berlin_tilezen_base.json"
        );
        const map = new MapView({
            canvas,
            theme: themePromise.then(modifyTheme)
        });
        const NY = new GeoCoordinates(40.705, -74.01);
        map.lookAt(NY, 3000, 30);

        CopyrightElementHandler.install("copyrightNotice", map);

        const mapControls = new MapControls(map);
        const ui = new MapControlsUI(mapControls);
        canvas.parentElement!.appendChild(ui.domElement);

        map.resize(window.innerWidth, window.innerHeight);
github heremaps / harp.gl / @here / harp-examples / src / performance_benchmark.ts View on Github external
.onChange((themeUrl: string) => {
                theme = themeUrl;
                ThemeLoader.loadAsync(themeUrl).then((newTheme: Theme) => {
                    mapViewApp.mapView.clearTileCache();
                    mapViewApp.mapView.theme = newTheme;
                });
            })
            .setValue("resources/berlin_tilezen_base.json");