MapBox iOS SDK:添加映射事件

MapBox iOS SDK:添加映射事件,ios,swift,mapbox,mapbox-gl,Ios,Swift,Mapbox,Mapbox Gl,我正在尝试使用最新的MapBox iOS idk(3.2)安装iOS应用程序。无论我在互联网上搜索了多少,我都找不到如何向mapview添加地图事件的示例 例如:我想在映射变为空闲时添加一个事件。有什么建议吗 更新 我认为这是正确的实施方法: func mapView(mapView: MGLMapView, regionDidChangeAnimated animated: Bool) { } 如果您想了解如何使用委托方法,请看以下方法: import Mapbox // Declar

我正在尝试使用最新的MapBox iOS idk(3.2)安装iOS应用程序。无论我在互联网上搜索了多少,我都找不到如何向mapview添加地图事件的示例

例如:我想在映射变为空闲时添加一个事件。有什么建议吗

更新

我认为这是正确的实施方法:

func mapView(mapView: MGLMapView, regionDidChangeAnimated animated: Bool) {


}

如果您想了解如何使用委托方法,请看以下方法:

import Mapbox

// Declare conformance to the MGLMapViewDelegate protocol
class ViewController: UIViewController, MGLMapViewDelegate {

    var mapView: MGLMapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        mapView = MGLMapView(frame: view.bounds)
        mapView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
        view.addSubview(mapView)

        // Set the delegate property of our map view to self after instantiating it.
        mapView.delegate = self
    }

    func mapView(mapView: MGLMapView, regionDidChangeAnimated animated: Bool) -> Bool {
        // look at mapView properties and do something
    }
}
有关如何使用Mapbox iOS SDK实现基本功能的示例,请参见