Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Navlink

The Navlink Feature is a generic editable Feature with "LineString" geometry. In addition to the Line Feature, the Navlink feature can be linked/associated with other Navlink Features. A Navlink Feature also can be referenced by Addresses and Places. A Navlink is part of a "road nertwork".

The Feature can be edited with the Editor.

Hierarchy

Implements

Index

Properties

Optional bbox

bbox: [number, number, number, number]

Bounding box of the feature. The value of the bbox member is an array of length 4, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The "bbox" values define shapes with edges that follow lines of constant longitude and latitude.

Readonly class

class: "NAVLINK"

The feature class of an Navlink Feature is "NAVLINK".

geometry

geometry: { coordinates: string extends "Point" ? GeoJSONCoordinate : string extends "MultiPoint" ? GeoJSONCoordinate[] : string extends "LineString" ? GeoJSONCoordinate[] : string extends "MultiLineString" ? GeoJSONCoordinate[][] : string extends "Polygon" ? GeoJSONCoordinate[][] : string extends "MultiPolygon" ? GeoJSONCoordinate[][][] : GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][]; type: "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | string | string }

A geometry is a object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon" or "MultiPolygon". A geometry object must have a member with the name "coordinates". The value of the coordinates member is always an array (referred to as the coordinates array below). The structure for the elements in this array are determined by the type of geometry.

For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (or longitude, latitude, altitude for coordinates in a geographic coordinate reference system).

For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".

For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". The coordinates array for a LineString must have two or more elements. A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a geometry type, it is referred to in the Polygon geometry type definition.

For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".

For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". Furthermore, each LineString in the coordinates array must be a LinearRing. For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.

For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".

Point:
{
   "type": "Point",
   "coordinates": [100.0, 0.0]
}

Polygon:
{
   "type": "Polygon",
   "coordinates": [
       [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
   ]
}

Type declaration

  • coordinates: string extends "Point" ? GeoJSONCoordinate : string extends "MultiPoint" ? GeoJSONCoordinate[] : string extends "LineString" ? GeoJSONCoordinate[] : string extends "MultiLineString" ? GeoJSONCoordinate[][] : string extends "Polygon" ? GeoJSONCoordinate[][] : string extends "MultiPolygon" ? GeoJSONCoordinate[][][] : GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][]
  • type: "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | string | string

id

id: string | number

id of the feature.

properties

properties: FeatureProperties

The Properties of the feature

type

type: "Feature" | string

The type of the feature is a string with 'Feature' as its value.

Methods

addShape

  • Add a new shape-point / coordinate to the Navlink.

    Parameters

    • point: GeoPoint | PixelPoint

      the coordinate of the new shape to add.

    • Optional index: number

      the index position in the coordinate array of the LineString where the new shape point should be inserted.

    Returns number | false | true

    index of the shape or false if shape could not be added

behavior

  • behavior(options: { snapCoordinates?: boolean }): void
  • behavior(name: string, value: boolean): void
  • behavior(option: string): any
  • behavior(): { snapCoordinates: boolean }
  • Set the behavior options.

    experimental

    Parameters

    • options: { snapCoordinates?: boolean }
      • Optional snapCoordinates?: boolean

        Snap coordinates to Navlink geometry nearby.

    Returns void

  • Set the value of a specific behavior option.

    experimental

    Parameters

    • name: string
    • value: boolean

    Returns void

  • Get the value of a specific behavior option.

    experimental

    Parameters

    • option: string

    Returns any

  • Get the behavior options.

    experimental

    Returns { snapCoordinates: boolean }

    • snapCoordinates: boolean

      Snap coordinates to Navlink geometry nearby.

