gpt4 book ai didi

ios - Mapbox iOS SDK 动态样式坐标边界崩溃

转载 作者:行者123 更新时间:2023-11-28 14:10:05 25 4
gpt4 key购买 nike

我正在尝试处理 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,而是将它们添加为 MGLCoordinateBounds。

关于ios - Mapbox iOS SDK 动态样式坐标边界崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52670638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com