-
Notifications
You must be signed in to change notification settings - Fork 592
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
Importing internal dependencies #786
Comments
@thiagoxvo - To do this well, I think we need to expose these via the mode_interface. Currently all of the logic filled mode_interface functions are added to the interface via mode_interface_accessors. I'd love to see a PR that moves This same practice can be used for double_click_zoom. |
I didn't know about this mode_interface 🤔, should I be using this to create my modes? |
What do you mean by exposing would be something like this? const CommonSelectors = require('../lib/common_selectors');
ModeInterface.prototype.isVertex = function(e) {
return CommonSelectors.isVertex(e)
};
// and later on I would be using this way ??
import MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw'
const MyAwesomeMode = MapboxDraw.modes.mode_interface
// and than I can call...
MyAwesomeMode.isVertex() |
These are all the library methods that all the modes use. Exporting them makes it possible for others to write custom modes which provides the same functionality. Fixes mapbox#786
I don't think there is any reason to expose them via the mode_interface. The library functions don't need to access
|
These are all the library methods that all the modes use. Exporting them makes it possible for others to write custom modes which provides the same functionality. Fixes mapbox#786
Any updates? |
I am creating a new drawing mode. To avoid reinventing the wheel I would like to reuse some functions that were already implemented in:
I am using create-react-app and if I try to import any of them and build my project, I have the minification issue:
I am using:
mapbox-gl-js 0.44.2:
mapbox-gl-draw 1.0.7:
I could send a PR if I get a better understanding how to solve this.
The text was updated successfully, but these errors were encountered: