Closed divya1c closed 4 years ago
When you want to add a custom mode, you generally do:
const modes = MapboxDraw.modes;
modes.my_custom_mode = MyCustomMode;
const Draw = new MapboxDraw({ modes });
So maybe you could do something like this:
const modes = MapboxDraw.modes;
modes.simple_select.onTrash = ...
const Draw = new MapboxDraw({ modes });
Or just create your own custom mode, copy/paste simple_select and do your stuff.
The example that @eddydg provided should work in this case. If it does, can you submit a PR to update the custom mode docs to talk about this?
Hi!
Is there a functionality by which I can override one of the functions of the simple select mode? I want to change only the trash() of SimpleSelect mode and keep everything the same.
Thanks!