Skip to content
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

Custom Modes #289

Closed
mcwhittemore opened this issue Apr 22, 2016 · 6 comments
Closed

Custom Modes #289

mcwhittemore opened this issue Apr 22, 2016 · 6 comments
Assignees

Comments

@mcwhittemore
Copy link
Contributor

The modularity provided by a mode system should be exposed to end-users so they can replace out the default interactions with their own.

@drewbo
Copy link
Contributor

drewbo commented Feb 22, 2017

@mcwhittemore any ideas on how to implement this? It seems pretty tricky because the modes are so closely tied to some of the api methods ala https://github.com/mapbox/mapbox-gl-draw/blob/master/src/api.js#L129 instead of falling back to the larger mode modules. Happy to kick around some ideas + code as we're looking to use this again in another project with some custom behavior

@drewbo
Copy link
Contributor

drewbo commented Feb 22, 2017

Actually, the more I look; the file I mentioned is really the only place where the modularity of the mode system breaks down a little (nice job!). Would the next steps to implementing this feature be something like:

  • Abstract the API checks for other custom modes
  • Document required methods for a custom mode module/object
  • Provide a method or option for loading those custom modes

Edit: noting that much of the second bullet is covered via the Draw Mode README

@mcwhittemore
Copy link
Contributor Author

@drewbo sorry for just seeing this.

Those bullet points seem right to me.

We'll want to make sure the API for these modes is really pretty solid. Asking people to write custom modes and then breaking the API a few times won't be good. My key concern is cleaning up how events are handled/registered.

@mcwhittemore
Copy link
Contributor Author

Here is a ticket where @davidtheclark and I are talking about this problem - #459

@BhavanPatel
Copy link

@mcwhittemore @drewbo I think GeoJSON support rectangle... as I have seen in this Demo and map seems mapbox.

@mcwhittemore
Copy link
Contributor Author

mcwhittemore commented Mar 3, 2017

Moved my reply to #604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants