MapViewPlus icon indicating copy to clipboard operation
MapViewPlus copied to clipboard

Annotation place and touch problem

Open codaman opened this issue 7 years ago • 5 comments
trafficstars

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

codaman avatar Oct 15 '18 11:10 codaman

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.

okhanokbay avatar Oct 16 '18 21:10 okhanokbay

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

codaman avatar Oct 17 '18 11:10 codaman

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.

okhanokbay avatar Oct 18 '18 21:10 okhanokbay

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/

yperbasis avatar Oct 24 '18 19:10 yperbasis

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.

okhanokbay avatar Oct 25 '18 22:10 okhanokbay