Skip to content

Conversation

@krvajal
Copy link

@krvajal krvajal commented Oct 8, 2019

Exposes a new method called setControls to dynamically toggle the
drawing controls

Example usage

 const drawControl = new MapboxDraw({
            displayControlsDefault: false,
            controls: {
                polygon: true,
                trash: true,
            },
        });
// add the control to the map
map.addControl(drawControl, 'bottom-right');

// now show only the trash 
drawControl.setControls({trash: true})

This is my first PR to this project and not sure if I missing some necessary step. I would appreciate any help to get this merged as it is a very handy feature.

fixes #824

exposes a new method called `setControls` to dynamically toggle the
drawing controls

fixes mapbox#824
@kkaefer kkaefer added feature ui Buttons & user interactions labels Jan 7, 2020
@karimnaaji karimnaaji closed this Jun 16, 2020
@karimnaaji karimnaaji reopened this Jun 16, 2020
@arindam1993 arindam1993 changed the base branch from master to main June 17, 2020 01:23
@JClackett
Copy link

Please merge this 👍

@lupas
Copy link

lupas commented Jan 10, 2021

I'd also vote for this to be merged, would be super useful :)

I need to restrict users to only create 1 element and not multiple, and this would allow me to do that.

@crow7m
Copy link

crow7m commented Nov 6, 2023

Hey, any update on this will be really really useful , thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ui Buttons & user interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable/Remove Controls

7 participants