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:
Event | Params | Description | Output |
---|---|---|---|
gm:drawstart | event | Fired when text marker drawing starts. | map , shape |
gm:create | event | Fired when a text marker is created. | map , shape , feature |
gm:drawend | event | Fired when text marker drawing is completed. | map , shape |
Behavior
Text marker drawing operates by:
- Clicking on the map to place the text marker
- A text input field appears where you can enter your text
- Click outside the text field to complete the marker
- The text marker is placed at the clicked location with the entered text