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
I noticed there is a Static mode available but I am unable to change into it through the changeMode method. Is there a way to access the static mode since I want to turn off editing of shapes at some point for the user. Thanks!
The text was updated successfully, but these errors were encountered:
Hey, I don't think Static mode is available by default. You can make custom modes, and someone (main maintainer of mapbox-gl) happened to have open sourced a static custom mode here: https://github.com/mapbox/mapbox-gl-draw-static-mode.
Static mode is easy to implement on your own though, here's a code snippet that should work:
StaticMode.onSetup = function () {
this.setActionableState(); // default actionable state is false for all actions
return {};
};
StaticMode.toDisplayFeatures = function (state, geojson, display) {
display(geojson);
};
// in your component:
<DrawControl mode={{static: StaticMode}} defaultMode={"static"}/ >
You probably would want the DrawControl to have more than just the static mode though. I'm sure you can figure that part out on your own.
I noticed there is a Static mode available but I am unable to change into it through the changeMode method. Is there a way to access the static mode since I want to turn off editing of shapes at some point for the user. Thanks!
The text was updated successfully, but these errors were encountered: