Skip to content
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

Unable to get custom TMS map background (Strava heatmap) to work #7070

Closed
kylebarron opened this issue Nov 26, 2019 · 5 comments
Closed

Unable to get custom TMS map background (Strava heatmap) to work #7070

kylebarron opened this issue Nov 26, 2019 · 5 comments
Assignees
Labels
bug A bug - let's fix this!
Milestone

Comments

@kylebarron
Copy link

After seeing that OSM is allowed to trace from Strava Heatmap data, I've been trying to set up those tiles as a custom layer in iD. The URL works when setting {z}/{x}/{y}, but nothing is displayed with {z}/{x}/{-y} or {z}/{x}/{ty}.

Example:

Set to {z}/{x}/{y}:
image

Bing map:
image

Set to {z}/{x}/{-y} or {z}/{x}/{ty}:
image

To reproduce:

To use the high-res authenticated heatmap tiles, I'm following these instructions.

https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/run/bluered/{zoom}/{x}/{y}.png?Key-Pair-Id=.....&Policy=.....&Signature=.....

with OAuth values of mine pasted in that I found from my logged-in Strava cookies.

The same URL works in JOSM set to TMS style.

@quincylvania
Copy link
Collaborator

quincylvania commented Dec 2, 2019

@kylebarron Hmm this is a weird problem that appears to have something to do with offsets. This is the heatmap at Strava's site:

Screen Shot 2019-12-02 at 11 15 53 AM

And as a custom layer in iD at the same zoom level and approximately the same position:

Screen Shot 2019-12-02 at 11 16 01 AM

It's fetching and displaying the tiles at the wrong zoom level. I think #6198 could address this. I'm not sure how tools like JOSM account for this automatically.

@quincylvania quincylvania added the bug A bug - let's fix this! label Dec 2, 2019
@bhousel
Copy link
Member

bhousel commented Dec 2, 2019

It's fetching and displaying the tiles at the wrong zoom level.

Some tiled sources use 512px tiles - maybe it just needs a workaround this? (This update-imagery script checks the things we get from editor-layer-index and makes a few adjustments).

iD/data/update_imagery.js

Lines 96 to 102 in 7a55769

// supports 512px tiles
if (source.id === 'Mapbox') {
im.template = im.template.replace('.jpg', '@2x.jpg');
im.tileSize = 512;
} else if (source.id === 'mtbmap-no') {
im.tileSize = 512;
}

(Though I guess the 512px tile size doesn't work in custom imagery, which is what this issue is about..)

@quincylvania
Copy link
Collaborator

Some tiled sources use 512px tiles - maybe it just needs a workaround this?

Oh okay it's definitely this. I tried hardcoding the tile size to 512 and the layer displayed correctly.

Seems like we might need some UI to set the size.

@quincylvania quincylvania self-assigned this Dec 2, 2019
@quincylvania quincylvania added this to the 2.16.1 milestone Dec 2, 2019
@kylebarron
Copy link
Author

kylebarron commented Dec 2, 2019

Awesome, thanks! How long does it usually take for updates to make it to production?

@quincylvania
Copy link
Collaborator

@kylebarron We usually do a release per month or so. We're due for one, so maybe this week or next!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

No branches or pull requests

3 participants