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

querySourceFeatures returns invalid feature coordinates on high zoom levels #3722

Closed
data-ux opened this issue Nov 30, 2016 · 10 comments
Closed
Assignees
Labels

Comments

@data-ux
Copy link

data-ux commented Nov 30, 2016

If the map zoom level > 16 the features returned from map.querySourceFeatures have invalid geometry coordinates (negative or otherwise nonsense).

https://jsbin.com/sesafumovi/edit?html,console,output

Can be reproduced on current master branch.

@mourner
Copy link
Member

mourner commented Dec 1, 2016

This is probably yet another consequence of #2868. I'm in process of refactoring this, after which it'll probably become clear how to fix this.

@mourner mourner self-assigned this Dec 1, 2016
@data-ux
Copy link
Author

data-ux commented Jan 12, 2017

@mourner Would you have any ideas about workarounds until the issue is fixed?

@jasonpepper
Copy link
Contributor

It appears to happen at any zoom level higher than the max zoom level of my tileset. If that is the case, a workaround might be to create tiles for the higher zoom levels.

@bdon
Copy link

bdon commented Jul 23, 2017

@data-ux change mentioned by @drewbo in #2868 (swapping z and actualZ) is a valid workaround for me

@jasonpepper
Copy link
Contributor

jasonpepper commented Jul 25, 2017

@bdon Thanks! That change seems to fix my test case.

@cyrilchapon
Copy link

cyrilchapon commented Sep 8, 2017

Any update / workaround on this ? I don't get the z thing, since only x and y are concerned. Am I missing something ?

Plus, I'm having this issue with a vector mapbox style layer

@marisbest2
Copy link

Any update on this? I'm having this problem as well with a mapbox style layer

@jasonpepper
Copy link
Contributor

I would love to see a fix for this.

@ralphking
Copy link

@bdon Your tweak seems to work for me as well

@cyrilchapon Open dist (or whichever gl-js file you are looking at) and swap the two values in the ternary operator:

], this.reparseOverscaled ? actualZ : z).sort(function(a, b) {

Hint if you're looking at a minified source, search for i,n,t.reparseOverscaled?o:i, and swap the o and i around

@ralphking
Copy link

This is still not fixed on 0.51.0 - it's better, but if you keep zooming in the heat map will disappear. The only fix so far was the one from above, however the code has changed so much since it's no longer an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants