mapbox-controls icon indicating copy to clipboard operation
mapbox-controls copied to clipboard

Programatically use controls

Open vinayakkulkarni opened this issue 3 years ago • 3 comments

I propose adding a property to the controls as an option where user can programatically enable controls without the need of adding them on the map. There's already a prop in mapbox-gl-draw which allows you to add DrawControl without adding the buttons as controls on the map – displayControlsDefault

Screenshot 2021-05-20 at 4 33 03 PM

vinayakkulkarni avatar May 20 '21 11:05 vinayakkulkarni

You can use programmatically (measuringOn, measuringOff methods), and hide it from the map just to set display: none; to .mapbox-control-ruler class. Thanks for proposal, let's see if someone else needs this option.

korywka avatar May 20 '21 11:05 korywka

Hey! I would also appreciate this option a lot. Makes it easier to add custom control buttons.

kaareltinn avatar Mar 01 '22 11:03 kaareltinn

@kaareltinn Hi. Please wait till the war is over.

korywka avatar Mar 02 '22 19:03 korywka

✅ https://www.npmjs.com/package/@mapbox-controls/ruler

korywka avatar Oct 04 '23 00:10 korywka