Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeoJSONProvider

GeoJSONProvider is a remote HTTPProvider designed to work with GeoJSON data.

Hierarchy

Index

Constructors

constructor

Properties

Optional hooks

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

Hook functions that will be called during the execution of the corresponding "editing operation". The "hooks" property 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'.

see

editor.addHook

Type declaration

Optional id

id: string

The id of the Provider

Optional margin

margin: number = 0

default tile margin.

Optional name

name: string

The name of the Provider.

Methods

addEventListener

  • addEventListener(type: string, listener: (e: CustomEvent) => void, _c?: any): boolean
  • Add an EventListener to the provider. Valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error"

    The detail property of the Event gives additional information about the event. detail.provider is a reference to the provider onto which the event was dispatched and is set for all events.

    Parameters

    • type: string

      A string representing the event type to listen for

    • listener: (e: CustomEvent) => void

      the listener function that will be called when an event of the specific type occurs

        • (e: CustomEvent): void
        • Parameters

          • e: CustomEvent

          Returns void

    • Optional _c: any

    Returns boolean

addFeature

  • Add a feature to the provider.

    example
    // add a feature to the provider.
    provider.addFeature({
       type: "Feature"
       geometry: {
           coordinates: [[-122.49373, 37.78202], [-122.49263, 37.78602]],
           type: "LineString"
       }
    });
    

    Parameters

    Returns Feature

  • Add multiple features to the provider.

    example
    // add multiple features to the provider.
    provider.addFeature([{
       type: "Feature"
       geometry: {
           coordinates: [[-122.49373, 37.78202], [-122.49263, 37.78602]],
           type: "LineString"
       }
    },{
       type: "Feature"
       geometry: {
           coordinates: [[-122.49375, 37.78203], [-122.49265, 37.78604]],
           type: "LineString"
       }
    }]);
    

    Parameters

    Returns Feature[]

all

cancel

  • cancel(quadkey: string): void
  • cancel(tile: Tile): void
  • Cancel ongoing request(s) of a tile. The tile will be dropped.

    Parameters

    • quadkey: string

      the quadkey of the tile that should be canceled and removed.

    Returns void

  • Cancel ongoing request(s) of a tile. The tile will be dropped.

    Parameters

    • tile: Tile

      the tile that should be canceled and removed.

    Returns void

clear

  • clear(bbox?: number[]): any
  • Clear all tiles and features of a given bounding box or do a full wipe if no parameter is given.

    Parameters

    • Optional bbox: number[]

      array of geographical coordinates [minLon, minLat, maxLon, maxLat] defining the area to clear.

    Returns any

Abstract commit

  • Commit modified/removed features to the remote backend.

    Parameters

    • data: { put?: GeoJSONFeature[]; remove?: GeoJSONFeature[] }

      the data that should be commit to the remote.

      • Optional put?: GeoJSONFeature[]

        features that should be created or updated

      • Optional remove?: GeoJSONFeature[]

        features that should be removed

    • Optional onSuccess: any

      callback function that will be called when data has been commit successfully

    • Optional onError: any

      callback function that will be called when an error occurs

    • Optional transactionId: string

    Returns any

config

createTile

  • createTile(quadkey: string): Tile
  • Create a new Tile.

    Parameters

    • quadkey: string

      the quadkey of the tile to create

    Returns Tile

detectFeatureClass

  • detectFeatureClass(feature: Feature): "LINE" | "NAVLINK" | "MARKER" | "PLACE" | "ADDRESS" | "AREA" | string | null
  • This method is used to determine the FeatureClass required to edit the feature. The FeatureClass defines how a certain feature behaves when its getting edited.

    By default, the Editor handles all features of geometry type 'LineString' as Line, 'Point' as Marker and '(Multi)Polygon' as Area.

    If you want to edit features with FeatureClass 'NAVLINK', 'PLACE' or 'ADDRESS' this method must be overridden to enable editing of Navlinks, Places or Addresses.

    Parameters

    Returns "LINE" | "NAVLINK" | "MARKER" | "PLACE" | "ADDRESS" | "AREA" | string | null

    the FeatureClass of the feature, or null if the feature should not be editable.

