swift - 我想修复 map ios中心的标记

标签 swift dictionary marker

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

最佳答案

您可以将此扩展添加到 View Controller 中。每次移动 map 时,标记都会移动到中心

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

关于swift - 我想修复 map ios中心的标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41826382/

相关文章:

ios - uitableViewCell.rounded Corners 不会立即显示

ios - 将数据从 ViewController 传递回根 ViewController?

python - 有没有更好的方法来解析Python字典?

python - 为什么字典比 Python 中的列表更快?

java - 在图像上添加标记/图钉的最佳方法是什么?

android - 带标记的圆圈

Mysql 查询为每个空记录将计数器或标记加一..?

swift - 无法使用 rxcoca 生成 TableView

ios - UITableViewCell 加载错误的 CAShapeLayer

python - 从字典列表中选择具有特定字段值的项目(类似于 SQL SELECT 命令)