我正在使用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];