exists

  • exists(feature: { id: number | string }): { feature?: Feature }
  • Validate if a feature is stored in the local provider cache.

    Parameters

    • feature: { id: number | string }

      Object literal containing "id" property.

      • id: number | string

    Returns { feature?: Feature }

    the Feature if it is found, otherwise undefined

findPath

  • Finds the optimal path between two coordinates on a GeoJSON road network, considering various options. By default, the weight function returns the distance of the road segment, a lower distance implies a shorter route and is considered more favorable. If you have specific criteria such as road quality, traffic conditions, or other factors influencing the desirability of a road segment, you can customize the weight function accordingly. Pathfinding will consider only the locally cached data available on the client.

    experimental
    example
    const pathOptions = {
      from: [startLongitude, startLatitude],
      to: [endLongitude, endLatitude],
      // optional
      allowTurn: (turn) => {
         // Custom logic to determine whether a turn is allowed
        return true;
      },
      // optional
      weight: (data) => {
        // Custom weight function to determine the cost of traversing a road segment
        return data.distance; // Default implementation uses distance as the weight
      },
    };
    const result = await provider.findPath(pathOptions);
    console.log(result);
    

    Parameters

    • options: { allowTurn?: (turn: { from: { index: number; link: Feature<"LineString"> }; to: { index: number; link: Feature<"LineString"> } }) => boolean; from: GeoJSONCoordinate | GeoPoint; to: GeoJSONCoordinate | GeoPoint; weight?: (data: { direction: "START_TO_END" | "END_TO_START"; distance: number; feature: Feature<"LineString">; from: GeoJSONCoordinate; to: GeoJSONCoordinate }) => number }

      The options object containing parameters for finding the path.

      • Optional allowTurn?: (turn: { from: { index: number; link: Feature<"LineString"> }; to: { index: number; link: Feature<"LineString"> } }) => boolean

        Optional callback function to determine if a turn is allowed between road segments. If not provided, all turns are considered allowed.

        param

        Object containing information about the turn, including source and destination road segments.

        returns

        true if the turn is allowed, false otherwise.

          • (turn: { from: { index: number; link: Feature<"LineString"> }; to: { index: number; link: Feature<"LineString"> } }): boolean
          • Parameters

            • turn: { from: { index: number; link: Feature<"LineString"> }; to: { index: number; link: Feature<"LineString"> } }
              • Readonly from: { index: number; link: Feature<"LineString"> }

                Object representing the source road segment of the turn.

                • Readonly index: number

                  Index of the Coordinates array of the source road segment.

                • Readonly link: Feature<"LineString">

                  GeoJSON Feature representing the source road segment.

              • Readonly to: { index: number; link: Feature<"LineString"> }

                Object representing the destination road segment of the turn.

                • Readonly index: number

                  Index of the Coordinates array of the destination road segment.

                • Readonly link: Feature<"LineString">

                  GeoJSON Feature representing the destination road segment.

            Returns boolean

      • from: GeoJSONCoordinate | GeoPoint

        The starting coordinates defining the path.

      • to: GeoJSONCoordinate | GeoPoint

        The ending coordinates of the path.

      • Optional weight?: (data: { direction: "START_TO_END" | "END_TO_START"; distance: number; feature: Feature<"LineString">; from: GeoJSONCoordinate; to: GeoJSONCoordinate }) => number

        Optional callback function to determine the weight (cost) of traversing a road segment.

        param

        Object containing information about the road segment.

        returns

        A numerical value representing the weight or cost of traversing the road segment. Default is the distance in meter.

          • Parameters

            • data: { direction: "START_TO_END" | "END_TO_START"; distance: number; feature: Feature<"LineString">; from: GeoJSONCoordinate; to: GeoJSONCoordinate }
              • direction: "START_TO_END" | "END_TO_START"

                Direction of traversal on the road segment.

              • distance: number

                The Distance of the road in meters.

              • feature: Feature<"LineString">

                Feature representing the road segment.

              • from: GeoJSONCoordinate

                Starting coordinates of the road segment.

              • to: GeoJSONCoordinate

                Ending coordinates of the road segment.

            Returns number

    Returns Promise<{ distance: number; features: Feature<"LineString">[]; from: GeoJSONCoordinate; path: GeoJSONFeature<"MultiLineString">; to: GeoJSONCoordinate }>

    {Promise<{ features: Feature[]; readonly path: GeoJSONFeature; readonly distance: number; from: GeoJSONCoordinate; to: GeoJSONCoordinate; }>} A Promise that resolves to an object containing the path, additional information, and the distance of the path.

