Error when adding Drawing Mode to map

If you run the 'Enable Drawing Mode a MapboxMap' action on page load, you may get this error:

This error is occuring because the Mapbox Map isn't visible on page load. For example:

  • The map may have the 'this element is visible on page load' checkbox unchecked

  • The map be in a group/popup/floating group that isn't visible on page load

It is recommended to use popups rather than floating groups if you are trying to enable 'Drawing Mode' on a map within that popup/floating group

The solution is to run the 'Enable Drawing Mode a Mapbox Map' action when you are making the Map (or its parent element) visible.

In the below example, the Mapbox Map is in a popup:

If I try to enable 'Drawing Mode' on page load, an error will occur. However, if I add the 'Enable Drawing Mode' action after the action where I show the popup it will correctly show the popup with the map and drawing mode will be enabled:

Last updated