new patch for more map delegation (afterMapDecelerated, pinch, moveLatLng)

22 views
Skip to first unread message

Michael Hill

unread,
Feb 25, 2009, 1:30:11 PM2/25/09
to route-...@googlegroups.com
AfterMapMove was firing way too often for my needs. I wanted better delegation for when to load my markers from my web service, so I have patched RMMapView.m and RMMapViewDelegate.h to allow for more precise delegation with the map events (in particular with map is finished decelerating).

So instead of just checking for map move then using a timer to see when it stops, now I know -exactly- when the following things happen with the map:

- (void) afterMapDecelerated: (RMMapView*) map
{
    NSLog(@"AFTER MAP DECELARETED!");
}

- (void) afterMapMoveLatLng: (CLLocationCoordinate2D) coord
{
    NSLog(@"AFTER MAP LAT/LNG!");
}

- (void) afterMapPinch:(RMMapView*)map
{
    NSLog(@"AFTER MAP PINCHED");
}

can you guys check it out and let me know.  I havent tested this thoroughly with deceleration turned off.

-mike
more_delegates_patch.patch

Matt Farnell

unread,
Feb 25, 2009, 4:13:22 PM2/25/09
to route-...@googlegroups.com
I'm testing this patch now, afterMapPinch only gets called if you remove both fingers at exactly the same time, if you lift one finger slightly before the other one it wont fire. I found with my 'normal' pinching I missed the afterMapPinch quite often, call me uncoordinated but I'm sure I wouldn't be the only one :)

mike hill

unread,
Feb 26, 2009, 8:03:33 AM2/26/09
to route-me
Ahh yeah, I was testing it out in the simulator at first. I will look
into a patch - patch ;-)

On Feb 25, 4:13 pm, Matt Farnell <mfarn...@gmail.com> wrote:
> I'm testing this patch now, afterMapPinch only gets called if you remove
> both fingers at exactly the same time, if you lift one finger slightly
> before the other one it wont fire. I found with my 'normal' pinching I
> missed the afterMapPinch quite often, call me uncoordinated but I'm sure I
> wouldn't be the only one :)
>

Quazie

unread,
Feb 27, 2009, 11:18:53 AM2/27/09
to route-me
These delegate methods seem great, once pinch is fixed I'll be adding
these to my project. Thanks so much.

Hal Mueller

unread,
Feb 27, 2009, 3:20:27 PM2/27/09
to route-...@googlegroups.com
Better choices for the method names would, IMO, mirror the UIScrollviewDelegate nomenclature (copied below). And we should also start moving to a common term of reference for latitude/longitude. 

That would leave us with -mapViewDidEndDecelerating:, -mapViewWillBeginDecelerating:, -mapViewDidMoveToLatLon:, etc.

Hal

UIScrollViewDelegate Protocol Reference

Responding to Scrolling and Dragging

Managing Zooming

Responding to Scrolling Animations

--
Hal Mueller
halmu...@gmail.com
Seattle, Washington

Wouter Wessels

unread,
Feb 27, 2009, 5:15:37 PM2/27/09
to route-...@googlegroups.com
Hi All,

This remark brings us back to the earier discussion about Coding
Standards and Naming Conventions (or Nomenclature for the Latin
inclined reader).

As I stated in a previous post about these standards:

> I have always found it a very positive experience if the frameworks:
> - stick to the coding standards of the environment that they live in
> - have a consistent naming convention

As we 'live in' the environment of Apple, iPhone and CoreLocation, I
would prefer the use of CLLocationCoordinate2D above the use of LatLon
or LatLong.
Yes, LatLon would be easier, I do not know what Apple was thinking
when they chose CLLocationCoordinate2D but ..., Persnally, I might
even go for RMCoordinate but ...
CoreLocation gives me a CLLocationCoordinate2D, so I want to send that
variable with that type straight through to Route Me, without casting,
renaming or converting.
But ... whichever choice we make ... it is better than making no
choice at all and continue on the path we are on now ...

As this is the second thread in a week or so where the subject of
Coding Standards and Naming Conventions, maybe we should give this a
bit more attention ...
The problem with this is that renaming fields, types and methods will
break a lot of running projects ...

BTW ... I love the suggestion to make the RMMapViewDelegate a bit like
existing delegates ...

Regards,
Wouter


Op 27 feb 2009, om 21:20 heeft Hal Mueller het volgende geschreven:

