Skip to main content

Click to Edit Helper Mode

The Click to Edit Helper Mode makes existing features directly interactive: clicking a feature on the map puts it straight into editing, so users don't have to enable a specific edit tool first. It is a convenience layer on top of Geoman's edit modes and is well suited to "select and tweak" workflows.

You can enable Click to Edit Helper Mode with the following methods:

map.gm.enableMode('helper', 'click_to_edit');
map.gm.disableMode('helper', 'click_to_edit');
map.gm.toggleMode('helper', 'click_to_edit');
map.gm.isModeEnabled('helper', 'click_to_edit');

Events for Click to Edit Helper Mode

The following events are available on a map instance:

EventParamsDescriptionOutput
gm:globalclick_to_editmodetoggledeventFired when Click to Edit Helper Mode is toggled.enabled, map

Example Usage

map.on('gm:globalclick_to_editmodetoggled', (event) => {
console.log(event);
});

The actual geometry changes a user makes while a feature is being edited are reported through the standard edit events (gm:editstart, gm:edit, gm:editend) and feature events — see Events.

Behavior

The click to edit helper:

  1. Resolves the feature under the cursor across Geoman's persistent sources.
  2. Activates editing for that feature so its vertices/handles become draggable.
  3. Works together with the snapping and shape-marker helpers when they are enabled.

Default Control Options

OptionDefault
title"Click to edit"
iconbuilt-in click-to-edit icon
uiEnabledtrue
activefalse

Live Click to Edit Example

Building something complex? Our team can help with architecture and integration. Get in touch →