github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

digdog / MapKitDragAndDrop

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 44
    • 3
  • Source
  • Commits
  • Network (3)
  • Downloads (2)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • 2.1
    • 2.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

MapKit sample for custom draggable AnnotationView with CoreAnimation pin lift/drop/bounce effects — Read more

  cancel

http://digdog.tumblr.com/post/296357579/mapkitdraganddrop2

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Update readme for v2.1 
digdog (author)
Mon Jan 18 15:29:20 -0800 2010
commit  6439eb8760bfdcad5db11fbe3ce7f08cc909a5f8
tree    bea4da18fb93a0256408ade8c5e350c04c00f61c
parent  e6c49282e08ab0c20d9a30b7320fdd7b7a53890f
MapKitDragAndDrop /
name age
history
message
file .gitattributes Fri Jul 24 11:50:48 -0700 2009 First Version [digdog]
file .gitignore Tue Dec 22 21:41:51 -0800 2009 Release of version 2.0. Major change: CoreAnima... [digdog]
directory Classes/ Mon Jan 18 15:27:49 -0800 2010 Fix touch event handling, do pin animation only... [digdog]
directory MapKitDragAndDrop.xcodeproj/ Mon Jan 18 15:27:49 -0800 2010 Fix touch event handling, do pin animation only... [digdog]
file MapKitDragAndDrop_Prefix.pch Fri Jul 24 11:50:48 -0700 2009 First Version [digdog]
file README.markdown Mon Jan 18 15:29:20 -0800 2010 Update readme for v2.1 [digdog]
directory Resources/ Tue Dec 22 21:41:51 -0800 2009 Release of version 2.0. Major change: CoreAnima... [digdog]
file main.m Tue Dec 22 21:41:51 -0800 2009 Release of version 2.0. Major change: CoreAnima... [digdog]
README.markdown

MapKitDragAndDrop 2.1

MapKit sample for custom draggable AnnotationView with CoreAnimation pin lift/drop/bounce effects.

Features

  • Draggable pin with CoreAnimation effects in the MapView
  • Use CLLocationManager to find current position
  • Use MKReverseGeocoder to lookup address

Design

  • DDAnnotation is thin, just subclass from MKPlacemark, which also confirms to MKAnnotation protocol.
  • DDAnnotation can be init'd with existing address info, so you won't need to reverse geocoding when creating the annotation.
  • DDAnnotation re-declared MKAnnotation's readonly property 'coordinate' to readwrite-able. So you can update the coordinate after created.
  • DDAnnotationView is subclassing from MKAnnotationView now, and using several pin images from MapKit.framework.
  • To enable drag-and-drop, you must assign MKMapView instace to DDAnnotationView.
  • DDAnnotationView now comes with CoreAnimation effects, including:
    1. Pin bounce when touched.
    2. Pin bounce and left for dragging.
    3. Pin drop and bounce when releasing the touch without moving.
    4. Pin lift, drop and bounce when releasing the touch after moving to the new position.
  • DDAnnotationView won't do any animations unless MKMapView instance is assigned.

Issues

  • If you lookup too many times within a very short of period, you might get error from Apple/Google(so don't do this in your real world apps):

    /SourceCache/ProtocolBuffer/ProtocolBuffer-19/Runtime/PBRequester.m:446 server returned error: 503
    
  • Pin animations are almost perfect, but still need some works, I will kept things updated if possible.

License

This sample code is licensed under MIT license.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server