【问题标题】:I want to fix the marker in the center of the map ios我想将标记固定在地图 ios 的中心
【发布时间】:2017-01-24 10:56:49
【问题描述】:

我想在 Swift 中修复谷歌地图中心的标记 我不想使用 CMSCircle 我想将标记固定在中心 移动地图和标记不改变位置

【问题讨论】:

    标签: swift dictionary marker


    【解决方案1】:

    您可以将此扩展添加到您的视图控制器。每次移动地图时,标记都会移动到中心

    extension MyMapViewController: GMSMapViewDelegate{
        func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
            marker.position = position.target
            reverseGeocodeCoordinate(coordinate: position.target)
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-30
      • 2016-05-04
      • 2023-04-05
      • 2013-10-20
      • 2018-12-19
      • 1970-01-01
      • 2016-08-11
      • 1970-01-01
      相关资源
      最近更新 更多