-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Changing the mode from draw_circle to simple_select on event onTouchEnd throws an error #28
Comments
Hi, this works for me in the demo. Select Can you debug what's specific in your setup? |
your demo throws this error with any interaction after initial draw:get_features_and_set_cursor.js:14 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf') |
Hi, I think I'm running into a similar issue. I've tried the demo as well in Chrome, Firefox, and Safari, and on Linux and MacOS. The demo for me shows non-geodesic lines whenever a mode that's not the draw_circle is selected: The object also has an extra field which is "undefined". In this code: https://github.com/zakjan/mapbox-gl-draw-geodesic/blob/master/src/modes/index.js#L11-L22 what is happening when I step through the browser's debugger is |
Hi, the root cause was in incorrect reading existing mapbox-gl-draw modes after upgrading to mapbox-gl-draw 1.4.3. Fixed in f6ca244 and released as 2.3.1. Could you try it? |
Hi this fix seems to work for me, thanks! I figured it was something better than my hardcoded solution but I'm not as familiar with the mapbox library. |
When the user draws a circle, after the shape is created the mode needs to be changed to simple select, but instead an error is thrown:
Console error
The code is trying to access
Constants.modes.SIMPLE_SELECT
Constant
modes
doesn't contain property with keySIMPLE_SELECT
- it's in lower case.The text was updated successfully, but these errors were encountered: