Tag: google polyline

如何在谷歌地图iOS Swift中的两个位置之间绘制路线

我在我的iOS Swift项目中使用谷歌地图。 我想绘制地图上两个位置之间的path(不是直线)。 任何想法如何做到这一点?

Google地图SDK:在Google地图中以设备在后台移动时绘制正确的折线

我正在使用Google Map SDK for iOS。 我正在驾驶模式中绘制多段线。 但是,当我停下来,然后缩放谷歌地图,我的当前位置光标自动移动和重绘之字形多段线,由于所有以前的多段线绘制得到重叠和多段线得到完全改变。当我去后台和驱动器时发生的事情。 我能知道为什么会发生? 而我怎样才能在相同的path上同时在驾驶和行走模式中绘制平滑的多段线。 我的代码 – – (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { pointString=[NSString stringWithFormat:@"%f,%f",newLocation.coordinate.latitude,newLocation.coordinate.longitude]; CLLocationDistance kilometers = [newLocation distanceFromLocation:oldLocation] / 1000; NSLog(@"Distance Travelled in Kilometer :%f",kilometers); [self.points addObject:pointString]; GMSMutablePath *path = [GMSMutablePath path]; for (int i=0; i<self.points.count; i++) { NSArray *latlongArray = [[self.points objectAtIndex:i]componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]]; [path addLatitude:[[latlongArray objectAtIndex:0] […]