-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[iOS] Clickable annotation image area to select annotation #3880
Comments
This insets the bottom edge of the image by 60 pixels. If your image is 120 pixels tall, that would indeed exclude the bottom half of the image from the alignment rect. However, what you’re observing sounds like the five-pixel slop area we place on all sides of the alignment rect, since taps can be quite imprecise. (In the OS X SDK, by contrast, we do exact hit-testing on the visible portion of the image, because mouse clicks are far more precise.) We’re definitely open to ideas about how to respect the alignment rect more literally while allowing for imprecise taps. |
After filtering out elements of a vector using std::remove_if(), it’s apparently necessary to resize the vector. Otherwise, removing only has the effect of shifting the non-matching items to the end of the vector. This change reduces the annotation tap target back to almost what it was before #3261, except that these days the target is centered around the annotation image rather than the center point. There remains a much smaller slop area around the annotation, but nothing close to the effective padding before this change. Fixes #3880.
That’s correct, although if #3885 turns out to be the right solution for the Android SDK, we could easily port it over to the iOS SDK.
You’re right in expecting that to work. There is a bug in how we’re hit-testing annotations that you’re probably running into: #3898. |
Fixed in #3898, which will be in 3.1.1, to be released shortly. |
Hi, at some point in v.3.1.0 there was a change:
"Tapping now selects annotations more reliably. Tapping near the top of a large annotation image now selects that annotation. An annotation image’s alignment insets influence how far away the user can tap and still select the annotation."
According to above I try to change annotation image alignment rect like this:
but I did not notice any changes in clickable area which is too big in my case, I have to reduce clickable area to half of the annotation image.
I can add that dequeue method:
returns me annotations image with correct alignment rect: (0, 0, 60.0, 0)
Maybe I'm doing something wrong or misunderstand something... Can you show me an example how to set annotation image's alignment rect or what I'm doing wrong? Thanks!
("annotation image" I mean property "image" in MGLAnnotationImage)
The text was updated successfully, but these errors were encountered: