Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NavlinkShape

The NavlinkShape represents a shape-point / coordinate of a Navlink feature. The NavlinkShape is only existing if the corresponding Navlink feature is "selected" and user based geometry editing with touch/mouse interaction is activated.

see

Navlink.select

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.

class

class: "NAVLINK_SHAPE"

The feature class of an NavlinkShape Feature is "NAVLINK_SHAPE".

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: {} | null

The properties associated with the feature.

type

type: "Feature" | string

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

Methods

behavior

  • behavior(options: { dragAxis?: "X" | "Y" | "Z" | [number, number, number]; dragPlane?: "XY" | "XZ" | "YZ" | [number, number, number] }): void
  • behavior(name: string, value: boolean | string | [number, number, number]): void
  • behavior(option: string): any
  • behavior(): { dragAxis?: [number, number, number] | "X" | "Y" | "Z" | null; dragPlane?: [number, number, number] | "XY" | "XZ" | "YZ" | null }
  • Set the behavior options.

    experimental

    Parameters

    • options: { dragAxis?: "X" | "Y" | "Z" | [number, number, number]; dragPlane?: "XY" | "XZ" | "YZ" | [number, number, number] }
      • Optional dragAxis?: "X" | "Y" | "Z" | [number, number, number]

        The drag axis across which the LineShape is dragged upon user interaction. Once "dragAxis" is set, "dragPlane" has no effect. In case "dragAxis" and "dragPlane" are set, "dragPlane" is preferred. In case "dragPlane" and "dragAxis" are both set, "dragPlane" is preferred.

      • Optional dragPlane?: "XY" | "XZ" | "YZ" | [number, number, number]

        The normal of the plane over which the LineShape is dragged upon user interaction. Once "dragPlane" is set, "dragAxis" has no effect.

    Returns void

  • Set the value of a specific behavior option.

    experimental

    Parameters

    • name: string
    • value: boolean | string | [number, number, number]

    Returns void

  • Get the value of a specific behavior option.

    experimental

    Parameters

    • option: string

    Returns any

  • Get the behavior options.

    experimental

    Returns { dragAxis?: [number, number, number] | "X" | "Y" | "Z" | null; dragPlane?: [number, number, number] | "XY" | "XZ" | "YZ" | null }

    • Optional dragAxis?: [number, number, number] | "X" | "Y" | "Z" | null

      The drag axis across which the marker is dragged upon user interaction.

    • Optional dragPlane?: [number, number, number] | "XY" | "XZ" | "YZ" | null

      The normal of the plane over which the marker is dragged upon user interaction.

disconnect

  • disconnect(): void
  • Disconnect the Navlink from other connected Navlink features at this shape point. The Intersection is resolved by moving the position of the shape(node).

    see

    EditorOptions.disconnectShapeDistance to configure the default offset used for offsetting the shape in meters.

    Returns void

editTurnRestrictions

  • Show the turn restrictions of the shape and enable editing of the turn-restrictions. Turn restrictions are only available if the shape is a node (start or end point) and part of an intersection with other Navlink features involved.

    Returns TurnRestrictionEditor

getConnectedLinks

  • Get an array of Navlink features that are connected to this shape point. Navlinks are "connected" with each other if they share the same coordinate location of start or end shape-point.

    Returns Navlink[]

    An array of Navlink Features with coordinates located at the same position as the shape.

getIndex

  • getIndex(): number
  • Get the index of the shape point in the coordinates array of the respective Navlink feature.

    Returns number

    The index of the shape point.

getLink

  • Get the Navlink feature to which the NavlinkShape belongs.

    Returns Navlink

    the Navlink

getProvider

isNode

  • isNode(): boolean
  • Checks if shape is start or end shape (Node) of the Navlink feature.

    Returns boolean

    true if its start or end shape (Node), otherwise false

isOverlapping

  • isOverlapping(): any
  • Checks if shape is overlapping with an existing shape/coordinate of another Navlink feature.

    Returns any

    true if it overlaps with another shape, false otherwise.

isSelected

  • isSelected(): boolean
  • Will return true or false whether the Shape is currently selected.

    Returns boolean

remove

  • remove(): void
  • Removes the shape point from the geometry of the Navlink feature.

    Returns void

select

  • select(): void
  • Select the NavlinkShape add it to the current selection. Multiple NavlinkShape can be selected at the same time. When a selected shape is dragged, all other shapes in the current selection are dragged as well.

    Returns void

splitLink

  • Splits the Navlink at the position of the NavlinkShape into two new "child" Navlinks. The coordinate of the NavlinkShape will be the start and end positions of the resulting Navlinks. The "parent" Navlink itself gets deleted after the split operation is done.

    @example
    let links = shapePoint.splitLink();
    

    Returns [Navlink, Navlink]

    An array containing the two newly created Navlink features.

toJSON

unselect

  • unselect(): void
  • Unselect the NavlinkShape and remove from current selection.

    Returns void

Generated using TypeDoc