> Better choices for the method names would, IMO, mirror the
> UIScrollviewDelegate nomenclature (copied below). And we should also
> start moving to a common term of reference for latitude/longitude.
>
> That would leave us with -mapViewDidEndDecelerating:, -
> mapViewWillBeginDecelerating:, -mapViewDidMoveToLatLon:, etc.
>
> Hal
>
> UIScrollViewDelegate Protocol ReferenceResponding to Scrolling and
> Dragging
> • – scrollViewDidScroll: optional method
> • – scrollViewWillBeginDragging: optional method
> • – scrollViewDidEndDragging:willDecelerate: optional method
> • – scrollViewWillScrollToTop: optional method
> • – scrollViewDidScrollToTop: optional method
> • – scrollViewWillBeginDecelerating: optional method
> • – scrollViewDidEndDecelerating: optional method
> Managing Zooming
> • – viewForZoomingInScrollView: optional method
> • – scrollViewDidEndZooming:withView:atScale: optional method
> Responding to Scrolling Animations
> • – scrollViewDidEndScrollingAnimation: optional method
>

Matt Farnell

unread,
Feb 27, 2009, 5:43:31 PM2/27/09
to route-...@googlegroups.com
it just takes someone with commit privileges to do it, tag the current version, create a branch for the new version. 

Quazie

unread,
Mar 14, 2009, 3:35:14 PM3/14/09
to route-me
Status of this patch?
> > > halmuel...@gmail.com
> > > Seattle, Washington

mike hill

unread,
Mar 14, 2009, 8:14:47 PM3/14/09
to route-me
I have been swamped with another project. I havent had time to look
into it. I will get back to it this week.

-mike

mike hill

unread,
Mar 17, 2009, 10:03:07 AM3/17/09
to route-me
Hal,

can you make a new branch for these new delegates and I will apply my
patch? I may need a bit of help on this one to squash this bug, RE:
pinch finger releases.

In my app it is not an issue since this fires the afterMapDecelerated
delegate which does the same thing (loads the new markers).

Also, I think a new branch would be good since we can all contribute
to the names until everyone agrees on them before anyone uses the
delegate names in their projects.

-mike

On Feb 27, 4:20 pm, Hal Mueller <halmuel...@gmail.com> wrote:
> Better choices for the method names would, IMO, mirror the
> UIScrollviewDelegate nomenclature (copied below). And we should also start
> moving to a common term of reference for latitude/longitude.
> That would leave us with -mapViewDidEndDecelerating:,
> -mapViewWillBeginDecelerating:, -mapViewDidMoveToLatLon:, etc.
>
> Hal
>
> UIScrollViewDelegate Protocol ReferenceResponding to Scrolling and Dragging
>
>    - – scrollViewDidScroll:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidScroll:>
>  optional
>    method
>    - – scrollViewWillBeginDragging:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewWillBeginDragging:>
>  optional
>    method
>    - – scrollViewDidEndDragging:willDecelerate:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidEndDragging:willDecelerate:>
>  optional
>    method
>    - – scrollViewWillScrollToTop:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewWillScrollToTop:>
>  optional
>    method
>    - – scrollViewDidScrollToTop:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidScrollToTop:>
>  optional
>    method
>    - – scrollViewWillBeginDecelerating:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewWillBeginDecelerating:>
>  optional
>    method
>    - – scrollViewDidEndDecelerating:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidEndDecelerating:>
>  optional
>    method
>
> Managing Zooming
>
>    - – viewForZoomingInScrollView:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/viewForZoomingInScrollView:>
>  optional
>    method
>    - – scrollViewDidEndZooming:withView:atScale:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidEndZooming:withView:atScale:>
>  optional
>    method
>
> Responding to Scrolling Animations
>
>    - – scrollViewDidEndScrollingAnimation:<file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone2_2.iPhoneLibrary.docset/Contents/Resources/Documents/documentation/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html#//apple_ref/occ/intfm/UIScrollViewDelegate/scrollViewDidEndScrollingAnimation:>
>  optional
>    method
> halmuel...@gmail.com
> Seattle, Washington

Quazie

unread,
Mar 17, 2009, 10:36:26 AM3/17/09
to route-me
branches/issue85 now exists for this.

mike hill

unread,
Mar 17, 2009, 11:54:51 AM3/17/09
to route-me
excellent. I am cant get to this until later in the week -- unless
someone else wants to apply the patch and start renaming the
delegates.

At least now we have a place for it, thanks Quazie.

Mike
Reply all
Reply to author
Forward
0 new messages