Digitize

digitize. Digitize

Class representing a digitize control

Constructor

new Digitize(store, target, toggleTools)

Create a digitize control

Parameters:
Name Type Description
store object

NSPIT store

target HTMLElement

DOM element for measure control

toggleTools object

Activate/deactivate other tools

Methods

abortDraw()

Remove drawing and snapping interactions, add select and modify interactions

activateDigitize()

Activate digitize tool

addDigitizingInteractions(uuid)

Add drawing and snapping interactions on map

Parameters:
Name Type Description
uuid string

Unique layer id

addModifySelect()

Add select and modify interactions to the map

createServerLayer()

Create an empty layer in database

createStyleIcon(name, size, fill, stroke, encoded)

Create svg element with provided properties

Parameters:
Name Type Description
name string

Name of icon from icons configuration file

size string

Width/height value

fill string

Fill color in hex format

stroke string

Stroke color in hex format

encoded boolean

Whether svg data should be encoded

createStylingContainerElements(geomType)

Create DOM elements for styling container

Parameters:
Name Type Description
geomType string

Geometry type of provided feature

deactivateDigitize()

Deactivate digitize tool

generateLinePattern(lineStyle)

Generate line style

Parameters:
Name Type Description
lineStyle string

Line style

generateStyleFromStyleConfig(styleConfig)

Generate vector style for a feature with provided properties

Parameters:
Name Type Description
styleConfig object

Object with feature style properties

generateStyleFromStyleMenu(geomType)

Generate vector style for a layer and an object with style properties for saving in database

Parameters:
Name Type Description
geomType string

Geometry type of styling feature

generateStylePreview(geomType)

Generate style preview in styling container

Parameters:
Name Type Description
geomType string

Geometry type of styling feature

generateStyleWithVertices(feature, typeDigitize)

Generate vector style for selected and drawn features

Parameters:
Name Type Description
feature object

Feature object

typeDigitize string

Activated drawing geometry type

getDigitizingLayersFromServer(uuid)

Get information about all drawn layers from database for user and create list of layers

Parameters:
Name Type Description
uuid string

Unique layer id (optional)

getLayer(uuid, callback)

Get layer information from database

Parameters:
Name Type Description
uuid string

Unique layer id

callback function

Callback function for loading layer

hexToRgb(hex)

Generate rgb color value from hex format

Parameters:
Name Type Description
hex string

Color in hex format

removeInteractions()

Remove draw and snap interactions, clear feature selection, deactivate layer selection and hide styling container

removeModifySelect()

Remove select and modify interactions from the map

rgbToRgba(rgb, opacity)

Generate rgba color value (with opacity property)

Parameters:
Name Type Description
rgb string

Color in rgb format

opacity string

Opacity property

saveGeomToServer(uuid)

Save geometries of a layer to database

Parameters:
Name Type Description
uuid string

Unique layer id

saveStyleToServer(uuid, fid, styleObjectNspit)

Save style properties to database

Parameters:
Name Type Description
uuid string

Unique layer id

fid string

Unique feature id

styleObjectNspit object

Object with feature style properties

toggleActiveLayer(uuid)

Activate/deactivate selected layer for drawing

Parameters:
Name Type Description
uuid string

Unique layer id

updateVectorStyle(uuid, geomType)

Update style properties of feature in database and trigger generation of style preview in styling container

Parameters:
Name Type Description
uuid string
geomType string