1
방향 경로를 다시 그리고 현재 위치로 마커를 옮기고 싶습니다.
현재는 didUpdateLocations
내부에서이 작업을 수행하고 있지만 동시에 여러 마커와 경로를 그리기 때문에 이상하게 보입니다.didUpdateLocations에서 방향 경로 다시 그리기
let location = locations.last
let destination = CLLocation(latitude: order!.user_coord![0], longitude: order!.user_coord![1])
let origin = CLLocation(latitude: (location?.coordinate.latitude)!, longitude: (location?.coordinate.longitude)!)
self.drawPath(startLocation: origin, endLocation: destination)
self.createMarker(titleMarker: order!.store_name!, iconMarker: UIImage(named: "icons8-user_filled")!, latitude: order!.user_coord![0], longitude: order!.user_coord![1])
self.createMarker(titleMarker: "User", iconMarker: UIImage(named: "icons8-mountain_biking")!, latitude: (location?.coordinate.latitude)!, longitude: (location?.coordinate.longitude)!)
let camera = GMSCameraPosition.camera(withLatitude: (location?.coordinate.latitude)!, longitude: (location?.coordinate.longitude)!, zoom: 17.0)
self.map.animate(to: camera)
locationManager.stopUpdatingLocation()
처럼
명확한 경로와 주석을 설정 업데이트 할 ... 그렇게 할 때 그들은거야 업데이트로 위치가 업데이트되지 않음 –
upate ........ –
mapView.clear()를 사용하여 주석과 맵을 쉽게 지울 수 있지만 거의 매 초마다 지워집니다 –