コンテンツにスキップ

Mapbox MapViewHolder

MapboxViewState.getMapViewHolder()AnyMapViewHolder? を返します。ネイティブビューは Mapbox の MapView にキャストでき、holder.mapMapboxMap にキャストできます。

import MapboxMaps
if let holder = mapViewState.getMapViewHolder(),
let mapView = holder.mapView as? MapView {
mapView.mapboxMap.setCamera(
to: CameraOptions(
center: CLLocationCoordinate2D(latitude: 35.6812, longitude: 139.7671),
zoom: 14
)
)
}