-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Canonicalize tile url #7594
Canonicalize tile url #7594
Conversation
Here are the benchmark results. I didn't notice anything unusual, and really wouldn't expect to since the benchmarks don't actually request many tiles.
![screencapture-localhost-9966-bench-versions-2018-11-15-16_30_01](https://user-images.githubusercontent.com/2425307/48590304-34339b00-e8fc-11e8-80f3-e145b5fd2881.png)
|
for (let i = 0; i < params.length; i++) { | ||
if (params[i].indexOf('access_token=tk.') === 0) { | ||
params[i] = `access_token=${config.ACCESS_TOKEN || ''}`; | ||
export const canonicalizeTileURL = function(url: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be an arrow function I think. Same in line 135.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following convention here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I thought maybe that was the case. Good to know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think the convention is export function fn(...)
, not export const fn = function(...)
. So this looks like a pre-existing omission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was following convention of the functions in this file – do you want me to change all of them ?
close #7400
This PR does a couple 🆕 things to improve parity between gl-native and gl-js:
config.API_URL
mapbox://
url, like the rest of the assets requested by the librarythis is technically changing existing behavior, but it shouldn't be breaking, unless a user was creating their own TileJSON endpoint to respond with an object where the
tiles
urls were from a different domain than the TileJSON/other assets 😬 🙏 So I guess it maybe technically is breaking?Also, as far as I know the reason for providing multiple urls like
a.tiles.mapbox.com
,b.tiles.mapbox.com
was to workaround the max open connections the browser will allow for any given origin for HTTP 1.0. When profiling locally on a large monitor, I do notice that some tiles requests are queued briefly (~10-50ms) when many tiles are being requested at once, but I'm not noticing a real big in time to first render (TTFR) or zoom/pan performance. @kkaefer any thoughts on how we should verify this?Launch Checklist