メインコンテンツまでスキップ

Display a simple map view

BasicMapExample.swift
import UIKit
import MapboxMaps

final class ViewController: UIViewController {
private var mapView: MapView!

override func viewDidLoad() {
super.viewDidLoad()

let cameraOptions = CameraOptions(
center: CLLocationCoordinate2D(latitude: 41.879, longitude: -87.635),
zoom: 16,
bearing: 12,
pitch: 60)
let options = MapInitOptions(cameraOptions: cameraOptions)

mapView = MapView(frame: view.bounds, mapInitOptions: options)

mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
mapView.ornaments.options.scaleBar.visibility = .visible

view.addSubview(mapView)
}


}
このexampleは役に立ちましたか?