मैं दो स्थानों के बीच पथ दिखाने के लिए कोशिश कर रहा हूँ, लेकिन यह सही नहीं है।गूगल मानचित्र एसडीके - पथ नहीं सही
आप देख सकते हैं, ब्लू लाइन (पथ) गंतव्य पर जाने नहीं करता:
if(center.latitude != 0 && center.longitude != 0)
{
NSString *urlString = [NSString stringWithFormat:
@"%@?origin=%f,%f&destination=%f,%f&sensor=true&key=%@",
@"https://maps.googleapis.com/maps/api/directions/json",
center.latitude,
center.longitude,
center1.latitude,
center1.longitude,
KGoogleMapServerKey];
NSError *error;
NSDictionary *json =[NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlString] options:NSDataReadingUncached error:&error] options:NSJSONReadingMutableContainers error:&error];
if(json[@"routes"] != nil && [json[@"routes"] count] > 0)
{
GMSPath *path =[GMSPath pathFromEncodedPath:json[@"routes"][0][@"overview_polyline"][@"points"]];
GMSPolyline *singleLine = [GMSPolyline polylineWithPath:path];
singleLine.strokeWidth = 7;
singleLine.strokeColor = [UIColor colorWithRed:56.0/255.0 green:163.0/255.0 blue:249.0/255.0 alpha:1.0];
singleLine.map = mapViewGoogle;
}
इस पथ मैं हो रही है।
यह कैसे तय करने के लिए?
मुझे लगता है कि Google को पता नहीं है कि गंतव्य तक कैसे पहुंचे, क्योंकि कोई रास्ता नहीं है, या निजी क्षेत्र में ऐसा कुछ है। – wf9a5m75