getCachedTile

  • getCachedTile(quadkey: string): Tile
  • Get a locally cached tile by quadkey.

    Parameters

    • quadkey: string

      the quadkey of the tile

    Returns Tile

getCachedTilesOfBBox

  • getCachedTilesOfBBox(bbox: number[], zoomlevel?: number): Tile[]
  • get cached tile by bounding box.

    Parameters

    • bbox: number[]

      array of coordinates in order: [minLon, minLat, maxLon, maxLat]

    • Optional zoomlevel: number

      get tiles at specified tileMargin

    Returns Tile[]

    array of {@link Tiles}

getFeature

  • getFeature(id: string | number): Feature | undefined
  • Gets a feature from the provider by id.

    Parameters

    • id: string | number

      the id of the feature

    Returns Feature | undefined

    the found feature or undefined if feature is not present.

Abstract getFeatureUrl

  • getFeatureUrl(layer: string, featureId: string | number): string
  • Get URL feature specific requests.

    Parameters

    • layer: string

      the id of the layer

    • featureId: string | number

      id of the feature the provider want's to request

    Returns string

    url string to receive the feature resource of the remote http backend

getFeatures

  • getFeatures(ids: number[] | string[], options?: { onload?: (result: Feature[] | null) => void; remote?: boolean }): any
  • getFeatures(options: { id?: number | string; ids?: number[] | string[]; onload?: (result: Feature[] | null) => void; remote?: boolean }): any
  • Gets features from provider by id.

    Parameters

    • ids: number[] | string[]

      array of feature ids to search for.

    • Optional options: { onload?: (result: Feature[] | null) => void; remote?: boolean }

      search options

      • Optional onload?: (result: Feature[] | null) => void

        Callback function for "remote" search.

        param

        array of Features containing the search result.

          • Parameters

            Returns void

      • Optional remote?: boolean

        Force the provider to do remote search if no result is found in local cache.

    Returns any

    if just a single feature is found its getting returned otherwise an array of features or undefined if none is found.

  • Gets features from provider by id.

    Parameters

    • options: { id?: number | string; ids?: number[] | string[]; onload?: (result: Feature[] | null) => void; remote?: boolean }

      search options

      • Optional id?: number | string

        search for a single feature by id

      • Optional ids?: number[] | string[]

        array of ids to search for multiple features

      • Optional onload?: (result: Feature[] | null) => void

        Callback function for "remote" search

        param

        Result array of features

          • Parameters

            Returns void

      • Optional remote?: boolean

        Force the provider to do remote search if no result is found in local cache

    Returns any

    if just a single feature is found its getting returned otherwise an array of features or undefined if none is found.

getHeader

  • getHeader(name: string): string | null
  • Get a specific request-header being added to all requests handled by the provider.

    Parameters

    • name: string

      The name of header to retrieve

    Returns string | null

    value of the request header or null if the header does not exist

getHeaders

  • getHeaders(): {}
  • Get the request-headers being added to all requests handled by the provider.

    Returns {}

    Map of key value pairs. the key represents the header name

    • [name: string]: string

Abstract getLayerUrl

  • getLayerUrl(layer: string): string
  • Get URL for layer specific requests.

    Parameters

    • layer: string

      the id of the layer

    Returns string

    url string to receive a layer resource of the remote http backend

getParam

  • getParam(name: string): string | null
  • Get a specific request-parameter that's being added by the provider to all requests.

    Parameters

    • name: string

      The name of parameter to retrieve

    Returns string | null

    value of the request parameter or null if the parameter does not exist

getParams

  • getParams(): {}
  • Get the request-parameters that are being added by the provider to all requests.

    Returns {}

    Map of key value pairs. the key represents the parameter name.

    • [name: string]: string

