Skip to main content

Draw Text Marker Mode

Text Marker Mode allows you to add text labels to the map by clicking on desired locations and entering custom text.

You can enable Draw Text Marker Mode like this:

map.gm.enableDraw("text_marker");
map.gm.disableDraw();
map.gm.toggleDraw("text_marker");
map.gm.drawEnabled("text_marker");

// Or like this:
map.gm.enableMode("draw", "text_marker");
map.gm.disableMode("draw", "text_marker");
map.gm.toggleMode("draw", "text_marker");
map.gm.isModeEnabled("draw", "text_marker");

The following events are available on a map instance:

EventParamsDescriptionOutput
gm:drawstarteventFired when text marker drawing starts.map, shape
gm:createeventFired when a text marker is created.map, shape, feature

Behavior

Text marker drawing operates by:

  1. Clicking on the map to place the text marker
  2. A text input field appears where you can enter your text
  3. Click outside the text field to complete the marker
  4. The text marker is placed at the clicked location with the entered text

Live Draw Text Marker Example