Class: DigitizeButton

DigitizeButton()

The DigitizeButton

Constructor

new DigitizeButton()

Creates the DigitizeButton.

Source:

Extends

  • React.Component

Members

createDigitizeLayer

Creates digitize vector layer and adds this to the map.

Source:

createDrawInteraction

Creates a correctly configured OL draw interaction depending on given drawType and adds this to the map.

Source:

createSelectOrModifyInteraction

Creates a correctly configured OL select and/or modify and/or translate interaction(s) depending on given editType and adds this/these to the map.

Source:

DEFAULT_FILL_COLOR :String

Default fill color used in style object of drawn features.

Type:
  • String
Source:

DEFAULT_LINESTRING_STYLE :OlStyleStyle

Default style for digitized lines.

Type:
  • OlStyleStyle
Source:

DEFAULT_POINT_STYLE :OlStyleStyle

Default style for digitized points.

Type:
  • OlStyleStyle
Source:

DEFAULT_POLYGON_STYLE :OlStyleStyle

Default style for digitized polygons or circles.

Type:
  • OlStyleStyle
Source:

DEFAULT_STROKE_COLOR :String

Default stroke color used in style object of drawn features.

Type:
  • String
Source:

DEFAULT_TEXT_STYLE :OlStyleStyle

Default style for digitized labels.

Type:
  • OlStyleStyle
Source:

defaultProps :Object

The default properties.

Type:
  • Object
Source:

getDigitizeStyleFunction

The styling function for the digitize vector layer, which considers different geometry types of drawn features.

Source:

getSelectedStyleFunction

The OL style for selected digitized features.

Source:

HIT_TOLERANCE :Number

Hit detection in pixels used for select interaction.

Type:
  • Number
Source:

onFeatureCopy

Listener for select event of OL select interaction in Copy mode. Creates a clone of selected feature and calls utility method to move it beside the original to avoid overlapping.

Source:

onFeatureRemove

Listener for select event of OL select interaction in Delete mode. Removes selected feature from the vector source and map.

Source:

onLabelChange

Called if label input field value was changed. Updates state value for textLabel.

Source:

onModalLabelCancel

Callback function after Cancel button of label input modal was clicked. Turns visibility of modal off and removes last drawn feature from the digitize layer.

Source:

onModalLabelOk

Callback function after Ok button of label input modal was clicked. Turns visibility of modal off and call setTextOnFeature method.

Source:

onModifyStart

Checks if a labeled feature is being modified. If yes, opens prompt to input a new label.

Source:

onPointerMove

Sets the cursor to pointer if the pointer enters a non-oqaque pixel of a hoverable layer.

Source:

onToggle

Called when the digitize button is toggled. If the button state is pressed, the appropriate draw, modify or select interaction will be created. Otherwise, by untoggling, the same previously created interaction will be removed from the map.

Source:

propTypes :Object

The properties.

Type:
  • Object
Source:

setTextOnFeature

Sets formatted label on feature.

Source:

Methods

componentDidMount()

componentWillMount method of the DigitizeButton. Just calls createDigitizeLayer method.

Source:

handleTextAdding(evt)

Changes state for showLabelPrompt to make modal for label input visible.

Parameters:
Name Type Description
evt Event

Click event on adding feature to the digitize layer.

Source:

render()

The render function.

Source: