urbica / react-map-gl-draw

React Component for Mapbox GL Draw
https://urbica.github.io/react-map-gl-draw
MIT License
50 stars 11 forks source link

add possibility to add default modes #6

Closed Akiyamka closed 5 years ago

Akiyamka commented 5 years ago

Component support prop modes. The most frequent case of using this parameter for add custom mode:

  modes: {
    ...lots_of_points: LotsOfPointsMode,
    ...MapboxDraw.modes
}

It's not problem if I use mapbox-gl-draw I have imported MapboxDraw instance where available default modes. But if I using component, how i can get modes before init? With ref and getDraw i got default modes after draw instance created.