Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes in clplacemark of resolveToPlacemark block #17

Open
gaurang212 opened this issue Oct 18, 2014 · 6 comments
Open

changes in clplacemark of resolveToPlacemark block #17

gaurang212 opened this issue Oct 18, 2014 · 6 comments

Comments

@gaurang212
Copy link

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...");
            }
        }];
    }
@zoelounge
Copy link

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

@gaurang212
Copy link
Author

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

@zoelounge
Copy link

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.

@gaurang212
Copy link
Author

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.

@zoelounge
Copy link

OK thank you for all.

@ZoeVale
Copy link

ZoeVale commented Nov 17, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants