SPGooglePlacesAutocomplete
SPGooglePlacesAutocomplete copied to clipboard
changes in clplacemark of resolveToPlacemark block
Due to some changes in the api, the place mark we get from
[place resolveToPlacemark:^(CLPlacemark *placemark, NSString *addressString, NSError *error)
block is different now, and there is lot of changes in placemark. so is there any other way to get the latitude and longitude from clplacemark,
i can get latitude and longitude but its too long way by dictionary to dictionary checking. my previous code which is working is following
[place resolveToPlacemark:^(CLPlacemark *placemark, NSString *addressString, NSError *error) {
if (error)
SPPresentAlertViewWithErrorAndTitle(error, @"Error while getting location");
}
else if (placemark)
{
id objtest = placemark;
NSString *str = [NSString stringWithFormat:@"%@",objtest];
NSArray *chunks = [str componentsSeparatedByString: @";"];
if (chunks.count >1)
{
NSString *lat = [chunks objectAtIndex:0];
NSString *lng = [chunks objectAtIndex:1];
selectedLatitude = [[lat componentsSeparatedByString:@"\""] objectAtIndex:1];
selectedLongitude = [[lng componentsSeparatedByString:@"\""] objectAtIndex:1];
}
else{
selectedLatitude = [NSString stringWithFormat:@"%f",placemark.location.coordinate.latitude];
selectedLongitude = [NSString stringWithFormat:@"%f",placemark.location.coordinate.longitude];
}
NSLog(@"selected latitude : %@",selectedLatitude);
NSLog(@"selected longitude : %@",selectedLongitude);
}
else{
NSLog(@"Anything other...");
}
}];
}
hi, i had the same problem, for example if I try London or Milan in the Italian language, or if I try Plae d'italie in any language or even other cities did not return lat and lon.
Can you help me please? Thanks in advance
It is resolved now, i download the updated version of this project for testing, and it works fine without any trouble, so i suggest you to remove the previous files of "SPGooglePlacesAutocomplete" and add the updated files and configure it. It works for me.., So Best of luck to you.. @zoelounge
OK thanks. I just update and it works fine but i notice any trouble. Try you to search "Place d'italie"? It return the name into the list but doesn't return the coordinates.
Thank you for all.
Yes, It has Same problem as previous version for some places even i suffer from this bug. I Found this bug in Previous version, this occurs due to "resolveGecodePlaceToPlacemark", it gives error for some places rather than convert it to Placemark. Basically this function convert address string to placemark, and for some places it can't convert it to placemark and gives error in block.
OK thank you for all.
Hi, any one can help me with SPGooglePlacesAutocompleteQuery language ? I tray "en" or "ENGLISH" but the result is always in keyboard languages. Thanks in advances.