-
Notifications
You must be signed in to change notification settings - Fork 1.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
use a tilemap for esri imagery instead of tacking on blankTile=false #5029
Conversation
|
||
// make the request and introspect the response from the tilemap server | ||
fetch(tilemapUrl) | ||
.then(response => response.json()) |
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.
a bit of error handling might be good here... (url unavailable, cannot parse result, etc.)
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.
The bigger issue here is that we'll have to polyfill fetch / promises for IE11..
(But we need to do this anyway for D3 v5 / #4929)
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 don't have my heart set on using fetch
, i just didn't know what you were using for generic requests to a CORS enabled web servers.
i've pushed up another commit which uses d3_json
and aborts if an error is encountered. at this point i could use a hand triggering the function when editing is initially activated instead of waiting until the metadata context menu is opened.
Cool! Thanks @jgravois - what is missing from this now? It probably would work if you switch the |
@@ -312,6 +307,9 @@ rendererBackgroundSource.Esri = function(data) { | |||
|
|||
if (inflight[tileId]) return; | |||
|
|||
// instead of calling fetchTilemap when the metadata window is open, we should call it when editing is first activated | |||
fetchTilemap(center, esri); |
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.
switch the
const/let
back to old-schoolvar
👍
what is missing from this now?
right now fetchTilemap()
is only called when the background metadata window is opened w/ ⌘ + Shift + B.
i'm not sure how/where, but the method needs to be called as soon as users cross the zoom threshold to put iD
into 'edit mode' (when Esri imagery is being used in the background anyway).
this is ready for review. |
Thanks @jgravois! I tried this out and ran into a few issues:
I also get a eslint warning around this code Would it make more sense to calculate
|
thanks for taking the time to check this out @bhousel! you were definitely on the right track with the eslint warning. i made a silly mistake when i removed my template literal to please uglify after i finishing my own testing.
|
Looks better now @jgravois - should there be code that puts the max zoom back to a higher number if the tileMap supports it? AFAICT it will just stay at [0,19] forever if it gets a negative result from the tilemap query.. |
my thought was that once a user is zoomed in tight enough to trigger a tilemap request and encounters missing tiles it'd be appropriate to downsample from there on out. that said, I didn't really consider the scenario where they zoom back out beyond 16 and move somewhere entirely different. I'm AFK for a couple days but happy to take another look when I get back. |
Hmmm - I tested this by accident today by opening the iD walkthrough, which uses the Esri Clarity layer around Three Rivers MI, and it put the maxZoom to 19. I'll see if I can find a way to have iD check the tilemap sometimes. |
I merged this 🎉 |
awesome @bhousel. thank you 👏! |
greetings! 👋
currently OSM editors are requesting roughly 35 million Esri imagery tiles a month 🎉 and making roughly the same number of requests for tiles that don't exist 🚫.
this PR still needs work, but it introduces support for the 'tilemap' option i described in #4327 (comment)
the gist of it is that we can take advantage of a service that indicates whether or not tiles exist in a particular area of interest.
by asking whether tiles are present at zoom level 20 in the current extent of the map as soon as the edit session is instantiated, we'd forgo a lot of unnecessary requests for tiles.