mapboxer
mapboxer copied to clipboard
Additional methods
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
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"
)
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.
The license and the pricing model attached are good points indeed. I actually only need version 1.12 for the methods I'm adding...
- Downgraded back to last 1.x.x. (before license and billing changes) (see discussion on v2)
- Added a method to set feature states
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!!