You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constmapboxDraw=newMapboxDraw({//...modes: {
...MapboxDraw.modes,myMode: MyMode,},// PS. Object.assign gives me type error so I spread the existing modes.
Then in MyMode.ts
MyMode.onSetup=function(opt){this.activateUIButton("myMode");// doesn't work}MyMode.onStop=function(state){this.activateUIButton();// deactivates stock Mode buttons (i.e Polygon)// but when stock Mode is active, does not deactivate myMode.}
I was able to work the activation by creating a toggle function to add the ".active" class.
I was unable to work the second issue, if I click a stock Mode, it does not deactivate MyMode button.
The text was updated successfully, but these errors were encountered:
User Story
I create my own custom mode as per documentation:
Then in MyMode.ts
The text was updated successfully, but these errors were encountered: