We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mapbox-gl-js version: n/a mapbox-gl-draw version: latest
Currently when writing a custom drawing mode for @mapbox/mapbox-draw-gl a whole heap of internal modules are required to be imported, for instance: https://github.com/bemky/mapbox-gl-draw-freehand-mode/blob/master/src/index.js#L1-L3
@mapbox/mapbox-draw-gl
import DrawPolygon from '@mapbox/mapbox-gl-draw/src/modes/draw_polygon'; import {geojsonTypes, cursors, types, updateActions, modes, events} from '@mapbox/mapbox-gl-draw/src/constants'; import doubleClickZoom from '@mapbox/mapbox-gl-draw/src/lib/double_click_zoom';
This is further a problem for people using typescript, where you need to declare each of the internal modules that your drawing mode uses:
declare module '@mapbox/mapbox-gl-draw'; declare module '@mapbox/mapbox-gl-draw/src/lib/theme'; declare module '@mapbox/mapbox-gl-draw/src/constants'; declare module '@mapbox/mapbox-gl-draw-static-mode'; declare module '@mapbox/mapbox-gl-draw/src/lib/create_supplementary_points'; declare module '@mapbox/mapbox-gl-draw/src/lib/common_selectors'; declare module '@mapbox/mapbox-gl-draw/src/modes/draw_polygon'; declare module '@mapbox/mapbox-gl-draw/src/lib/is_event_at_coordinates'; declare module '@mapbox/mapbox-gl-draw/src/modes/direct_select'; declare module '@mapbox/mapbox-gl-draw/src/lib/double_click_zoom';
(the above are what we required for the custom drawing modes that we have in the Yara AtFarm+ application)
I think the solution would be to have /index.js re-export all of those modules as a public API, rather than having them as internal modules.
/index.js
The text was updated successfully, but these errors were encountered:
Admittedly we can already access both @mapbox/mapbox-gl-draw/src/modes/draw_polygon and @mapbox/mapbox-gl-draw/src/modes/direct_select via:
@mapbox/mapbox-gl-draw/src/modes/draw_polygon
@mapbox/mapbox-gl-draw/src/modes/direct_select
import MapboxDraw from '@mapbox/mapbox-gl-draw'; const DrawPolygon = MapboxDraw.modes.draw_polygon;
If I'm understanding the code correctly.
Sorry, something went wrong.
No branches or pull requests
mapbox-gl-js version: n/a
mapbox-gl-draw version: latest
Currently when writing a custom drawing mode for
@mapbox/mapbox-draw-gl
a whole heap of internal modules are required to be imported, for instance: https://github.com/bemky/mapbox-gl-draw-freehand-mode/blob/master/src/index.js#L1-L3This is further a problem for people using typescript, where you need to declare each of the internal modules that your drawing mode uses:
(the above are what we required for the custom drawing modes that we have in the Yara AtFarm+ application)
I think the solution would be to have
/index.js
re-export all of those modules as a public API, rather than having them as internal modules.The text was updated successfully, but these errors were encountered: