Class: drawingBoard

.xyz.maps.editor.Editor. drawingBoard

Tool to manage drawing links or areas.

Classes

Shape

Methods Summary

addShape(pnt, lnk)

Add a point to link.

cancel()

Cancel drawing.

create(properties) → {here.xyz.maps.editor.features.Navlink|here.xyz.maps.editor.features.Line|here.xyz.maps.editor.features.Area|undefined}

Create the drawn feature.

getLength() → {Number}

Get length of the link.

isActive() → {Boolean}

Get state of the drawing board.

removeShape(idx)

Remove the last shape point.

setProperties(properties)

Set properties of the feature.

start(opt)

Start the drawing board to enable drawing.

Methods Details

addShape(pnt, lnk)

Add a point to link.
Parameters:
Name Type Argument Description
pnt here.xyz.maps.editor.PixelCoordinate the point to add to link.
lnk here.xyz.maps.editor.features.Navlink <optional>
the link to be split by the point, this link is given with the first point on link

cancel()

Cancel drawing.

create(properties) → {here.xyz.maps.editor.features.Navlink|here.xyz.maps.editor.features.Line|here.xyz.maps.editor.features.Area|undefined}

Create the drawn feature.
Parameters:
Name Type Argument Description
properties here.xyz.maps.editor.features.Feature.Properties <optional>
properties of the feature
Returns:
drawn feature or undefined in case of feature can't be created because of invalid geometry
Type:
here.xyz.maps.editor.features.Navlink | here.xyz.maps.editor.features.Line | here.xyz.maps.editor.features.Area | undefined

getLength() → {Number}

Get length of the link.
Returns:
Length of the link
Type:
Number

isActive() → {Boolean}

Get state of the drawing board.
Returns:
current state of the drawing board
Type:
Boolean

removeShape(idx)

Remove the last shape point.
Parameters:
Name Type Description
idx Number the index of the shape point to be removed

setProperties(properties)

Set properties of the feature.
Parameters:
Name Type Description
properties here.xyz.maps.editor.features.Navlink.Properties properties the feature will be created with.

start(opt)

Start the drawing board to enable drawing.
Parameters:
Name Type Argument Description
opt Object <optional>
Properties
Name Type Argument Description
mode String | here.xyz.maps.editor.features.Navlink | here.xyz.maps.editor.features.Line | here.xyz.maps.editor.features.Area <optional>
type of feature to draw. possible string values are: 'Line','Navlink' and 'Area'.
styleGroup Array.<here.xyz.maps.layers.TileLayer.Style> <optional>
for custom draw styling.
position here.xyz.maps.editor.PixelCoordinate <optional>
the first shape point
connectTo here.xyz.maps.editor.features.Navlink <optional>
link to which the drawn Navlink connects
layer here.xyz.maps.layers.TileLayer <optional>
layer where the feature should be created in.
onFinish function <optional>
callback function for finish drawing the object
onShapeAdd function <optional>
callback function for adding a shape point.
onShapeRemove function <optional>
callback function for removing a shape point.