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

Get rid of the mapboxgl.Control class #2118

Closed
lucaswoj opened this issue Feb 13, 2016 · 4 comments
Closed

Get rid of the mapboxgl.Control class #2118

lucaswoj opened this issue Feb 13, 2016 · 4 comments
Labels
breaking change ⚠️ Requires a backwards-incompatible change to the API feature 🍏 medium priority

Comments

@lucaswoj
Copy link
Contributor

We shouldn't require 3rd party plugins to require('mapbox-gl').Control in their module. All the code in this class could be easily moved elsewhere (i.e. map#addControl and map#removeControl methods).

ref mapbox/mapbox-gl-draw#235

@jfirebaugh
Copy link
Contributor

Would we deprecate/remove existing methods like Popup#addTo? Or not try to enforce Control#addTo/Control#remove as a standard API for controls?

cc @mourner

@lucaswoj
Copy link
Contributor Author

We could deprecate the class and alias

  • Control#addTo to Map#addControl
  • Control#remove to Map#removeControl

@mcwhittemore
Copy link
Contributor

For the short term gl-draw has copied the Control class into its code base and removed the direct dependency.

mapbox/mapbox-gl-draw#244

@lucaswoj
Copy link
Contributor Author

Done in #3497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ⚠️ Requires a backwards-incompatible change to the API feature 🍏 medium priority
Projects
None yet
Development

No branches or pull requests

3 participants