geoflo.Painting

This module provides the painting functionality for the Geoflo application. It allows users to free-draw on the map.

Methods

static activate() → {void}

Activates the painting functionality by enabling painting mode and clearing the source data.
Returns:
void

static deactivate() → {void}

This function deactivates the current feature by setting the 'enabled' property to false, disabling the painting tool, enabling drag pan on the map, and deleting the feature.
Returns:
void

static handleUp(event) → {Promise.<Object>}

This function updates the feature based on the 'mouse up' event. It retrieves the current feature, updates the hot source, clones the updated feature, and sets the last click coordinates.
Parameters:
Name Type Description
event Event The event triggering the function.
Returns:
Promise.<Object> - The updated feature object.

static setFeature(coords) → {Object}

This function creates a feature based on the given type and coordinates. It updates the currentCoords array, sets the feature, and triggers a 'painting.start' event.
Parameters:
Name Type Description
coords Array The coordinates to set the feature at.
Returns:
Object - The created feature.

static updateFeature(coords) → {Object}

This function updates the feature based on the provided coordinates. It handles different types of features like Rectangle, Circle, and others.
Parameters:
Name Type Description
coords Array The coordinates to update the feature with.
Returns:
Object - The updated feature object.