谷歌地图api和苹果MKMapKit的位置是不同的

时间:2015-06-30 12:58:35

标签: dictionary ios8

我正在使用maps.googleapis.com/maps/api/directions/json?用于objc中的路线绘图。当我绘制线条时,坐标略有变化,意味着针脚和折线不相交。有没有办法在MKMap中绘制精确点。

我的代码

      NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%f,%f&destination=%f,%f&sensor=false&mode=driving", agentLati, agentLogi, userLati, userLogi]];


..........

 if (polyLine !=nil) {
                [_route_Map removeOverlay:polyLine];
            }
            polyLine = [[MKPolyline alloc]init];
//            polyLine = [self polylineWithEncodedString:[[[[responseDict objectForKey:@"routes"] objectAtIndex:0]objectForKey:@"overview_polyline"] objectForKey:@"points"]];
               polyLine = [self polylineWithEncodedString:[[[[responseDict objectForKey:@"routes"] objectAtIndex:0]objectForKey:@"overview_polyline"] objectForKey:@"points"]];
            [_route_Map addOverlay:polyLine];

0 个答案:

没有答案