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

featuresAt offset #1274

Closed
anandthakker opened this issue Jun 15, 2015 · 12 comments
Closed

featuresAt offset #1274

anandthakker opened this issue Jun 15, 2015 · 12 comments

Comments

@anandthakker
Copy link
Contributor

featuresAt is somehow offset from rendered symbol locations:
mgl-featuresat-bug

Using map.featuresAt(e.point, {radius: 10}, ...), where e is the mousemove event.

@jfirebaugh jfirebaugh added this to the 0.8 milestone Jun 15, 2015
@ansis
Copy link
Contributor

ansis commented Jun 15, 2015

If you look closely while zooming it looks like the icons aren't centered around their data point. Does the style use icon-translate or icon-offset to move the rendered icon?

@peterqliu
Copy link
Contributor

@anandthakker you can also visualize the bounds of each symbol via map.collisionDebug=true, to see if you're within the area

@anandthakker
Copy link
Contributor Author

@ansis Nope, neither of those properties is set in the style. I'll check @peterqliu's debug thing out and post if I find anything.

@jfirebaugh jfirebaugh removed this from the 0.8 milestone Jun 15, 2015
@anandthakker
Copy link
Contributor Author

@ansis @peterqliu Here's what I see with that collisionDebug setting on:
offset

@anandthakker
Copy link
Contributor Author

@ansis looked at this with me a few days back, and I think determined the issue is that dot.sdf sprite is not centered in its box. I'd be happy to submit a fix to this, but I know absolutely nothing about how the sprites are built/parsed, so I'd need a nudge in the right direction...

@ansis
Copy link
Contributor

ansis commented Jun 30, 2015

Is there an offset on non-retina screens?

hmm, the sprite looks ok. The sdf dot in the 2x sprite has "pixelRatio": 1. I think SpriteAtlas doesn't properly handle icons with a pixel ratio of 1 in a 2x atlas.

I think #1124 would fix it, but it might be easier to just make a sprite with a 2x dot.

@jfirebaugh
Copy link
Contributor

@anandthakker Was this fixed by one of the extend or featuresAt related changes?

@anandthakker
Copy link
Contributor Author

@jfirebaugh sorry, haven't been in this project recently. I'll bump it to a more recent version and let you know soon

@anandthakker
Copy link
Contributor Author

@ansis @jfirebaugh Still happening on 0.11.2, but only on retina screens.

@ansis
Copy link
Contributor

ansis commented Mar 24, 2016

I think this could be fixed by #1919 and/or #2224. Can you still reproduce this with v0.16.0?

@anandthakker
Copy link
Contributor Author

@ansis In the project where I was reproducing this, I changed the icons to circle, so I don't have an immediate test case.

@ansis
Copy link
Contributor

ansis commented Mar 24, 2016

Alright, thanks. I haven't offsets anywhere else so I'll close this for now.

@ansis ansis closed this as completed Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants