Draw Circle Mode
Circle Mode allows you to add circles to the map by defining a center point and radius.
You can enable Draw Circle Mode like this:
map.gm.enableDraw('circle');
map.gm.disableDraw();
map.gm.toggleDraw('circle');
map.gm.drawEnabled('circle');
// Or like this:
map.gm.enableMode('draw', 'circle');
map.gm.disableMode('draw', 'circle');
map.gm.toggleMode('draw', 'circle');
map.gm.isModeEnabled('draw', 'circle');
The following events are available on a map instance:
Event | Params | Description | Output |
---|---|---|---|
gm:drawstart | event | Fired when circle drawing starts. | map , shape |
gm:create | event | Fired when a circle is created. | map , shape , feature |
gm:drawend | event | Fired when circle drawing is completed. | map , shape |
Behavior
Circle drawing operates by:
- Clicking on the map to place the circle center
- Moving the mouse to adjust the radius
- Clicking again to finalize the circle
The circle is represented as a GeoJSON polygon with 80 steps by default for smooth rendering.