checkCrossings

  • checkCrossings(option?: { class?: "CROSSING" | "CROSSING_CANDIDATE"; styles?: { connector1?: Style; connector2?: Style; connector3?: Style; found?: Style; search1?: Style; search2?: Style } }): Crossing[]
  • Checks for possible crossing geometry with other Navlink features.

    example
    crossing.checkCrossings({
       type: "CROSSING",
           styles: {
               connector1: {fill: 'black'},
               connector2: {stroke: '#FBF'}
           }
    })
    

    Parameters

    • Optional option: { class?: "CROSSING" | "CROSSING_CANDIDATE"; styles?: { connector1?: Style; connector2?: Style; connector3?: Style; found?: Style; search1?: Style; search2?: Style } }

      options to configure the crossing check.

      • Optional class?: "CROSSING" | "CROSSING_CANDIDATE"

        Class of the crossing to check for. If no class is defined 'CROSSING' and 'CROSSING_CANDIDATE' is checked for.

      • Optional styles?: { connector1?: Style; connector2?: Style; connector3?: Style; found?: Style; search1?: Style; search2?: Style }

        Style of the crossings they should be displayed with. 6 configurable styling objects('connector1', 'connector2', 'connector3', 'search1', 'search2', 'found') comprise a crossing.

        • Optional connector1?: Style
        • Optional connector2?: Style
        • Optional connector3?: Style
        • Optional found?: Style
        • Optional search1?: Style
        • Optional search2?: Style

    Returns Crossing[]

    array of found crossings

coord

  • coord(): [number, number, number][]
  • coord(coordinates: [number, number, number][]): any
  • Get the geographical coordinate(s) of the Navlink feature.

    Returns [number, number, number][]

  • Set the geographical coordinate(s) of the Navlink feature.

    Parameters

    • coordinates: [number, number, number][]

      the geographical coordinates that should be set.

    Returns any

editState

  • editState(state: "created" | "modified" | "removed" | "split" | "hovered" | "selected", value?: number | boolean): number | boolean | undefined
  • Get a specific EditState of the feature.

    Parameters

    • state: "created" | "modified" | "removed" | "split" | "hovered" | "selected"

      the "EditState" to retrieve its value.

    • Optional value: number | boolean

    Returns number | boolean | undefined

    the value of the respective "EditState".

editTurnRestrictions

  • Displays and allows editing of the "turn restrictions" for the node/shape-point at the "index" of the Navlink feature. The index must be the respective index in the coordinates array of the first (0) or last coordinate of the Navlink.

    Parameters

    • index: number

      the index of the node to display the turn restrictions for.

    Returns TurnRestrictionEditor

    the TurnRestrictionEditor for the respective shape/node.

  • Displays and allows editing of all "turn restrictions" for the start and end node of the Navlink feature.

    Returns TurnRestrictionEditor[]

    Array containing the TurnRestrictionEditor for the start-node and end-node (shape-points).

editable

  • editable(editable: boolean): this
  • Define if the feature should be editable by the Editor module or not.

    deprecated
    example
    // prevent the feature from being modified by the editor module
    object.editable(false);
    

    Parameters

    • editable: boolean

      True, the feature can be edited, otherwise false.

    Returns this

getConnectedLinks

  • getConnectedLinks(index: number): Navlink[]
  • getConnectedLinks(index: number, details: true): { index: number; link: Navlink }[]
  • Get connected Navlink Features for the node. A node is either the Start or End coordinate of the Navlink (LineString) geometry.

    Parameters

    • index: number

      coordinate index for shape/node. 0 -> "start node", or index of last coordinate for the "end node".

    Returns Navlink[]

    Array that's containing the connected Navlink Features.

  • Get connected Navlink Features for the node. A node is either the Start or End coordinate of the Navlink (LineString) geometry.

    Parameters

    • index: number

      coordinate index for shape/node. 0 -> "start node", or index of last coordinate for the "end node".

    • details: true

      flag to enable detailed information of the connected Navlinks.

    Returns { index: number; link: Navlink }[]

    Array of detailed connected Navlink information including the shape/node index of connected link.

getProvider

