MapViewPlus
MapViewPlus copied to clipboard
Annotation place and touch problem
When annotation is near the edges, calloutView half of part shows out of map
and another problem, when tapping the button on calloutView, annotation under view is clicked
For the first one, can you please give some more details? I can't reproduce. It works fine for me.
The second one, should be ok after you increase width and height of your button.
When touching inside of annotation, annotation closing.Also i tested some users.I think calloutView should be closed touching outside of annotation.
I fixed first problem, my map is not large enough for calloutView. There is no problem with smaller calloutView
When touching inside of annotation, annotation closing.Also i tested some users.I think calloutView should be closed touching outside of annotation.
Can you please tell about it more? I couldn't understand the problem.
I concur with codaman. The problem is that callout is dismissed when tapped on, but outside of an active control such as UIButton. A hacky solution is to add an empty interceptor button above all non-control subviews and below all control ones (buttons) of your custom callow. However, a better solution would be to override hitTest or something in CalloutAndAnchorView or CalloutViewPlus to prevent the dismissals. Check out "Adding Interactivity to our Custom Callout" at https://digitalleaves.com/blog/2016/12/building-the-perfect-ios-map-ii-completely-custom-annotation-views/
Overriding hitTest is already being done, thus the buttons inside callout view are responding to touch events. It can be improved to include MKAnnotationView type in one of the future versions.