s2maps-gpu - v0.18.0
    Preparing search index...

    Interface UrlMap

    URL Map

    A convenient way to define scheme/protocol of the URL and it's replacement. This can be defined by the user in the MapOptions urlMap property.

    The default replacement key-values are:

    Let's say I want to add a skybox to the scene:

    "skybox": {
    "path": "baseURL://backgrounds/milkyway",
    "loadingBackground": "rgb(9, 8, 17)",
    "size": 2048,
    "type": "webp",
    }

    Then we can modify the baseURL to point to the correct location:

    import { S2Map } from 's2maps-gpu';
    import type { MapOptions } from 's2maps-gpu';

    const urlMap: UrlMap = {
    baseURL: 'http://localhost:3000',
    };
    const map = new S2Map({ ..., urlMap });

    This is obviously more useful when working with environment variables to point to development and production servers without having to change the code.

    adjustURL for details on implementation

    Indexable

    • [schemeName: string]: string

      { schemeName: href }