-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cannot select annotations that lie on a tile boundary #12472
Comments
Hi @jadar thanks for the report! Is there any chance you could post some example code reproducing the problem? What you're describing is a class of bug we've had before, and we believe we've fixed. There may be some subtle difference in how you're exercising the functionality that still causes the problem to manifest. |
@ChrisLoer Here is a bare-bones implementation that reproduces the bug. If you zoom in to where the scale shows ~100ft, it won't show a callout. If you zoom out to where the scale shows ~600 ft, the callout shows. |
Hi @jadar I'm sorry but I'm still not seeing the problem. Here's what I see when I tap on the annotation created with your code pasted into my example app (I moved the location to null island i.e. [0,0] just to be sure it was on a tile boundary, but I couldn't reproduce with your original coordinates either): |
Hmm, I can't seem to reproduce it at [0,0] either. When I use the coordinates I gave, it works up until zoom level 16. 15 and below work correctly. I don't know if it changes anything, but I'm using this style, and the 4.2.0 version of Mapbox. |
It also seems that with [0.000000000000001, 0.00000000000001], it doesn't work at any zoom level. |
Got it, thanks! I can reproduce now at [0.000000000000001, 0.00000000000001]. I'll take a closer look tomorrow and hopefully get to the bottom of it. |
This is a good bug! 😅 The problem is that when the mapbox-gl-native/src/mbgl/annotation/annotation_manager.cpp Lines 142 to 147 in 8400355
However, it then translates into tile coordinates: mapbox-gl-native/src/mbgl/annotation/symbol_annotation_impl.cpp Lines 18 to 21 in 8400355
I haven't actually traced the problem from here all the way back to the @mourner, do you have any ideas about how we should fix this? The quick and dirty fix would be to just build a little tolerance into |
@ChrisLoer yeah, it might make sense to use a global integer coordinates system based on web mercator. Uint32 only allows for values up to z19 |
Fixes issue #12472. This commit doesn't address the underlying issues that come from symbolAnnotationTree using a slightly lower precision coordinate system than the annotations themselves. Instead, it just puts a small padding around each tile when it queries for tile data, so that symbols right at the tile boundary will be included in both tiles. The rendering/querying code will take care of only displaying one instance. The padding is in global coordinates, so at higher zoom the padding will be larger in tile units -- this is consistent with precision loss also being greater at higher zoom.
Fixes issue #12472. This commit doesn't address the underlying issues that come from symbolAnnotationTree using a slightly lower precision coordinate system than the annotations themselves. Instead, it just puts a small padding around each tile when it queries for tile data, so that symbols right at the tile boundary will be included in both tiles. The rendering/querying code will take care of only displaying one instance. The padding is in global coordinates, so at higher zoom the padding will be larger in tile units -- this is consistent with precision loss also being greater at higher zoom.
Fixes issue #12472. This commit doesn't address the underlying issues that come from symbolAnnotationTree using a slightly lower precision coordinate system than the annotations themselves. Instead, it just puts a small padding around each tile when it queries for tile data, so that symbols right at the tile boundary will be included in both tiles. The rendering/querying code will take care of only displaying one instance. The padding is in global coordinates, so at higher zoom the padding will be larger in tile units -- this is consistent with precision loss also being greater at higher zoom.
Fixes issue #12472. This commit doesn't address the underlying issues that come from symbolAnnotationTree using a slightly lower precision coordinate system than the annotations themselves. Instead, it just puts a small padding around each tile when it queries for tile data, so that symbols right at the tile boundary will be included in both tiles. The rendering/querying code will take care of only displaying one instance. The padding is in global coordinates, so at higher zoom the padding will be larger in tile units -- this is consistent with precision loss also being greater at higher zoom.
Fixed in #12570. |
We have a bug where we're not able to select/tap some of our annotations on the map in our iOS app. After some head scratching, we found out that the annotation just happened to lie on a tile boundary! Stepping through the Mapbox code, it appears that
annotationTagsInRect:
, (called inannotationTagAtPoint:persistingResults:
,) returns astd::vector
of size 0 when there is clearly an annotation within the rect, except the annotation lies between a few tiles.Steps to reproduce
Expected behavior
The annotation is detected and the relevant delegate methods are called.
Actual behavior
No delegate methods are called.
While the screenshot says "THIS WILL WORK", it actually means it won't work.
Configuration
Mapbox SDK versions: 4.2.0
iOS/macOS versions: iOS 11.4
Device/simulator models: iPhone 8 and iPhone X
Xcode version: Xcode 9.4.1
The text was updated successfully, but these errors were encountered: