如何在谷歌地图iOS(Swift)中,在特定的持续时间内将标记从坐标A设置为坐标B的动画
我想为iOS版谷歌地图上的标记制作动画 以特定速度或持续时间在2点之间 像点A和B是两点,我想把标记从A移到B 如果我想在一个特定的时间范围内做,比如假设3秒,那么从坐标a到坐标B自动移动需要3秒如何在谷歌地图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
我想让效果有点像优步在汽车从一个点移动到另一个点时的效果。你可以使用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.
}