Mapbox iOS SDK动态样式设置坐标边界崩溃

Mapbox iOS SDK动态样式设置坐标边界崩溃,ios,swift,crash,mapbox,bounding-box,Ios,Swift,Crash,Mapbox,Bounding Box,我试图在Mapbox示例中解决水彩光栅层示例,并根据文档添加一个额外的边界框参数。应用程序总是因NSException而崩溃,并且没有进一步的了解 func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { let bounds = MGLCoordinateBounds(sw: CLLocationCoordinate2D(latitude: -180, longitude: -85.0511287

我试图在Mapbox示例中解决水彩光栅层示例,并根据文档添加一个额外的边界框参数。应用程序总是因NSException而崩溃,并且没有进一步的了解

  func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
    let bounds = MGLCoordinateBounds(sw: CLLocationCoordinate2D(latitude: -180, longitude: -85.05112877980659), ne: CLLocationCoordinate2D(latitude: 180, longitude: 85.0511287798066))
    let source = MGLRasterTileSource(identifier: "stamen-watercolor", tileURLTemplates: ["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"], options: [ .tileSize: 256, .coordinateBounds: bounds])
    let rasterLayer = MGLRasterStyleLayer(identifier: "stamen-watercolor", source: source)

    style.addSource(source)
    style.addLayer(rasterLayer) }

是否不支持此选项参数?还是我做错了什么?

发现问题不在于将边界添加为NSValue,而只是将其添加为MGLCoordinated边界