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

Fix poor queryFeatures precision on large viewports #2279

Closed
mycoboco opened this issue Mar 17, 2016 · 9 comments · Fixed by #2292
Closed

Fix poor queryFeatures precision on large viewports #2279

mycoboco opened this issue Mar 17, 2016 · 9 comments · Fixed by #2292
Labels

Comments

@mycoboco
Copy link

v0.15.0:

Steps to Trigger Behavior

  1. Open the "Display a popup on click" example with Safari on iMac 5k
  2. Enlarge the Safari window enough to cover the full screen
  3. Try to click one of makers on the map

Expected Behavior

Can click the marker and a related pop-up shows

Actual Behavior

Cannot click markers. Actually the clickable position drifts from the marker as the screen size grows.

capture

@lucaswoj
Copy link
Contributor

This is probably due to some floating point error at high zoom levels on a large display, perhaps related to #1733.

@lucaswoj lucaswoj changed the title Cannot click a marker when a map is displayed as full screen on iMac's Safari featuresAt's precision drifts on large viewports Mar 18, 2016
@mourner
Copy link
Member

mourner commented Mar 18, 2016

Let's just change GeoJSONSource maxzoom default to 18. 14 is too low.

@mourner
Copy link
Member

mourner commented Mar 18, 2016

Should be fixed in master, can you confirm?

@mycoboco
Copy link
Author

Unfortunately, still have the same problem with the master branch.

@mourner mourner reopened this Mar 21, 2016
@mourner
Copy link
Member

mourner commented Mar 21, 2016

@mycoboco can you also try the branch here (it has a slightly different API though)? #2224

@mycoboco
Copy link
Author

@mourner sorry for late response. I failed to build the branch with npm install (no problem with the master one). Can you give me a hint for that?

npm ERR! No compatible version found: prova@^2.1.2
npm ERR! Valid install targets:
npm ERR! 0.0.1-security

@ansis
Copy link
Contributor

ansis commented Mar 25, 2016

@mycoboco thanks for trying. The changes have now been merged into master and released as part of v0.16.0. Instructions for migrating from featuresAt to queryRenderedFeatures can be found here: https://github.com/mapbox/mapbox-gl-js/blob/master/CHANGELOG.md#breaking-changes

@mycoboco
Copy link
Author

@ansis thanks for the information.

I successfully built v0.16.0 and tested again; replaced featuresAt with queryRenderedFeatrues and console.log-ed its return value to see if the clickable position worked correctly. Sadly, the problem still exists.

When making Safari use the whole screen, the map displayed is distorted and I get the same result when I use Chrome with setting my iMac to use denser screen (that is, to have higher resolutions).

@lucaswoj lucaswoj removed the on deck label Jun 1, 2016
@lucaswoj lucaswoj changed the title featuresAt's precision drifts on large viewports Fix poor queryFeatures precision on large viewports Jul 29, 2016
@jfirebaugh
Copy link
Contributor

#5639

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

Successfully merging a pull request may close this issue.

5 participants