Repository navigation
DefaultFileSource has responsibility for handling mapbox:// URLs - #1607
Conversation
|
Nice! |
|
At a glance, it looks like this will fix #1334 as well. 👍 |
|
Liking the direction here 👍 Thinking that breaking out separate |
|
I also like that the access token is no longer part of the style URL, so if the access token changes at some point during the lifetime of the file source, we don’t have to go updating other fields. This turns out to jive nicely with the last bit of refactoring I’m doing for #1553, where I’m also removing |
The singleton `MGLAccountManager` wants to be the sole arbiter of the access token, but each instance of `mbgl::Map` (`mbgl::DefaultFileSource` in #1607) has its own copy of the access token. Now `MGLMapView` observes for changes to the `MGLAccountManager`’s access token and synchronizes `mbgl::Map` with it.
There was a problem hiding this comment.
With #1553, MGLMapView no longer calls getAccessToken() anywhere.
c7afc7b to
e5d659a
Compare
|
Looks good on Android side |
e5d659a to
87b1da7
Compare
We can revisit this in another pull request. Any particular reason for doing so? We don't actually use these enums anywhere (except as a hint for compressing responses), so we could do away with them as well? |
I would like to avoid interface churn for node-mbgl or whatever the downstream consumer that implements the FileSource interface in node is nowadays. Maybe we can avoid updating it until the FileSource interface is finalized? |
|
^ This concern will eventually be irrelevant, as the pluggable |
- Document Node.js v0.12.x and io.js support - Document map.release functionality. - Add notes on garbage collection and request handling. - Update binary platforms and build instructions. - Document API token FileSource implementation from mapbox/mapbox-gl-native#1607
- Document Node.js v0.12.x and io.js support - Document map.release functionality. - Add notes on garbage collection and request handling. - Update binary platforms and build instructions. - Document API token FileSource implementation from mapbox/mapbox-gl-native#1607 - Update Kind enum values.
- Document Node.js v0.12.x and io.js support - Document map.release functionality. - Add notes on garbage collection and request handling. - Update binary platforms and build instructions. - Document API token FileSource implementation from mapbox/mapbox-gl-native#1607 - Update Kind enum values.
-> #3374 |
This moves
Map::setAccessTokentoDefaultFileSource::setAccessTokenand passesmapbox://URLs through theFileSourceinterface. No change to the iOS or Android SDK public API. The node bindings will need the following changes (cc @mikemorris):kindenum.FileSourceimplementations need to handlemapbox://URLs.setAccessTokenfromMapinterface. node-mapbox-gl-native itself no longer needs to concern itself with access tokens. This is a task forFileSourceimplementations now.Before merging this I'm planning to make another change to the interface, removing the
kindenum in favor of specificFileSourcemethods likerequestStyle,requestTile, etc.