-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[iOS] Compass does not receive touch events if its frame changes #3099
Comments
@mappy-mobile |
@tobrun oh sorry I forgot to specify it's related to the iOS lib. I'm adding a label. edit: I can't, would you do it please ? |
I don’t see anything that explicitly favors the compass tap gesture recognizer over the single tap gesture recognizer. On top of that, the compass tap recognizer should be attached to the compass view, not its container. An argument in favor of #1830 perhaps. |
We saw problems with this before related to a) constraints updating properly and b) taps on container vs. compass image as @1ec5 states. Also possibly related to clipping settings for the container view. |
It’s unlikely to be an issue with the constraints updating, though, because (unless I’m missing something) the compass still appears in the right place. |
Yes I'm using explicit values to change the frame of the compass view, my point was only about tap events registered in the wrong bounds. |
OK, that explains it. MGLMapView intercepts tap events on the compass view's invisible container view with a gesture recognizer. I think #1830 is the way to go here; we just need to make the button trigger the action on touch down rather than touch up inside. |
Hi, What happened here is that the container is constrained by layout constraints. Our developer moved the compassView itself by modifying its frame. So yes, the container did not move, as the tap recognizer. And the compassView moved away. If a view is constrained by layout constraints, modifying its frame is forbidden. One idea might be to add an API entry to set the compassView center position in the SDK. Romain |
The reason the compass has a container is due to jitter and performance with constraints directly against it, holding to the right and the top layout guide, while rotating. We hit this problem back in the raster SDK days (as well as this tap issue) and having a container solved this. See mapbox/DEPRECATED-mapbox-ios-sdk#315 for backstory. |
Hi, I can take care of that in a pull request if you want. |
Any progress on this issue? @RomainQuidet were you able to fix this issue? |
This was fixed in #3099, which is in 3.0.0. |
Oh never mind, I missed @RomainQuidet's comment above. |
Hi, |
incidentally - for people coming here looking how to reposition compass - |
I still have problem with compassView doesn't intercept touch event by changing its position |
If the user of the iOS framework changes the frame of the compass view (e.g. if part of the map is covered by UI elements) , the end user cannot tap on the compass to reset the north position.
The touch zone is still the default compass view position.
expected : update touch zone when changing compass view frame.
The text was updated successfully, but these errors were encountered: