刚刚通过cocoapods安装了MapboxGL
。
我在我的ViewController
中初始化它,如给出的示例:
@IBOutlet weak var mapViewWrapper: UIView!
var mapView: MGLMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Map
let styleURL = NSURL(string: "asset://styles/dark-v7.json")
mapView = MGLMapView(frame: mapViewWrapper.bounds, styleURL: styleURL)
mapView.autoresizingMask = .FlexibleWidth | .FlexibleHeight
// set the map's center coordinate
mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 38.894368,
longitude: -77.036487),
zoomLevel: 15, animated: false)
mapViewWrapper.addSubview(mapView)
}
当我启动应用程序时,我看到一个黑色方块和一个Mapbox徽标但没有街道,请参见下图
在日志中我得到了这个:
[ERROR] {Map}[Style]: Failed to load [mapbox://mapbox.mapbox-streets-v6]:
[ERROR] {Map}[Style]: Failed to load [mapbox://mapbox.mapbox-terrain-v2]:
任何想法我做错了什么?