Class: module:Digitizing

module:Digitizing()

new module:Digitizing()

Provides user interface for digitizing shapes and text

By default, it provides a toolbar with draw tools, editing tools (update, rotate, scale, split, delete, delete all), save, import and export tools.

The context attribute is used to link the digitizing context to the Digitizing module context. It is mandatory and provide a way to use this element for different contexts.

The other attributes are: selected-tool - Start selected drawing tools one of DigitizingAvailableTools or available-tools available-tools - List of available drawing tools based on DigitizingAvailableTools save - Enable save capability import-export - Enable import / export capabilities measure - Enable measure capability text-tools - Enable text tools

Source:
Listens to Events:
  • Digitizing#event:digitizingDrawColor
  • Digitizing#event:digitizingEditedFeatureRotation
  • Digitizing#event:digitizingEditedFeatureScale
  • Digitizing#event:digitizingEditedFeatureText
  • Digitizing#event:digitizingEditionBegins
  • Digitizing#event:digitizingEditionEnds
  • Digitizing#event:digitizingErase
  • Digitizing#digitizingErase.event:all
  • Digitizing#event:digitizingErasingBegins
  • Digitizing#event:digitizingErasingEnds
  • Digitizing#event:digitizingFeatureDrawn
  • Digitizing#event:digitizingMeasure
  • Digitizing#event:digitizingRotate
  • Digitizing#event:digitizingScaling
  • Digitizing#event:digitizingSave
  • Digitizing#event:digitizingSplit
  • Digitizing#event:digitizingToolSelected
  • Digitizing#event:digitizingVisibility
Example

Example of use

<lizmap-digitizing
    context="draw"
    selected-tool="box"
    available-tools="point,line,polygon,box,freehand"
    save
    import-export
    measure
    text-tools
    ></lizmap-digitizing>

Extends

  • HTMLElement

Classes

Digitizing
Digitizing

Members

availableTools :string

The available tools The element attribute: available-tools All or part of DigitizingAvailableTools except deactivate

Type:
  • string
Source:
See:
  • DigitizingAvailableTools

context :string

Digitizing context The element attribute: context

Type:
  • string
Source:

deactivate :boolean

The element is deactivated if the element is disabled or if the tool is deactivated

Type:
  • boolean
Source:

disabled :boolean

The element is disabled if the context is not the same as the module

Type:
  • boolean
Source:

importExportAvailable :boolean

Import/export is available The element has attribute: import-export

Type:
  • boolean
Source:

measureAvailable :boolean

Measure is available The element has attribute: measure

Type:
  • boolean
Source:

saveAvailable :boolean

Save is available The element has attribute: save

Type:
  • boolean
Source:

textToolsAvailable :boolean

Text tools are available The element has attribute: text-tools

Type:
  • boolean
Source:

toolSelected :string

The selected tool The element attribute: selected-tool

Type:
  • string
Source:

toolSelected

Setting the selected

Source:
See:
  • DigitizingAvailableTools

(static, constant) DigitizingTools :string

Enum for digitizing tools

Type:
  • string
Properties:
Name Type Description
Deactivate string

Deactivate digitizing tools

Point string

Point digitizing tool

Line string

Line digitizing tool

Polygon string

Polygon digitizing tool

Box string

Box digitizing tool

Circle string

Circle digitizing tool

Freehand string

Freehand digitizing tool

Text string

Text digitizing tool

Source:

(inner, constant) DigitizingAvailableTools :Array.<string>

List of digitizing available tools

Type:
  • Array.<string>
Source:

Methods

eraseAll() → {boolean}

Erase all features

Source:
Returns:
  • False if the user cancels the action
Type
boolean

selectTool(tool) → {boolean}

Select tool

Parameters:
Name Type Description
tool string

The tool to select

Source:
Returns:
  • True if the tool is selected, false otherwise
Type
boolean

toggleToolSelected(event)

Toggle selected tool

Parameters:
Name Type Description
event MouseEvent

