maps
maps copied to clipboard
Should setAccessToken return a Promise
For this library to work well, the consumer is expected to call setAccessToken to initialize it (even when not using Mapbox, no call to setAccessToken breaks).
The current implementation (java: https://github.com/rnmapbox/maps/blob/98c8f50a18c7b4f0b1ff0ee1606e4cc53b63a888/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/modules/RCTMGLModule.java#L302) returns before the new accesstoken is applied. This can cause issues since for example calling "getPacks" immediately after setAccessToken could fail.
A solution might be to make setAccessToken only resolve after it has been applied.
@YousefED I think it's a good idea