Constructor
new MeasureButton()
Creates the MeasureButton.
Extends
- React.Component
Members
defaultProps :Object
The default properties.
Type:
- Object
propTypes :Object
The properties.
Type:
- Object
Methods
addMeasureStopTooltip(evt)
Adds a tooltip on click where a measuring stop occured.
Parameters:
Name | Type | Description |
---|---|---|
evt |
OlMapBrowserEvent | The event which contains the coordinate for the tooltip. |
cleanup()
Cleans up artifacts from measuring when the button is unpressed.
cleanupTooltips()
Cleans up tooltips when the button is unpressed.
componentDidMount()
componentWillMount
method of the MeasureButton. Just calls a
createMeasureLayer
method.
createDrawInteraction() → {OlInteractionDraw}
Creates a correctly configured OL draw interaction depending on the configured measureType.
Returns:
The created interaction, which is not yet added to the map.
- Type
- OlInteractionDraw
createHelpTooltip()
Creates a new help tooltip as OlOverlay
.
createMeasureLayer()
Creates measure vector layer and add this to the map.
createMeasureTooltip()
Creates a new measure tooltip as OlOverlay
.
drawEnd()
Called whenever measuring stops, this method draws static tooltips with the result onto the map canvas and unregisters various listeners.
drawStart(evt)
Sets up listeners whenever the drawing of a measurement sketch is started.
Parameters:
Name | Type | Description |
---|---|---|
evt |
OlInteractionDrawEvent | The event which contains the feature we are drawing. |
onDrawInteractionActiveChange()
Adjusts visibility of measurement related tooltips depending on active status of draw interaction.
onToggle()
Called when the button is toggled, this method ensures that everything is cleaned up when unpressed, and that measuring can start when pressed.
pointerMoveHandler(evt)
Handle pointer move by updating and repositioning the dynamic tooltip.
Parameters:
Name | Type | Description |
---|---|---|
evt |
OlMapBrowserEvent | The event from the pointermove. |
removeHelpTooltip()
Removes help tooltip from the map if measure button was untoggled.
removeMeasureTooltip()
Removes measure tooltip from the map if measure button was untoggled.
render()
The render function.