The click event on the button

Source:

Events

digitizingDrawColor

Type:
  • object
Properties:
Name Type Description
type string

digitizing.drawColor

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing draw color has changed: '+lizmapEvent.color);
}, 'digitizing.drawColor');

digitizingEditedFeatureRotation

Type:
  • object
Properties:
Name Type Description
type string

digitizing.editedFeatureRotation

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The edited feature rotation has been changed: '+lizmapEvent.rotation);
}, 'digitizing.editedFeatureRotation');

digitizingEditedFeatureScale

Type:
  • object
Properties:
Name Type Description
type string

digitizing.editedFeatureScale

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The edited feature text scale has been changed: '+lizmapEvent.scale);
}, 'digitizing.editedFeatureScale');

digitizingEditedFeatureText

Type:
  • object
Properties:
Name Type Description
type string

digitizing.editedFeatureText

text string

The text set for the edited feature

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The edited feature text has been updated: '+lizmapEvent.text);
}, 'digitizing.editedFeatureText');

digitizingEditionBegins

Type:
  • object
Properties:
Name Type Description
type string

digitizing.editionBegins

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('Edition begins');
}, 'digitizing.editionBegins');

digitizingEditionEnds

Type:
  • object
Properties:
Name Type Description
type string

digitizing.editionEnds

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('Edition ends');
}, 'digitizing.editionEnds');

digitizingErase

Type:
  • object
Properties:
Name Type Description
type string

digitizing.erase

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('A drawn feature has been erased');
}, 'digitizing.erase');

digitizingEraseAll

Type:
  • object
Properties:
Name Type Description
type string

digitizing.erase.all

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('All drawn features have been erased');
}, 'digitizing.erase.all');

digitizingErasingBegins

Type:
  • object
Properties:
Name Type Description
type string

digitizing.erasingBegins

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('The digitizing erasing tool begins');
}, 'digitizing.erasingBegins');

digitizingErasingEnds

Type:
  • object
Properties:
Name Type Description
type string

digitizing.erasingEnds

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('The digitizing erasing tool ends');
}, 'digitizing.erasingEnds');

digitizingFeatureDrawn

Type:
  • object
Properties:
Name Type Description
type string

digitizing.featureDrawn

Source:
Example
lizMap.mainEventDispatcher.addListener(() => {
    console.log('A feature has been drawn');
}, 'digitizing.featureDrawn');

digitizingMeasure

Type:
  • object
Properties:
Name Type Description
type string

digitizing.measure

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing measure tool is active or not? '+lizmapEvent.visible);
}, 'digitizing.measure');

digitizingRotate

Type:
  • object
Properties:
Name Type Description
type string

digitizing.rotate

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing rotation tool is active or not? '+lizmapEvent.isRotate);
}, 'digitizing.rotate');

digitizingSave

Type:
  • object
Properties:
Name Type Description
type string

digitizing.save

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing save tool is active or not: '+lizmapEvent.isSaved);
}, 'digitizing.save');

digitizingScaling

Type:
  • object
Properties:
Name Type Description
type string

digitizing.scaling

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing scaling tool is active or not? '+lizmapEvent.isScaling);
}, 'digitizing.rotate');

digitizingSplit

Type:
  • object
Properties:
Name Type Description
type string

digitizing.split

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing split tool is active or not? '+lizmapEvent.isSplitting);
}, 'digitizing.split');

digitizingToolSelected

Type:
  • object
Properties:
Name Type Description
type string

digitizing.toolSelected

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing selected tool has changed: '+lizmapEvent.tool);
}, 'digitizing.toolSelected');

digitizingVisibility

Type:
  • object
Properties:
Name Type Description
type string

digitizing.visibility

Source:
Example
lizMap.mainEventDispatcher.addListener((lizmapEvent) => {
    console.log('The digitizing visibility has changed: '+lizmapEvent.visible);
}, 'digitizing.visibility');