Constructor
new DigitizeButton()
Creates the DigitizeButton.
Extends
- React.Component
Members
createDigitizeLayer
Creates digitize vector layer and adds this to the map.
createDrawInteraction
Creates a correctly configured OL draw interaction depending on given drawType and adds this to the map.
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.
DEFAULT_FILL_COLOR :String
Default fill color used in style object of drawn features.
Type:
- String
DEFAULT_LINESTRING_STYLE :OlStyleStyle
Default style for digitized lines.
Type:
- OlStyleStyle
DEFAULT_POINT_STYLE :OlStyleStyle
Default style for digitized points.
Type:
- OlStyleStyle
DEFAULT_POLYGON_STYLE :OlStyleStyle
Default style for digitized polygons or circles.
Type:
- OlStyleStyle
DEFAULT_STROKE_COLOR :String
Default stroke color used in style object of drawn features.
Type:
- String
DEFAULT_TEXT_STYLE :OlStyleStyle
Default style for digitized labels.
Type:
- OlStyleStyle
defaultProps :Object
The default properties.
Type:
- Object
getDigitizeStyleFunction
The styling function for the digitize vector layer, which considers different geometry types of drawn features.
getSelectedStyleFunction
The OL style for selected digitized features.
HIT_TOLERANCE :Number
Hit detection in pixels used for select interaction.
Type:
- Number
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.
onFeatureRemove
Listener for select
event of OL select interaction in Delete
mode.
Removes selected feature from the vector source and map.
onLabelChange
Called if label input field value was changed. Updates state value for textLabel.
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.
onModalLabelOk
Callback function after Ok
button of label input modal was clicked.
Turns visibility of modal off and call setTextOnFeature
method.
onModifyStart
Checks if a labeled feature is being modified. If yes, opens prompt to input a new label.
onPointerMove
Sets the cursor to pointer
if the pointer enters a non-oqaque pixel of
a hoverable layer.
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.
propTypes :Object
The properties.
Type:
- Object
setTextOnFeature
Sets formatted label on feature.
Methods
componentDidMount()
componentWillMount
method of the DigitizeButton. Just calls
createDigitizeLayer
method.
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. |
render()
The render function.