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

Additional methods #101

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Additional methods #101

wants to merge 14 commits into from

Conversation

gregleleu
Copy link

@gregleleu gregleleu commented Aug 30, 2022

Adding new methods:

  • A way to use controls which aren't native mapboxgl (or from the custom list in the package) -> I used it for MapboxGeocoder
  • adding the flyTo method
  • adding a method to change the Tiles URL of a vector source

Also updating to mapboxgl 2.10.0

@walkerke
Copy link

walkerke commented Sep 2, 2022

I'm very curious about this direction. Mapbox GL JS 2.0 has some really great new features but is not licensed the same way as Mapbox GL JS 1.0. For example, non-Mercator projections (including globe view!) work out of the box which I think would be of significant interest to R users:

library(mapboxer)

mapboxer(
  center = c(-73.9165, 40.7114),
  zoom = 2,
  projection = "globe"
)

image

There's nothing else like that in the R world right now, as far as I know. This requires locking in users to the new Mapbox 2.0 license, however. I wonder if it makes sense to add an option to use Mapbox 2.0 which users could set, then get access to the new features (acknowledging the new license structure)? This would depend on your development philosophy @crazycapivara, so I'd be interested to know what you think.

@gregleleu
Copy link
Author

The license and the pricing model attached are good points indeed. I actually only need version 1.12 for the methods I'm adding...

@gregleleu
Copy link
Author

  • Downgraded back to last 1.x.x. (before license and billing changes) (see discussion on v2)
  • Added a method to set feature states

@gregleleu
Copy link
Author

Added more stuff:

  • input${map_id}_loaded variable to know if map was loaded: any update can be conditioned to thank being true
  • fixed an issue with properties with multiple "_" not all being converted to "-"
  • Translated "removeSource" method
  • Made addControl even more flexible: for the case when arguments need to be passed directly to the constructor by position (not within an object with names)

@crazycapivara would you have a moment to have a look at integrating this PR? Thanks!!

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

Successfully merging this pull request may close these issues.

2 participants