XYZ Maps Documentation
    Preparing search index...

    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.

    Instances are created with Editor.addFeature, the constructor is not part of the public API.

    const navlink = editor.addFeature({
    type: 'Feature',
    properties: {featureClass: 'NAVLINK'},
    geometry: {type: 'LineString', coordinates: [[78.3546, 17.3137], [78.3550, 17.3150]]}
    }, layer);

    Hierarchy (View Summary)

    Index
    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: "NAVLINK"

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

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

    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] ]
    ]
    }
    id: string | number

    id of the feature.

    properties: FeatureProperties

    The Properties of the feature

    type: string

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

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

      Parameters

      • point: GeoPoint | PixelPoint

        the coordinate of the new shape to add.

      • Optionalindex: number

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

      Returns number | false

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

    • Experimental

      Set the behavior options.

      Parameters

      • options: { autoConnect?: boolean; snapCoordinates?: boolean }
        • OptionalautoConnect?: boolean

          Automatically connect to the nearest Navlink when a shape is dragged and dropped within snap tolerance. If set to false, the shape will remain unconnected after the drop and the connection can be established manually by using NavlinkShape.getConnectionCandidates and Crossing.connect.

          true
          
        • OptionalsnapCoordinates?: boolean

          Snap coordinates to Navlink geometry nearby.

      Returns void

    • Experimental

      Set the value of a specific behavior option.

      Parameters

      • name: string
      • value: boolean

      Returns void

    • Experimental

      Get the value of a specific behavior option.

      Parameters

      • option: string

      Returns any

    • Experimental

      Get the behavior options.

      Returns { autoConnect: boolean; snapCoordinates: boolean }

      • autoConnect: boolean

        Automatically connect to the nearest Navlink when a shape is dragged and dropped within snap tolerance.

        true
        
      • snapCoordinates: boolean

        Snap coordinates to Navlink geometry nearby.

    • Checks for possible crossing geometry with other Navlink features.

      Parameters

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

        options to configure the crossing check.

        • Optionalclass?: "CROSSING" | "CROSSING_CANDIDATE"

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

        • Optionalstyles?: {
              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.

      Returns Crossing[]

      array of found crossings

      crossing.checkCrossings({
      type: "CROSSING",
      styles: {
      connector1: {fill: 'black'},
      connector2: {stroke: '#FBF'}
      }
      })
    • 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

    • Define if the feature should be editable by the Editor module or not.

      Parameters

      • editable: boolean

        True, the feature can be edited, otherwise false.

      Returns Navlink

      // prevent the feature from being modified by the editor module
      object.editable(false);
    • Get a specific EditState of the feature.

      Parameters

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

        the "EditState" to retrieve its value.

      • Optionalvalue: number | boolean

      Returns number | boolean

      the value of the respective "EditState".

    • 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).

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

    • Get all nearby Navlink features that can be connected to at the specified coordinate index. Returns an array of ConnectionCandidate objects sorted by distance.

      Parameters

      • index: number

        The coordinate index of the shape/node to check for connection candidates.

      Returns ConnectionCandidate[]

      Array of ConnectionCandidate objects, sorted by distance (nearest first).

      const candidates = navlink.getConnectionCandidates(0);
      if (candidates.length > 1) {
      // let user choose which link to connect to
      candidates[0].connect();
      }
    • Returns an array of Boolean values indicating whether the corresponding shape is selected at coordinate-index or not.

      Returns boolean[] | boolean[][]

    • 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

    • 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: { [name: string]: any }

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

      Returns void

    • Remove the feature.

      Returns void

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

      Returns void

    • Sets the radius of the geofence.

      Parameters

      • radius: number

        The geofence radius in pixel.

      Returns void

      • geofence not supported
    • 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

    • Set the z-levels for the coordinates of the Navlink Feature. For each coordinate of the Navlink, the respective z-level must be provided.

      Parameters

      • zLevels: number[]

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

      Returns void

      // modify the zLevel of the second coordinate.
      let zlevels = navlink.getZLevels();
      zlevels[1] = -4;
      navlink.setZLevels(zlevels);
    • Show or hide the direction hint on the Navlink feature. If the function is called without arguments, the hint will be hidden.

      Parameters

      • Optionaldir: "BOTH" | "START_TO_END" | "END_TO_START"

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

      • OptionalhideShapes: boolean

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

      Returns void

    • Simplifies the line geometry by removing unnecessary points while preserving the overall shape.

      This method reduces the number of vertices in the line based on a distance-based tolerance. The tolerance can be provided either as a number (assumed to be in meters) or as a string with units like "px" (pixels) or "m" (meters).

      Parameters

      • tolerance: string | number

        The maximum allowed deviation between the original line and the simplified version. This can be specified as: - A number (default in meters): The tolerance in meters (e.g., 5 means 5 meters). - A string with units: e.g., "10px" for pixels or "10m" for meters. - If a string is provided without units, meters is assumed by default.

                       A larger value results in fewer points and more aggressive simplification.
                       A smaller value retains more detail but reduces the simplification effect.
        

      Returns void

      line.simplifyGeometry(5); // Simplifies the line allowing up to 5 meters of deviation.
      line.simplifyGeometry("10m"); // Simplifies the line allowing up to 10 meters of deviation.
      line.simplifyGeometry("10px"); // Simplifies the line with a tolerance of 10 pixels (useful for screen-based coordinates).
    • Get default or current style of the feature.

      Parameters

      • Optionaltype: "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

      • use layer.setStyleGroup instead
      "default"
      
    • Apply style to the feature.

      Parameters

      • style: Style[]

        the style to set for the feature

      Returns any

      • use layer.setStyleGroup instead
    • Returns a string representation of an object.

      Returns string

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

      Returns void

    • Unselect the feature.

      Returns void