【发布时间】:2016-09-19 07:40:26
【问题描述】:
我可以在 GoogleMaps 上绘制 GMSPolyline,其中包含这样的位置数组
GMSMutablePath *path = [GMSMutablePath path];
for (int i = 0; i <anotherArray.count; i++) {
NSString *string1 = [anotherArray2 objectAtIndex:i];
NSString *string2 = [anotherArray objectAtIndex:i];
[path addCoordinate:CLLocationCoordinate2DMake(string1.doubleValue,string2.doubleValue)];
}
GMSPolyline *rectangle = [GMSPolyline polylineWithPath:path];
rectangle.strokeColor = [UIColor blueColor];
rectangle.map = mapView_;
rectangle.strokeWidth = 2.0f;
但是我从后端服务器获取的位置。
所以我必须每 10 秒刷新一次,获取新位置并将其添加到现有路径。这些都工作正常。
但是当我向现有路径添加新位置时,移动速度非常快。
因为我在路径的起点有一个 GMSMarker,它看起来像是从一个地方跳到另一个地方。
那么我怎样才能让 GMSMarker 像从一个地方慢慢移动到另一个地方一样制作动画呢?
【问题讨论】:
标签: ios objective-c xcode google-maps animation