On top of a MKMapView

Geocoding for MKMapView

I have a subclass "Location" of NSManagedObject and this class conforms to MKAnnotation.

When I add a Location to a Map...the ReverseGeocoder starts. By clicking the pin I see in the callout View the address of the pin. So everything works fine.

Now my problem.

I am able to drag the pins. When I am finished dragging, than again the ReverseGeocoder starts to ask for location Data. But I still have the old address in the callout view, although the placemarks are updated in the Location object. After dragging again I can see the new address. (of course the new one isn't new anymore, because I dragged).

Here is my code for the dragging state:

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState{ //if dragging ended if (newState == MKAnnotationViewDragStateNone && oldState == MKAnnotationViewDragStateEnding) { CLLocation *location = [[CLLocation alloc] initWithLatitude:annotationView.annotation.coordinate.latitude longitude:annotationView.annotation.coordinate.longitude]; [self geocodeLocation:location forAnnotation:annotationView.annotation]; [location release]; }

And the Code for my reverse geocoder delegate

- (void)reverseGeocoder:(MKReverseGeocoder*)geocoder didFindPlacemark:(MKPlacemark*)place { Location* theAnnotation = [self.map annotationForCoordinate:place.coordinate]; if (!theAnnotation) return; // Associate the placemark with the annotation. theAnnotation.city = [place locality]; theAnnotation.zipcode = [place postalCode]; theAnnotation.street = [place thoroughfare]; DEBUGLOG(@"Place: %@", place); // Add a More Info button to the annotation's view. MKPinAnnotationView* view = (MKPinAnnotationView*)[self.map viewForAnnotation:theAnnotation]; if (view) { DEBUGLOG(@"SUBTITLE: %@", theAnnotation.subtitle); view.leftCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; } }

You might also like
calculating the distance between two points
calculating the distance between two points
distance between two points - Coordinate Geometry Basics.mp4
distance between two points - Coordinate Geometry Basics.mp4
Distance between two points
Distance between two points

Help with geocoding

by aoompaloompa

Morning-I'm trying to plot a list of addresses on a map using yahoo's service for that. Problem is, the data requires it being in a specific form according to an excel template they've provided as an example.
Now i'd like to know ;
1. General advice on the proccess
2. A way for excel to 'intelligently' break up data into corresponding cells
The problem is my data looks like this:
B & B Real Estate
7525 Auburn Boulevard
Citrus Heights, CA 95610-2239
And needs to look like this: (| being cell lines)
1600 Pennsylvania Avenue NW | Washington | DC | 20500 |The White House

Geocoding manages CAT exposures. (Geographic Information Systems): An article from: National Underwriter Property & Casualty-Risk & Benefits Management
Book (The National Underwriter Company)

7 Game of Thrones Apps That Will Get You Through the Much-awaited Winter  — Gizmodo India
.. or Winterfell, you get a dialog box, which asks you to buy more maps. Unfortunately, you can't dismiss the dialogue box, leading to the obstruction of the cartography. ..

Flagstaff's rocky lava field became a little piece of the moon  — azcentral
If American know-how could put a man on the moon, the man should bring back rocks to study. The government agreed, and in 1963, the .. Volcanoes were chosen because of the moon's volcanic history, the test site for its impact craters.

Missing in Alaska without a trace  — Anchorage Daily News
The official version of events, according to a still active missing person's bulletin from the Alaska State Troopers is that Griffis went into the wild "to test out a survival 'cocoon' that he had invented.

Related Posts