mapboxer icon indicating copy to clipboard operation
mapboxer copied to clipboard

Additional methods

Open gregleleu opened this issue 2 years ago • 4 comments

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

gregleleu avatar Aug 30 '22 15:08 gregleleu

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.

walkerke avatar Sep 02 '22 15:09 walkerke

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 avatar Sep 02 '22 16:09 gregleleu

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

gregleleu avatar Sep 05 '22 14:09 gregleleu

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!!

gregleleu avatar Dec 30 '22 17:12 gregleleu