getTile

  • getTile(quadkey: string, cb: (tile: Tile) => void): any
  • Get a tile by quadkey. If the tile is not cached already, it will be created and stored automatically. Data will be fetched from remote data-sources and attached to tile automatically

    Parameters

    • quadkey: string

      quadkey of the tile

    • cb: (tile: Tile) => void
        • (tile: Tile): void
        • Parameters

          Returns void

    Returns any

    the Tile

Abstract getTileUrl

  • getTileUrl(layer: string): string
  • Get URL for tile specific requests.

    Parameters

    • layer: string

      the id of the layer

    Returns string

    url string to receive a tile resource of the remote http backend

Abstract readDirection

  • readDirection(navlink: Navlink): "BOTH" | "START_TO_END" | "END_TO_START"
  • Attribute reader for obtaining the direction of travel of a Navlink feature.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    • navlink: Navlink

      the Navlink whose direction is requested

    Returns "BOTH" | "START_TO_END" | "END_TO_START"

Abstract readFeatureHeight

  • readFeatureHeight(feature: Feature): number | null
  • Attribute reader for obtaining the Height of a Building (extruded Area). The height must be specified in meters.

    This method must be implemented to enable editing of the height of an extruded Area.

    Parameters

    • feature: Feature

      The Area feature whose height is requested.

    Returns number | null

    The height in meters of the Building/Area or null if the Area is considered flat.

Abstract readPedestrianOnly

  • readPedestrianOnly(navlink: Navlink): boolean
  • Attribute reader for obtaining if a Navlink feature can be accessed by pedestrians only.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    Returns boolean

    true, if the Navlink can be accessed by pedestrians only, otherwise false.

Abstract readRoutingLink

  • readRoutingLink(feature: Feature): NavlinkId | null
  • Attribute reader for obtaining the id of the Navlink Feature on which the RoutingPoint of an Address or Place feature is located. For Addresses an Id must be returned. If null is returned for a Place, the Place is treated as "floating" without a RoutingPoint.

    This method must be implemented to enable editing of Places or Addresses.

    Parameters

    • feature: Feature

      The Address or Place of which the Navlink of the RoutingPoint is requested.

    Returns NavlinkId | null

    the Id of the Navlink on which the RoutingPoint is located.

Abstract readRoutingPosition

  • Attribute reader for obtaining the RoutingPoint's geographical position of an Address or Place. The geographical position must be located on the geometry of the related Navlink feature.

    This method must be implemented to enable editing of Places or Addresses.

    Parameters

    • feature: Feature

      The Address or Place feature whose RoutingProvider is requested.

    Returns GeoJSONCoordinate | null

    GeoJSON Coordinate representing the geographical position of the RoutingPoint or null if a Place does not have a RoutingPoint.

Abstract readRoutingProvider

  • readRoutingProvider(feature: Feature): string | undefined
  • Attribute reader for obtaining the id of the TileProvider containing the corresponding Navlink, of an Address or Place feature, on which the RoutingPoint is located.

    This method must be implemented to enable editing of Places or Addresses.

    Parameters

    • feature: Feature

      The Address or Place feature whose RoutingProvider is requested.

    Returns string | undefined

    the Id of the TileProvider in which the object is stored. If undefined is returned, the RoutingPoint's Navlink is assumed to be in the same TileProvider as the Address/Place.

Abstract readTurnRestriction

  • readTurnRestriction(turnFrom: { index: number; link: Navlink }, turnTo: { index: number; link: Navlink }): boolean
  • Attribute reader for obtaining the turn-restrictions of two Navlink Features.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    • turnFrom: { index: number; link: Navlink }

      The Navlink and it's coordinate index from which to turn from

    • turnTo: { index: number; link: Navlink }

      The Navlink and it's coordinate index to which you want to turn

    Returns boolean

    true if turn is allowed, otherwise false.

Abstract readZLevels

  • readZLevels(navlink: Navlink): number[]
  • Attribute reader for obtaining the zLevels of a Navlink feature.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    • navlink: Navlink

      the Navlink whose zLevels are requested

    Returns number[]

    An array containing the zLevel for each coordinate of the Navlink.

