【发布时间】:2016-07-06 10:20:01
【问题描述】:
我使用的是谷歌地图 SDK,当用户移动时我必须绘制折线,目前它只是为标记设置动画,在引脚移动到特定位置之前绘制路径。我必须同时绘制路径和移动图钉。
观看此视频:https://www.dropbox.com/s/q5kdjf4iq0337vg/Map_Sample.mov?dl=0
这是我的代码
func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let location = locations.last!
userPath.addCoordinate(location.coordinate) //userPath -> GMSMutablePath
let polyline = GMSPolyline(path: userPath)
polyline.strokeColor = UIColor(red: 0, green: 191/255.0, blue: 1, alpha: 0.8)
polyline.strokeWidth = 5
CATransaction.begin()
CATransaction.setAnimationDuration(2.0)
self.userMarker.position = location.coordinate
self.userMarker.rotation = location.course
polyline.map = self.googleMapView
CATransaction.commit()
}
【问题讨论】:
-
你想做什么?不准确。能不能详细解释一下。
-
问题已编辑,您现在明白了吗?我必须在引脚移动时绘制路径
-
您好,有人遇到同样的问题吗?
-
你解决了这个问题吗?我也一样
-
@LeojinBose...你解决了这个问题吗?