XYZ Maps Documentation
    Preparing search index...

    Interface RemoteTileProviderOptions

    Configuration options of a RemoteTileProvider.

    interface RemoteTileProviderOptions {
        attribution?: string | DataSourceAttribution | DataSourceAttribution[];
        id?: string;
        ignoreTileQueryLimit?: boolean;
        level: number;
        margin?: number;
        name?: string;
        preProcessor?: PreProcessorOptions;
        postProcessor?(
            input: {
                data: {
                    put: GeoJSONFeature<string>[];
                    remove: GeoJSONFeature<string>[];
                };
                ready: (data: any) => void;
            },
        ): | { put: GeoJSONFeature<string>[]; remove: GeoJSONFeature<string>[] }
        | Promise<
            { put: GeoJSONFeature<string>[]; remove: GeoJSONFeature<string>[] },
        >;
    }

    Hierarchy (View Summary)

    Index
    attribution?: string | DataSourceAttribution | DataSourceAttribution[]

    Attribution information for data sources used by this provider.

    Attributions are automatically displayed or hidden depending on whether the corresponding data is currently active or visible on the map — e.g., based on zoom level, layer visibility, or usage. This ensures that only active data providers are credited, as required by licensing.

    Can be a simple string (displayed as static text), or an array of structured attribution entries that support clickable labels and optional tooltips.

    // Simple attribution string
    attribution: "© Data Provider"
    // Multiple detailed attributions
    attribution: [
    {
    label: "© Elevation Provider",
    url: "https://elevation.example.com",
    title: "Elevation data source"
    },
    {
    label: "Imagery © HERE Maps",
    url: "https://www.here.com",
    title: "Satellite imagery by HERE"
    }
    ]
    id?: string

    optional id to identify the provider.

    ignoreTileQueryLimit?: boolean

    To prevent an overwhelming volume of tile requests, any requests for zoom levels lower than the provider's setting are disregarded. Enabling "ignoreTileQueryLimit" will bypass the tile query limit but may risk browser crashes.

    false
    
    level: number

    The zoomlevel at which tiles should be loaded from remote and a local index gets created.

    margin?: number

    Tile margin of the provider.

    name?: string

    Name of the provider.

    preProcessor?: PreProcessorOptions

    Preprocessor for remote data sources. A function runs on the main thread and receives data, ready, and tile; it may return the processed features or a Promise, or use ready for legacy callback-style async work. Use the worker configuration on an HTTP/GeoJSON provider to automatically load and preprocess GeoJSON in one worker per provider using an automatically selected worker loader. Each LoaderManager limits concurrent tile tasks to 16, covering both download and preprocessing. Started preprocessing is not cancelled; late results of cancelled tile requests are ignored. Worker processors receive only data and tile, plus the context as a second argument, and must return the processed array or a Promise of that array. The context exposes options and utils for decoding base64, decompressing bytes, and preparing raw TGA model textures without main-thread decoding. They do not receive a provider reference or a ready callback. Worker mode is not supported by RemoteTileProvider with a custom loader. ArrayBuffers, typed-array buffers, and ImageBitmaps in the returned data are transferred to the main thread; the corresponding worker-side resources are detached. Blob assets are structured-cloned as Blobs, rather than returned as large text strings. Configure both phases with PreProcessorOptions: worker and main each accept one stage or an array. All worker stages execute sequentially after download/parse in the same worker, with one final transfer; main stages then execute sequentially before ingestion. No per-stage workers or transfers back to the worker are used. Both phases are optional, and {} or empty arrays are explicit identity. Main-only phases support custom loaders. Invalid or mixed legacy/phased configurations throw rather than skipping stages.

    See PreProcessorPipelineOptions for a worker preparation and main mapping example.

    • PostProcessor for remote data sources. The PostProcessor will be executed just before created/modified or removed Features will be sent to the remote backend. If the processor function is returning the processed data then its treated as a synchronous processor. If the processor function does not return any value (undefined) or a Promise then its treated as asynchronous processor. An asynchronous processor that's not using a Promise MUST call the input.ready(..) callback when data processing is finished.

      Due to the execution of the processor in a separate worker thread the processor function must be scope independent. The processor must be a "standalone function/class" that only depends on its own scope and only accesses its own local variables. No references to the outer scope of the processor function are allowed.

      Parameters

      • input: {
            data: {
                put: GeoJSONFeature<string>[];
                remove: GeoJSONFeature<string>[];
            };
            ready: (data: any) => void;
        }

      Returns
          | { put: GeoJSONFeature<string>[]; remove: GeoJSONFeature<string>[] }
          | Promise<
              { put: GeoJSONFeature<string>[]; remove: GeoJSONFeature<string>[] },
          >

      // PostProcessorData:
      {put: GeoJsonFeature[],remove: GeoJsonFeature[]}
      // PostProcessor:
      ({data: PostProcessorData, ready: (data) => void}) => PostProcessorData | Promise<GeoJsonFeature[]>