hungio / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

Cutsom labels on markers do not properly receive touches when the supplied view contains subviews #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  In the simple map view example, in [MapViewViewController.m
viewDidLoad], create a view and add some subviews to it (labels,
imageViews, whatever).
2.Replace the following line: "[marker setTextLabel:@"Hello"];" with "
"[marker setLabel:<name of your new view>];"
3.Run the application
4.You should see your new view appear in place of the "Hello" text label.
5.Tap the new view

What is the expected output? What do you see instead?

The console log should register that you tapped the label for the marker,
in other words, [RMMapViewDelegate tapOnLabelForMarker: onMap:] is called.
 If the tap occurs on one of the subviews, [RMMapViewDelegate
singleTapOnMap: At: ] is called instead.

What version of the product are you using? On what operating system?
SVN revision 237.  

Please provide any additional information below.

I have managed to workaround the problem but editing the code in
RMMapView.m to check beyond the first superlayer to determine if the layer
tapped is a sublayer of an RMMarker.  Since a subview of the mapview was
tapped, the chain of superlayers must be checked until an RMMarker is
found, or until a superlayer in nil.

See attached for an implementation in 
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
starting at line 426

Original issue reported on code.google.com by pzearf...@gmail.com on 6 Mar 2009 at 7:36

Attachments:

GoogleCodeExporter commented 8 years ago
if ([iter isMemberOfClass:[RMMarker class]]) should use isKindOfClass.

Also, this (i think) is being covered in the issue59 branch.  And, if not, 
should be
a part of that series of fixes.

Original comment by Quazie on 6 Mar 2009 at 8:10

GoogleCodeExporter commented 8 years ago
Thanks, I see that issue now.  Having the markers be views with subviews would 
solve
this issue completely.

Original comment by pzearf...@gmail.com on 6 Mar 2009 at 8:23

GoogleCodeExporter commented 8 years ago
Try r258 and see if the error is still there.

Original comment by halmuel...@gmail.com on 6 Mar 2009 at 9:03

GoogleCodeExporter commented 8 years ago
At r263, seems to not be fixed?  Dunno.  I'll keep using my modification for 
now,
though I'm sure I can't be the only person clamoring for this kind of 
functionality.

Original comment by pzearf...@gmail.com on 9 Mar 2009 at 1:57

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm reluctant to commit this change to the trunk because of the major rewrite 
of marker handling underway in 
the issue59 branch. Am willing to be overruled on this if someone else has the 
time to test it and verify there are 
no performance hits or other bad results. I'll leave it marked Accepted, but 
the true fix for this will come from 
issue 59.

Original comment by halmuel...@gmail.com on 9 Mar 2009 at 9:25

GoogleCodeExporter commented 8 years ago
Oh yeah; that's what the Duplicate field is for!

Original comment by halmuel...@gmail.com on 9 Mar 2009 at 9:26