removeEventListener

  • removeEventListener(type: string, listener: (event: CustomEvent) => void, _c?: any): boolean
  • Remove an EventListener from the provider. Valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error"

    Parameters

    • type: string

      A string which specifies the type of event for which to remove an event listener.

    • listener: (event: CustomEvent) => void

      The listener function of the event handler to remove from the provider.

        • (event: CustomEvent): void
        • Parameters

          • event: CustomEvent

          Returns void

    • Optional _c: any

    Returns boolean

removeFeature

search

  • search(options: { ids?: number[] | string[]; onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; point?: GeoPoint | GeoJSONCoordinate; radius?: number; rect?: GeoRect | GeoJSONBBox; remote?: boolean }): Feature[]
  • search(options: { id: number | string; onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature | null) => void; remote?: boolean }): Feature
  • search(point: GeoPoint | GeoJSONCoordinate, options?: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; radius: number; remote?: boolean }): Feature[]
  • search(rect: GeoRect | GeoJSONBBox, options?: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; remote?: boolean }): Feature[]
  • search(id: string | number, options?: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature) => void; remote?: boolean }): Feature
  • Search for feature(s) in the provider.

    example
    // searching by ids:
    provider.search({ids: [1058507462, 1058507464]})
    
    // searching by point and radius:
    provider.search({
    point: {longitude: 72.84205, latitude: 18.97172},
    radius: 100
    })
    
    // searching by Rect:
    provider.search({
     rect:  {minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}
    })
    
    // remote search:
    provider.search({
        rect:  {minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876},
        remote: true, // force provider to do remote search if feature/search area is not cached locally
        onload: (result) => {...}
    })
    

    Parameters

    • options: { ids?: number[] | string[]; onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; point?: GeoPoint | GeoJSONCoordinate; radius?: number; rect?: GeoRect | GeoJSONBBox; remote?: boolean }

      configure the search

      • Optional ids?: number[] | string[]

        Search features by Ids.

      • Optional onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void

        Function to be called when a request of a "remote search" fails.

          • (error: { message: string; name: "NetworkError"; responseText: string; status: number }): void
          • Parameters

            • error: { message: string; name: "NetworkError"; responseText: string; status: number }
              • message: string

                The error message of the failing request.

              • name: "NetworkError"

                The name property represents a name for the type of error. The value is "NetworkError".

              • responseText: string

                The responseText which contains the textual data received of the failing request.

              • status: number

                The numerical HTTP status code of the failing request.

            Returns void

      • Optional onload?: (result: Feature[] | null) => void

        Callback function for "remote" search.

        param

        Array of Features containing the search results.

          • Parameters

            Returns void

      • Optional point?: GeoPoint | GeoJSONCoordinate

        Geographical center point of the circle to search in. options.radius must be defined.

      • Optional radius?: number

        Radius of the circle in meters, it is used in "point" search.

      • Optional rect?: GeoRect | GeoJSONBBox

        Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect.

      • Optional remote?: boolean

        Force the data provider(s) to do remote search if no result is found in local cache.

    Returns Feature[]

    array containing the searched features

  • Search for feature(s) in the provider.

    example
    // searching by id:
    provider.search({id: 1058507462})
    
    // remote search:
    provider.search({
        id: 1058507462,
        remote: true, // force provider to do remote search if feature/search area is not cached locally
        onload: (result) => {...}
    })
    

    Parameters

    • options: { id: number | string; onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature | null) => void; remote?: boolean }

      configure the search

      • id: number | string

        search feature by id.

      • Optional onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void

        Function to be called when a request of a "remote search" fails.

          • (error: { message: string; name: "NetworkError"; responseText: string; status: number }): void
          • Parameters

            • error: { message: string; name: "NetworkError"; responseText: string; status: number }
              • message: string

                The error message of the failing request.

              • name: "NetworkError"

                The name property represents a name for the type of error. The value is "NetworkError".

              • responseText: string

                The responseText which contains the textual data received of the failing request.

              • status: number

                The numerical HTTP status code of the failing request.

            Returns void

      • Optional onload?: (result: Feature | null) => void

        Callback function for "remote" search.

        param

        Array of Features containing the search results.

          • Parameters

            Returns void

      • Optional remote?: boolean

        Force the data provider(s) to do remote search if no result is found in local cache.

    Returns Feature

    array containing the searched features

  • Point Search for feature(s) in provider.

    example
    layer.search({longitude: 72.84205, latitude: 18.97172},{
     radius: 100
    })
    // or:
    layer.search([72.84205, 18.97172], {
     radius: 100
    })
    

    Parameters

    • point: GeoPoint | GeoJSONCoordinate

      Geographical center point of the point to search in. options.radius must be defined.

    • Optional options: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; radius: number; remote?: boolean }

      configure the search

      • Optional onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void

        Function to be called when a request of a "remote search" fails.

          • (error: { message: string; name: "NetworkError"; responseText: string; status: number }): void
          • Parameters

            • error: { message: string; name: "NetworkError"; responseText: string; status: number }
              • message: string

                The error message of the failing request.

              • name: "NetworkError"

                The name property represents a name for the type of error. The value is "NetworkError".

              • responseText: string

                The responseText which contains the textual data received of the failing request.

              • status: number

                The numerical HTTP status code of the failing request.

            Returns void

      • Optional onload?: (result: Feature[] | null) => void

        Callback function for "remote" search.

        param

        Array of Features containing the search results.

          • Parameters

            Returns void

      • radius: number

        the radius of the circular area in meters to search in

      • Optional remote?: boolean

        Force the data provider(s) to do remote search if no result is found in local cache.

    Returns Feature[]

  • Rectangle Search for feature(s) in the provider.

    example
    provider.search({minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876})
    // or:
    provider.search([72.83584, 18.96876, 72.84443,18.97299])
    
    // remote search:
    provider.search({minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}, {
        remote: true, // force provider to do remote search if search area is not cached locally
        onload: (result) => {...}
    })
    

    Parameters

    • rect: GeoRect | GeoJSONBBox

      Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect.

    • Optional options: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature[] | null) => void; remote?: boolean }

      configure the search

      • Optional onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void

        Function to be called when a request of a "remote search" fails.

          • (error: { message: string; name: "NetworkError"; responseText: string; status: number }): void
          • Parameters

            • error: { message: string; name: "NetworkError"; responseText: string; status: number }
              • message: string

                The error message of the failing request.

              • name: "NetworkError"

                The name property represents a name for the type of error. The value is "NetworkError".

              • responseText: string

                The responseText which contains the textual data received of the failing request.

              • status: number

                The numerical HTTP status code of the failing request.

            Returns void

      • Optional onload?: (result: Feature[] | null) => void

        Callback function for "remote" search.

        param

        Array of Features containing the search results.

          • Parameters

            Returns void

      • Optional remote?: boolean

        Force the data provider(s) to do remote search if no result is found in local cache.

    Returns Feature[]

  • Search for feature by id in the provider.

    example
    provider.search(1058507462)
    
    // remote search:
    provider.search(1058507462,{
        remote: true, // force provider to do remote search if search area is not cached locally
        onload: (result) => {...}
    })
    

    Parameters

    • id: string | number

      id of the feature to search for

    • Optional options: { onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void; onload?: (result: Feature) => void; remote?: boolean }

      configure the search

      • Optional onerror?: (error: { message: string; name: "NetworkError"; responseText: string; status: number }) => void

        Function to be called when a request of a "remote search" fails.

          • (error: { message: string; name: "NetworkError"; responseText: string; status: number }): void
          • Parameters

            • error: { message: string; name: "NetworkError"; responseText: string; status: number }
              • message: string

                The error message of the failing request.

              • name: "NetworkError"

                The name property represents a name for the type of error. The value is "NetworkError".

              • responseText: string

                The responseText which contains the textual data received of the failing request.

              • status: number

                The numerical HTTP status code of the failing request.

            Returns void

      • Optional onload?: (result: Feature) => void

        Callback function for "remote" search.

        param

        Array of Features containing the search results.

      • Optional remote?: boolean

        Force the data provider(s) to do remote search if no result is found in local cache.

    Returns Feature

