-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMapView moves custom MGLCalloutView, ignoring custom frame #7483
Comments
Thank you for your report. If you want the behavior of beta 5 but with |
@frederoni the solution you have suggested does not work, as callout gets misplaced by the SDK before it gets dismissed by the client request. I implemented the following code:
Please review the video of the result. |
(Noting that this regression was introduced in #6676.) |
We’re repositioning the callout view by setting its We should add a new optional method to MGLCalloutView, (Incidentally, we should formalize the requirement that MGLCalloutView is a UIView: #7523.) |
The following method says the opposite:
So, SDK requires positioning code to be implemented on the client side. |
The protocol is a bit awkward, since #3322 took the shortest possible path to extracting SMCalloutView method calls into a protocol. We’ve been planning to completely revamp this API in #4392, but until then, I’m open to just about anything that works for both the built-in MGLCompactCalloutView and use cases like yours, since anything more sophisticated probably has to implement a custom callout view as something other than MGLCalloutView anyways. I’m not entirely clear to me how the default behavior of “centering the callout” would lead to behavior similar to what’s in StayMapCallout, though. |
@1ec5 Currently the very issue is that SDK moves the callout before the client has a chance to dismiss it itself. So, my suggestion is to make |
Fixed in #7646 on the release-ios-v3.4.0 branch. We’ll issue a prerelease with this fix shortly for you to try out. |
Platform: iOS
Mapbox SDK version: ios-v3.4.0-beta.5
Steps to trigger behavior
MGLCalloutView
protocol.-[MGLCalloutView presentWithContentSize:representedFromRect:inView:constrainedToView:animated:]
and make your custom layout logic in there.Expected behavior
Custom frame set to the callout should remain persistent within the superview the callout was added to.
Actual behavior
SDK moves the custom callout based on its own undefined rules.
Regression
Issue is not reproducible in ios-v3.4.0-beta.4
Please review the test application attached.
Read "readme.txt" for details on how to run the test application.
TestMapbox.zip
The text was updated successfully, but these errors were encountered: