谷歌地图标记显示在swift 5道路外

谷歌地图标记显示在swift 5道路外,swift,google-maps,Swift,Google Maps,我在swift 5中使用谷歌地图。我用过马克笔。有时路标会显示在路的外面。这是图片 我在谷歌地图上使用了下面的代码 let marker = GMSMarker() marker.position = CLLocationCoordinate2DMake(lat, lon) marker.title = description marker.icon = UIImage(named: "item_car_idle") marker.rotation = CLLocationDegrees(hea

我在swift 5中使用谷歌地图。我用过马克笔。有时路标会显示在路的外面。这是图片 我在谷歌地图上使用了下面的代码

let marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(lat, lon)
marker.title = description
marker.icon = UIImage(named: "item_car_idle")
marker.rotation = CLLocationDegrees(heading)
marker.map =  self.googleMap
marker.infoWindowAnchor = self.getInfoWindowAnchorFor(Double(heading))
var bounds = GMSCoordinateBounds()
bounds = bounds.includingCoordinate(marker.position)
self.googleMap.animate(with: GMSCameraUpdate.fit(bounds, withPadding:50.0))
self.googleMap.selectedMarker = marker

如何将我的标记固定在道路上而不是室外。请帮帮我

位置从哪里来?通过iOS设备或任何外部源?@iOSArchitect.com externaldevice@iOSArchitect.com这是来自汽车跟踪设备我不确定答案。此链接可能有助于: