Hi all I am trying to get the compass to disappear off my map and have hit a brick wall. Below is my map initialization function and I'm not sure what the variable is. I have tried mapView.compassEnabled == false, mapView.compassView = nil and a few other things that I have found to no avail.
I appreciate any help!
@objc func initMap() { if mapView != nil { print("Attempting to init map that is already initialized, returning") return } mapView = NavigationMapView(frame: UIApplication.shared.delegate!.window!!.bounds, // TODO: Set frame from react styleURL: NSURL(string: "mapbox://styles/paway/ckcp7w04x03by1iqi1t26uilu") as URL?) guard let mapView = self.mapView else { return } mapView.zoomLevel = 2 mapView.delegate = self mapView.locationManager.setDistanceFilter?(6) PWLocationManager.shared.delegate = self mapView.setCenter(CLLocationCoordinate2D(latitude: 37.0902, longitude: -95.7129), animated: false) mapView.navigationMapViewDelegate = self switch cameraMode { case "overview": mapCameraState = .overviewMode mapView.userTrackingMode = .followWithHeading case "followHeading": mapCameraState = .followMode mapView.userTrackingMode = .followWithHeading default: mapView.userTrackingMode = .none } mapView.isPitchEnabled = true mapView.showsUserLocation = true self.addSubview(mapView) addMapTapRecognizer() addObservers() } https://stackoverflow.com/questions/65974000/mapbox-swift-compass-visibilty-property January 31, 2021 at 07:01AM
没有评论:
发表评论