Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to dynamically update the drawing controls #922

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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