1
我能夠與位置陣列借鑑GMSPolyline上的GoogleMaps這樣如何在iOS中緩慢而平穩地繪製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像從一個地方慢慢移動到另一個地方一樣動畫呢?
感謝您的詳細澄清。我檢查 – Himanth