如何在 iOs 的地图视图中显示单个位置?

how to display Single Location on mapview in iOs?

如何在 mapview 上显示带有经度和纬度坐标的单个位置(不是我当前的位置!)?

我只想显示具有这些随机坐标的单个位置 - 当这些坐标发生变化时,是否必须删除地图视图中的旧位置并用新坐标替换?我该怎么做?

要添加注释:

let annotation = MKPointAnnotation()
annotation.title = title
annotation.coordinate = coordinate
mapView.addAnnotation(annotation)

然后您可以使用 removeAnnotation 删除它并添加一个新注释,或者您可以将其移动到新坐标的动画:

UIView.animateWithDuration(1.0) {
    annotation.coordinate = newCoordinate
}