I have the same solution like in Uber app. I want to locate myself (this is simple) and put some pin开发者_如何学Python on the center of screen. When I scroll map, red pin stays in center of screen, and in text field is updated street name where is red pin.
I found that I must to use overlay map for this centered pin, but I don't know what to do with reverse geocoding and text field.
There is some example of this behavior or can you give some sample, or anything how to make this?
1) get the center coordinate
CLLocationCoordinate2D coord = mapview.centerCoordinate
;
2) reverse geocode the coordinate
MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coord];
[geocoder setDelegate:self];
[geocoder start];
3) this callback delegate will give you what you want. Check placemark
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
精彩评论