setFeatureCoordinates

setHeader

  • setHeader(name: string, value: string): void
  • Set request-header that should be added to all request handled by the provider.

    Parameters

    • name: string

      The name of the header whose value is to be set.

    • value: string

      The value to set as the body of the header.

    Returns void

setHeaders

  • setHeaders(headers: {}): void
  • Set request-headers that should be added to all request handled by the provider.

    Parameters

    • headers: {}
      • [name: string]: string

    Returns void

setMargin

  • setMargin(tileMargin?: number): void
  • Set the tile margin in pixel.

    Parameters

    • Default value tileMargin: number = 0

      the tileMargin

    Returns void

setParam

  • setParam(name: string, value: string | string[] | undefined): void
  • Set a specific request-parameter that should be added to all request handled by provider. If undefined is set the parameter get's cleared/removed.

    Parameters

    • name: string

      The name of the parameter whose value is to be set.

    • value: string | string[] | undefined

      The value(s) of the parameter.

    Returns void

setParams

  • setParams(parameters: {}): void
  • Set request-parameters that should be added to all request handled by provider.

    Parameters

    • parameters: {}
      • [name: string]: string | string[] | undefined

    Returns void

writeEditState

  • writeEditState(feature: any, editState: "created" | "modified" | "removed" | "split"): void
  • Attribute writer for storing the EditStates of a Feature. The EditStates provide information about whether a feature has been created, modified, removed or split.

    By default EditStates aren't tracked/stored.

    Parameters

    • feature: any

      The Feature whose EditState should be written.

    • editState: "created" | "modified" | "removed" | "split"

      the EditState to store

    Returns void

