Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在谷歌地图iOS(Swift)中,在特定的持续时间内将标记从坐标A设置为坐标B的动画_Ios_Swift_Xcode_Google Maps_Google Maps Markers - Fatal编程技术网

如何在谷歌地图iOS(Swift)中,在特定的持续时间内将标记从坐标A设置为坐标B的动画

如何在谷歌地图iOS(Swift)中,在特定的持续时间内将标记从坐标A设置为坐标B的动画,ios,swift,xcode,google-maps,google-maps-markers,Ios,Swift,Xcode,Google Maps,Google Maps Markers,我想为iOS版谷歌地图上的标记制作动画 以特定速度或持续时间在2点之间 像点A和B是两点,我想把标记从A移到B 如果我想在一个特定的时间范围内做,比如假设3秒,那么从坐标a到坐标B自动移动需要3秒 我想让效果有点像优步在汽车从一个点移动到另一个点时的效果。你可以使用DispatchQueue.main.asyncAfterlike func showFirstMarker() { // Fetch the coordinates of first location and plot as m

我想为iOS版谷歌地图上的标记制作动画 以特定速度或持续时间在2点之间 像点A和B是两点,我想把标记从A移到B 如果我想在一个特定的时间范围内做,比如假设3秒,那么从坐标a到坐标B自动移动需要3秒


我想让效果有点像优步在汽车从一个点移动到另一个点时的效果。

你可以使用DispatchQueue.main.asyncAfterlike

func showFirstMarker()
{
  // Fetch the coordinates of first location and plot as marker.

  // Call a function after 3 seconds, to show the second marker.

  DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: {self.showSecondMarker()})

}

func showSecondMarker()
{
   // Erase all markers in maps.

   // Fetch the second coordinate and plot as marker.
}