Skip to content

Using MapTiler SDK instead of MapLibre #133

@loalf

Description

@loalf

Is it possible to use MapTiler's map instead of MapLibre. I have tried the following

<script lang="ts">
    import '@maptiler/sdk/dist/maptiler-sdk.css';
    import { Map } from '@maptiler/sdk';

    config.apiKey = "xxxx";

    /** @type {HTMLCanvasElement} */
    let mapContainer;
    let map = $state(new Map({
        container: mapContainer,
        center: [16.62662018, 49.2125578]
        zoom: 14
    }));

    import { MapLibre } from 'svelte-maplibre-gl';
</script>

<MapLibre inlineStyle="width: 100%; height: 100%;" map={map} bind:this={mapContainer}/>

but it complains about the container being null, which makes sense. Any idea how I could achieve that? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions