-
Notifications
You must be signed in to change notification settings - Fork 2.4k
map-specific access token #8364
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
651b80d
add map-specific token functionality
peterqliu f8278c9
add debug
peterqliu 975f6c7
test failing condition
peterqliu 1fa961f
documentation
peterqliu 3474c64
lint
peterqliu 994c002
stow custom access token in config
peterqliu 5679b9b
lint
peterqliu 0ddd9cd
wrap
peterqliu 0bbffb3
stow local token in requestmanager
peterqliu aa2894a
simplify custom token passing
peterqliu d89c2be
flow typing
peterqliu d9f3480
alter conditional to account for no global token
peterqliu d974a32
lint
peterqliu 5f6e04f
fix lint
peterqliu 861ce4a
wrap
peterqliu 975bfc3
restore conditional
peterqliu e857be0
pass lint
peterqliu 6720934
Merge branch 'master' of https://github.com/mapbox/mapbox-gl-js into …
peterqliu 3332331
custom tokens in attribution
peterqliu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Mapbox GL JS debug page</title> | ||
| <meta charset='utf-8'> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
| <link rel='stylesheet' href='/dist/mapbox-gl.css' /> | ||
| <style> | ||
| body { margin: 0; padding: 0; } | ||
| html, body, #map { height: 100%; } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id='map'></div> | ||
| <div id='hidden' style='display:none'></div> | ||
| <script src='/dist/mapbox-gl-dev.js'></script> | ||
| <script src='/debug/access_token_generated.js'></script> | ||
| <script> | ||
|
|
||
| // 1) first map should work with its valid local accessToken, despite the bad global mapboxgl token | ||
| // 2) first map should keep working properly, despite the bad token in the second map | ||
|
|
||
| var mapToken = mapboxgl.accessToken; | ||
| mapboxgl.accessToken = 'notAToken'; | ||
|
|
||
| var map = window.map = new mapboxgl.Map({ | ||
| container: 'map', | ||
| zoom: 12.5, | ||
| center: [-77.01866, 38.888], | ||
| style: 'mapbox://styles/mapbox/streets-v10', | ||
| hash: true, | ||
| accessToken: mapToken | ||
| }); | ||
|
|
||
| // var map2 = new mapboxgl.Map({ | ||
| // container: 'hidden', | ||
| // zoom: 12.5, | ||
| // center: [-77.01866, 38.888], | ||
| // style: 'mapbox://styles/mapbox/dark-v10', | ||
| // hash: true, | ||
| // accessToken: 'anotherBadToken' | ||
| // }); | ||
|
|
||
| </script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.