XYZ Maps Documentation
    Preparing search index...

    Interface HTTPProviderOptions

    Options to configuration of HTTPProvider.

    interface HTTPProviderOptions {
        attribution?: string | DataSourceAttribution | DataSourceAttribution[];
        editable?: boolean;
        enforceRandomFeatureId?: boolean;
        headers?: { [header: string]: string };
        hooks?: {
            "Coordinates.update"?: CoordinatesUpdateHook | CoordinatesUpdateHook[];
            "Feature.remove"?: FeatureRemoveHook | FeatureRemoveHook[];
            "Navlink.disconnect"?: NavlinkDisconnectHook | NavlinkDisconnectHook[];
            "Navlink.split"?: NavlinkSplitHook | NavlinkSplitHook[];
        };
        https?: boolean;
        id?: string;
        ignoreTileQueryLimit?: boolean;
        level: number;
        margin?: number;
        name?: string;
        params?: { [paramter: string]: string };
        preProcessor?: PreProcessorOptions;
        url?:
            | string
            | ((z: number, y: number, x: number, quadkey: string) => string);
        withCredentials?: boolean;
        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"
    }
    ]
    editable?: boolean

    Allow or prevent editing by the Editor module.

    false
    
    enforceRandomFeatureId?: boolean

    Enforce random ids for newly created features. If "enforceRandomFeatureId" is set to true, the ids of features created by editor.addFeature are ignored and randomly created. If "enforceRandomFeatureId" is set to false, ids of features created by editor.addFeature can be set. Random ids are only generated if none have been set.

    true
    
    headers?: { [header: string]: string }

    Set custom url service headers. Custom headers will be applied to all request done by provider.

    hooks?: {
        "Coordinates.update"?: CoordinatesUpdateHook | CoordinatesUpdateHook[];
        "Feature.remove"?: FeatureRemoveHook | FeatureRemoveHook[];
        "Navlink.disconnect"?: NavlinkDisconnectHook | NavlinkDisconnectHook[];
        "Navlink.split"?: NavlinkSplitHook | NavlinkSplitHook[];
    }

    Add hook functions that will be called during the execution of the corresponding "editing operation". The "hooks" option is a map with the "editing operation" as its key and the corresponding Hook or Array of Hook function(s) as its value.

    Available editing operations are 'Navlink.disconnect', 'Navlink.split', 'Feature.remove', 'Coordinates.remove'.

    Type Declaration

    • OptionalCoordinates.update?: CoordinatesUpdateHook | CoordinatesUpdateHook[]

      The CoordinatesUpdateHook(s) will be called whenever the coordinates of a feature are added, updated or removed ('Coordinates.update' operation).

    • OptionalFeature.remove?: FeatureRemoveHook | FeatureRemoveHook[]

      The FeatureRemoveHook(s) will be called when a feature is being removed ('Feature.remove' operation).

    • OptionalNavlink.disconnect?: NavlinkDisconnectHook | NavlinkDisconnectHook[]

      The NavlinkDisconnectHook(s) will be called whenever a Navlink is disconnected from an intersection ('Navlink.disconnect' operation).

    • OptionalNavlink.split?: NavlinkSplitHook | NavlinkSplitHook[]

      The NavlinkSplitHook(s) will be called whenever a Navlink is devided into two new Navlinks. ('Navlink.split' operation).

    https?: boolean

    Indicates if the requests should be made with https.

    true
    
    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.

    params?: { [paramter: string]: string }

    Set custom url parameters. Custom parameters will be applied to all request done by 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.

    url?: string | ((z: number, y: number, x: number, quadkey: string) => string)

    URL for requesting tiles.

    It is either a string which may contain following flags that will be replaced by provider:

    • {SUBDOMAIN_CHAR}: subdomain id(a, b, c and d) for balancing the load
    • {SUBDOMAIN_INT}: subdomain id(0,1,2 and 3) for balancing the load
    • {SUBDOMAIN_INT_1_4}: subdomain id(1,2,3 and 4) for balancing the load
    • {QUADKEY}: quadkey of the tile to be requested
    • {Z}: z of the tile to be requested
    • {X}: x of the tile to be requested
    • {Y}: y of the tile to be requested

    or a callback function that's called with the following parameters z,y,x,quadkey and needs to return the url for the respective tile. The callback function needs to handle custom parameters by its own.

    // string
    url: 'https://xyz.api.here.com/hub/spaces/mySpace/tile/quadkey/{QUADKEY}?access_token=myAccessToken'
    // callback function
    url: (z, y, x, quadkey) => {
    return 'https://xyz.api.here.com/hub/spaces/mySpace/tile/quadkey/' + quadkey + '?access_token=myAccessToken';
    }
    withCredentials?: boolean

    Indicates if requests are made with credentials.

    false
    
    • 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[]>