Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Inconsistent coordinate at different zoom level for the same feature #8992

Closed
always-beta opened this issue May 14, 2017 · 2 comments
Closed
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@always-beta
Copy link

Platform: iOS
Mapbox SDK version: 3.5.4

Steps to trigger behavior

  1. Set to a smaller zoom 10, use visibleFeaturesInRect to extract a certain MGLFeature, check the coordinate.
  2. Set to a bigger zoom 20, use visibleFeaturesInRect to extract the same MGLFeature with step 1, check the coordinate.
  3. Compare the coordinate

Expected behavior

Coordinates should be the same

Actual behavior

Coordinates are slightly different

The problem I have is that when the user clicks a feature at small zoom, I add an annotation view which exactly matches the feature's view, and zoom in to 20, the annotation view now has a slight offset from the feature itself.

Coordinate at zoom 13:

zoom 13

Coordinate at zoom 20:
zoom 20

The offset caused:

screen shot 2017-05-14 at 2 08 26 pm

@boundsj boundsj added iOS Mapbox Maps SDK for iOS bug labels May 15, 2017
@fabian-guerra fabian-guerra added this to the ios-v3.6.0 milestone May 15, 2017
@fabian-guerra
Copy link
Contributor

I'm working on a new implementation for the coordinate property. Need to test if this is fixed as a result of #8713

@jfirebaugh
Copy link
Contributor

This is expected behavior. To minimize their size, vector tiles use a quantized coordinate system that's precise enough for rendering a tile at the zoom level it's intended for, but not necessarily precise enough for higher zooms.

To place the MGLFeature precisely at all zoom levels, you should call visibleFeaturesInRect in response to zoom changes, and update the coordinate to match the response.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

4 participants