-(void) viewdidload
{
[Super Viewdidload];
Self.navigationController.navigationBarHidden = YES;
_mapview = [[Mamapview alloc] init];
_mapview.frame =cgrectzero;
[Self.view Addsubview:_mapview];
_mapview.showsuserlocation = YES;
}
-(void) Mapview: (Mamapview *) Mapview didupdateuserlocation: (mauserlocation *) userlocation
Updatinglocation: (BOOL) updatinglocation
{
NSLog (@ "didupdateuserlocationdidupdateuserlocationdidupdateuserlocation");
Cllocation *currentlocation = userlocation.location;
if (updatinglocation)
{
Take out the coordinates of the current position
NSLog (@ "Latitude:%f,longitude:%f", userlocation.coordinate.latitude,userlocation.coordinate.longitude);
[Userlocation.]
}
Clgeocoder *geocoder = [[Clgeocoder alloc] init];
[Geocoder reversegeocodelocation:currentlocation completionhandler:^ (Nsarray *placemarks, NSError *error) {
For (Clplacemark *place in Placemarks) {
UILabel *label = (UILabel *) [Self.window viewwithtag:101];
Label.text = Place.name;
NSLog (@ "name,%@", place.name); Location name
NSLog (@ "thoroughfare,%@", Place.thoroughfare); Street
NSLog (@ "subthoroughfare,%@", Place.subthoroughfare); Zi Jie dao
NSLog (@ "locality,%@", place.locality); City
NSLog (@ "sublocality,%@", place.sublocality); Area
NSLog (@ "country,%@", place.country); Countries
}
}];
}
German map positioning and location information acquisition