Skip to main content

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:

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

Behavior

Circle drawing operates by:

  1. Clicking on the map to place the circle center
  2. Moving the mouse to adjust the radius
  3. Clicking again to finalize the circle

The circle is represented as a GeoJSON polygon with 80 steps by default for smooth rendering.

Live Draw Circle Example