Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios MapBox快照程序失败,HTTP状态代码为404_Ios_Swift_Mapbox_Mapbox Ios - Fatal编程技术网

Ios MapBox快照程序失败,HTTP状态代码为404

Ios MapBox快照程序失败,HTTP状态代码为404,ios,swift,mapbox,mapbox-ios,Ios,Swift,Mapbox,Mapbox Ios,我已将MapBox集成到我的应用程序中,并尝试使用MGLMapSnapshotter创建地图快照。我直接从网站上复制了这个功能。从中绘制选项的样式将正确显示在地图上。有人能告诉我为什么创建快照失败吗 func createSnapshot(completion: @escaping (UIImage?) -> Void) { // Use the map's style, camera, size, and zoom level to set the snapshot's opti

我已将
MapBox
集成到我的应用程序中,并尝试使用
MGLMapSnapshotter
创建地图快照。我直接从网站上复制了这个功能。从中绘制选项的样式将正确显示在地图上。有人能告诉我为什么创建快照失败吗

func createSnapshot(completion: @escaping (UIImage?) -> Void) {
    // Use the map's style, camera, size, and zoom level to set the snapshot's options.
    let options = MGLMapSnapshotOptions(styleURL: tripPhotosMap.styleURL, camera: tripPhotosMap.camera, size: tripPhotosMap.bounds.size)
    options.zoomLevel = tripPhotosMap.zoomLevel

    // Create the map snapshot.
    var snapshotter: MGLMapSnapshotter? = MGLMapSnapshotter(options: options)
    snapshotter?.start { (snapshot, error) in
        if error != nil {
            print("Unable to create a map snapshot.")
            print(error?.localizedDescription)
            completion(nil)
        } else if let snapshot = snapshot {
            // Add the map snapshot's image to the image view.
            completion(snapshot.image)
        }
        snapshotter = nil
    }
}
错误


tripPhotosMap.styleURL
关联的样式是什么?
{com.mapbox.mbgl.Map Snapshotter}[Style]: Failed to load sprite: HTTP status code 404