Skip to content

Add control icon #9

@jo-chemla

Description

@jo-chemla

A control default button to be visible in the toolbar can be added using the activateUiButton method. This way, using the following react component would work and the draw rectangle mode would be available in the toolbar:

const modes = MapboxDraw.modes
modes['draw_rectangle'] = DrawRectangle;
// ...
<MapboxDraw>
  modes={modes}
  displayControlsDefault={false}
  controls={{
    polygon: true,
    trash: true, 
    rectangle: true // custom control display
  }}
</MapboxDraw>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions