XYZ Maps Documentation
    Preparing search index...

    The DrawingBoard is a tool to easily enable the user to draw the geometry for a feature by user interaction with mouse/touch "taps" on the screen. A feature based on the drawn geometry and custom properties can be created when the drawing operation is done.

    Index
    • Add a shape-point to the feature.

      Parameters

      • position: GeoPoint | PixelPoint

        the coordinate in pixels relative to the screen that should be added to the coordinates of the feature.

      • Optionalnavlink: Navlink

        pass this parameter in case of a Navlink feature is drawn that should start on the geometry of another Navlink, to split it's geometry automatically.

      Returns DrawingShape

    • Cancel the current drawing operation.

      Returns void

    • Finish current drawing operation and create the drawn feature.

      Parameters

      • Optionalproperties: any

        properties the feature will be created with.

      Returns Navlink | Line | Area

      the created Feature or undefined if creation fails due to invalid geometry.

    • Get the total number of coordinates / shape-points of the currently drawn feature.

      Returns number

      Number of coordinates

    • Get the active state of the drawing board.

      Returns boolean

      true when active, otherwise false

    • Remove a shape-point. If no index is defined, the last added shape-point will be removed.

      Parameters

      • Optionalindex: number

        the index of the shape-point to be removed.

      Returns void

    • Parameters

      • p: any

      Returns void

      • use setProperties instead.
    • Set the geometry of the currently drawn feature.

      If the geometry of an area (MultiPolygon) is specified, only the first exterior is processed.

      Parameters

      Returns void

    • Set properties of the feature.

      Parameters

      • properties: any

        properties the feature will be created with.

      Returns void

    • Start a new drawing operation to shape/draw the geometry a feature by user interaction with mouse/touch "taps" on the screen.

      Parameters

      • Optionaloptions: {
            connectTo?: Navlink;
            layer?: TileLayer;
            mode?: "Navlink" | "Area" | "Line";
            onShapeAdd?: (event: EditorEvent) => void;
            onShapeRemove?: (event: EditorEvent) => void;
            position?: GeoPoint | PixelPoint;
            styleGroup?: CommonStyle[];
            tolerance?: number;
        }

        options to configure the drawing operation

        • OptionalconnectTo?: Navlink

          the Navlink feature to which the drawn Navlink should connect.

        • Optionallayer?: TileLayer

          the layer where the feature should be created in.

        • Optionalmode?: "Navlink" | "Area" | "Line"

          the type of feature that should be drawn.

        • OptionalonShapeAdd?: (event: EditorEvent) => void

          event listener that's called for each shape-point that's being added by user interaction. The target of the event is the drawn shape-point DrawingShape

        • OptionalonShapeRemove?: (event: EditorEvent) => void

          function that's called for each shape-point that's being removed by user interaction. The target of the event is the drawn shape-point DrawingShape

        • Optionalposition?: GeoPoint | PixelPoint

          defines the first coordinate /the starting position.

        • OptionalstyleGroup?: CommonStyle[]

          for custom draw styling.

        • Optionaltolerance?: number

          The tolerance in meters, used to determine the level of simplification. The simplification is applied to the LineString geometry only after drawing the geometry is complete by calling DrawingBoard.create. Tolerance has no effect if mode is set to "Area". Set tolerance to 0 to disable simplification.

          1
          

      Returns boolean