getSelectedShapes

  • getSelectedShapes(): boolean[] | boolean[][]
  • Returns an array of Boolean values indicating whether the corresponding shape is selected at coordinate-index or not.

    Returns boolean[] | boolean[][]

getZLevels

  • getZLevels(): number[]
  • getZLevels(index: number): number
  • Get the z-levels for the coordinates of the Navlink feature.

    Returns number[]

    The Array of z-levels for the coordinates of the Navlink.

  • Get the z-level for a specific coordinate of the Navlink feature.

    The z-level of the coordinate at the index of the feature's coordinate array.

    Parameters

    • index: number

    Returns number

prop

  • prop(): {}
  • prop(property: string): any
  • prop(property: string, value: any): void
  • prop(properties: {}): void
  • Get a deep copy of the properties of the feature

    Returns {}

    • [name: string]: any
  • Get the value of a specific property

    Parameters

    • property: string

      name of the property

    Returns any

    the value of the specific property

  • Set the value for a specific property

    Parameters

    • property: string

      name of the property

    • value: any

      the value that should be set for the property

    Returns void

  • Set one or more properties of the object.

    Parameters

    • properties: {}

      the properties object literal that should be merged with the existing properties.

      • [name: string]: any

    Returns void

remove

  • remove(): void
  • Remove the feature.

    Returns void

select

  • select(): void
  • Select and highlight the feature. Selected features geometry is displayed and can easily be modified by mouse/touch interaction.

    Returns void

setGeoFence

  • setGeoFence(radius: number): void
  • Sets the radius of the geofence.

    deprecated
    • geofence not supported

    Parameters

    • radius: number

      The geofence radius in pixel.

    Returns void

setSelectedShapes

  • setSelectedShapes(selectedShapeIndicies: boolean[] | boolean[][]): void
  • Sets the selected state of the shapes at their respective coordinate-indices.

    Parameters

    • selectedShapeIndicies: boolean[] | boolean[][]

      Array of Boolean values indicating whether the corresponding shape is selected at index or not

    Returns void

setZLevels

  • setZLevels(zLevels: number[]): void
  • Set the z-levels for the coordinates of the Navlink Feature. For each coordinate of the Navlink, the respective z-level must be provided.

    example
    // modify the zLevel of the second coordinate.
    let zlevels = navlink.getZLevels();
    zlevels[1] = -4;
    navlink.setZLevels(zlevels);
    

    Parameters

    • zLevels: number[]

      The z-levels to be set for the coordinates of the Navlink.

    Returns void

showDirectionHint

  • showDirectionHint(dir?: "BOTH" | "START_TO_END" | "END_TO_START", hideShapes?: boolean): void
  • Show or hide the direction hint on the Navlink feature. If the function is called without arguments, the hint will be hidden.

    Parameters

    • Optional dir: "BOTH" | "START_TO_END" | "END_TO_START"

      direction of the Navlink, possible value: "BOTH"|"START_TO_END"|"END_TO_START"

    • Optional hideShapes: boolean

      indicates if the Start and End shapepoints of the Navlink should be displayed or not

    Returns void

style

  • style(type?: "default" | "current"): Style[]
  • style(style: Style[]): any
  • Get default or current style of the feature.

    deprecated
    • use layer.setStyleGroup instead
    defaultvalue

    "default"

    Parameters

    • Optional type: "default" | "current"

      indicates which style to return. "default" -> layer default style for the feature or the "current" applied style.

    Returns Style[]

    the style of the feature

  • Apply style to the feature.

    deprecated
    • use layer.setStyleGroup instead

    Parameters

    • style: Style[]

      the style to set for the feature

    Returns any

toJSON

transform

  • transform(): void
  • Enable Transform Utility to allow easy geometry transformation of the feature (move/scale/rotate) by mouse/touch interaction.

    Returns void

unselect

  • unselect(): void
  • Unselect the feature.

    Returns void

Generated using TypeDoc