Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps : Error when typing in coordinates of certain countries

I'm drawing routes on google map and just realized it all works fine except I send coordinates of somewhere in Korea.(South to be precise)

JSON data is null even though the coordinates are correct and keeps "zero results"'ing me.

I've tried Africa, Australia, Europe and even China and Japan but anywhere in Korea won't work.

Am I missing something here..?

EDIT

So I guess it's not just Korea Mongolia and Indonesia are the same their geocodes don't work with waypoints to get the route.

Comparing results between Korea and Germany -

Korea

{"geocoded_waypoints" : [
  {
     "geocoder_status" : "OK",
     "place_id" : "ChIJzWXFYYuifDUR64Pq5LTtioU",
     "types" : [ "locality", "political" ]
  },
  {
     "geocoder_status" : "OK",
     "place_id" : "ChIJNc0j6G3raDURpwhxJHTL2DU",
     "types" : [ "locality", "political" ]
  }],"routes" : [],"status" : "ZERO_RESULTS"}

Germany

{"geocoded_waypoints" : [
  {
     "geocoder_status" : "OK",
     "place_id" : "ChIJAVkDPzdOqEcRcDteW0YgIQQ",
     "types" : [ "locality", "political" ]},
  {
     "geocoder_status" : "OK",
     "place_id" : "ChIJ2V-Mo_l1nkcRfZixfUq4DAE",
     "types" : [ "locality", "political" ]}],"routes" : [
  {
     "bounds" : {
        "northeast" : {
           "lat" : 52.5200138,
           "lng" : 13.404945
        },
        "southwest" : {
           "lat" : 48.1351972,
           "lng" : 11.1954806
        }
     },
     "copyrights" : "Datos de mapas ©2015 GeoBasis-DE/BKG (©2009), Google",
     "legs" : [
        {
           "distance" : {
              "text" : "585 km",
              "value" : 584740
           },

And so on and on. As you see you get full data with german coordinates.

EDIT

Ok..CLLocationManager does the same thing... How am I supposed to get addresses in those countries??

like image 510
durazno Avatar asked Aug 24 '15 18:08

durazno


1 Answers

{
- (void)mapView:(GMSMapView *)mapView idleAtCameraPosition:(GMSCameraPosition *)position
{
    CLLocation *pinLocation =[[CLLocation alloc] initWithLatitude:position.target.latitude  longitude:position.target.longitude];

CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:pinLocation
               completionHandler:^(NSArray *placemarks, NSError *error)
 {
     if (error)
     {
         return;
     }
     CLPlacemark *placemark = [placemarks objectAtIndex:0];
     NSLog(@"address-->%@",placemark.addressDictionary);

}];

like image 60
Sady Sadeesh Avatar answered Sep 29 '22 02:09

Sady Sadeesh