This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fetchLookAroundScene(withCoordinates coordinates: CLLocationCoordinate2D) async throws -> MKLookAroundScene? { | |
return try await MKLookAroundSceneRequest(coordinate: coordinates).scene | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createLookAroundView(scene: MKLookAroundScene) -> MKLookAroundViewController { | |
let lookAroundViewController = MKLookAroundViewController(scene: scene) | |
lookAroundViewController.showsRoadLabels = true //Default value is true | |
lookAroundViewController.isNavigationEnabled = true //Default value is true | |
lookAroundViewController.pointOfInterestFilter = .includingAll //Default value is nil | |
return lookAroundViewController | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func addLookAroundController(lookAroundController: UIViewController) { | |
view.addSubview(lookAroundController.view) | |
lookAroundController.view.translatesAutoresizingMaskIntoConstraints = false | |
lookAroundController.view.heightAnchor.constraint(equalToConstant: 90).isActive = true | |
lookAroundController.view.widthAnchor.constraint(equalToConstant: 130).isActive = true | |
lookAroundController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 16).isActive = true | |
lookAroundController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true | |