0

I use an MKMapView in my application, and implement its delegate. As with the Google Maps, I want to know when the user moved the map. If you open the Google Maps application, and press the GPS icon the button is set to the DONE style and the map centers to your location. Whenever you move the map the icon automatically gets back to PLAIN style.
How can I do the same thing?

Best regards,
Paul Peelen

EmptyStack
  • 51,274
  • 23
  • 147
  • 178
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168

1 Answers1

2

I am not sure whether this will solve your problem. But try overriding regionDidChangeAnimated: method of MKMapViewDelegate.

Doc says: This method is called whenever the currently displayed map region changes. During scrolling, this method may be called many times to report updates to the map position. Therefore, your implementation of this method should be as lightweight as possible to avoid affecting scrolling performance.

EmptyStack
  • 51,274
  • 23
  • 147
  • 178
  • 1
    Doesn't this also get called if the map is moved by some other means? How can we determine if it's moved specifically by user action. Would a UIGestureRecognizer. be the appropriate solution? *edit* found it: http://stackoverflow.com/questions/5005597/uipangesturerecognizer-on-mkmapview – Roderic Campbell May 12 '11 at 01:38