DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Handle taps on sublayers of RMMapLayer

Open kintel opened this issue 12 years ago • 4 comments

I'll describe by example:

o I want an RMMapLayer which contains a rotated CGImage o Since mapbox modifies layer.transform manually (because of screen rotation), I put my CGImage in a sublayer (CALayer) and leave the RMMapLayer.contents empty o Now, when a tap is detected on my sublayer, mapbox doesn't see this.

The code handling this is in RMMapView.handleSingleTap:

To detect a tap on an annotation, the actual sublayer needs to be an RMapLayer, and be associated directly with an annotation. I guess I can hack this to work, but would it be possible to e.g. search all sublayers up to _overlayView, and return a tap on the first one found which is an RMMapLayer?

I assume the actual issue is slightly more general than my specific use-case. Any information/ideas would be helpful :)

kintel avatar Feb 13 '13 17:02 kintel

It sounds like this could also clear up some of the code around detecting marker label taps as well, since those work up the hierarchy to find the parent RMMapLayer. Could just be an iteration that keeps looking at superlayer until it succeeds or hits _overlayView, as you say.

I would hack this in yourself for now, as I'm nearing a release and don't want to change this at present. But I agree it's a good way to go.

incanus avatar Feb 13 '13 18:02 incanus

Thanks for the quick response. I'll work around it for now.

kintel avatar Feb 13 '13 19:02 kintel

Is this still open?

albertschulz avatar Dec 11 '14 13:12 albertschulz

Yes, haven't focused on this as it's somewhat of an edge case.

incanus avatar Dec 11 '14 14:12 incanus