Abstract writeFeatureHeight

  • writeFeatureHeight(feature: Feature, height: number | null): any
  • Attribute writer for storing the Height of a Building (extruded Area). The height must be specified in meters.

    This method must be implemented to enable editing of the height of an extruded Area.

    Parameters

    • feature: Feature

      The Area feature whose height should be updated/written.

    • height: number | null

      The height specified in meters

    Returns any

Abstract writeRoutingLink

  • writeRoutingLink(feature: Feature, position: any, navlink: Navlink | null): any
  • Attribute writer for storing the Navlink reference on which the RoutingPoint of an Address or Place feature is located.

    This method must be implemented to enable editing of Places or Addresses.

    Parameters

    • feature: Feature

      The Address or Place of which the Navlink reference of the RoutingPoint to store.

    • position: any
    • navlink: Navlink | null

      The navlink whose reference is to be written, or null in case of a Place becomes "floating" and has no RoutingPoint.

    Returns any

Abstract writeRoutingPosition

  • Attribute writer to store the RoutingPoint's geographical position of an Address or Place. The geographical position must be located on the geometry of the related Navlink feature.

    This method must be implemented to enable editing of Places or Addresses.

    Parameters

    • feature: Feature

      The Address or Place feature whose RoutingPoint position to write.

    • position: GeoJSONCoordinate | null

      the geographical position of the RoutingPoint.

    Returns any

Abstract writeTurnRestriction

  • writeTurnRestriction(restricted: boolean, turnFrom: { index: number; link: Navlink }, turnTo: { index: number; link: Navlink }): any
  • Attribute writer to store turn-restrictions of two Navlink Features.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    • restricted: boolean

      Indicates if the turn is allowed (true) or forbidden (false)

    • turnFrom: { index: number; link: Navlink }

      The Navlink and it's coordinate index from which to turn from

    • turnTo: { index: number; link: Navlink }

      The Navlink and it's coordinate index to which you want to turn

    Returns any

Abstract writeZLevels

  • writeZLevels(navlink: Navlink, zLevels: number[]): any
  • Attribute writer for writing the zLevels of a Navlink feature.

    This method must be implemented to enable editing of Navlinks.

    Parameters

    • navlink: Navlink

      the Navlink whose zLevels should be set

    • zLevels: number[]

      An array containing the zLevel for each coordinate of the Navlink

    Returns any

    An array containing the zLevel for each coordinate of the Navlink.

Generated using TypeDoc