What's new in MapKit

RSS for tag

Discuss the WWDC22 Session What's new in MapKit

Posts under wwdc2022-10035 tag

9 Posts
Sort by:
Post not yet marked as solved
2 Replies
494 Views
So where is the example code of what was presented wrt mapview blend modes? I have NO clue how to apply a blend mode.
Posted
by yohst.
Last updated
.
Post not yet marked as solved
1 Replies
589 Views
Hi Apple MapKit team, I am a new iOS developer and recently learned SwiftUI. This WWDC is my first one. I noticed that although Apple is moving towards SwiftUI, the new features released for MapKit is still largely UIKit based. I am not very familiar with UIKit. I wondered that if MapKit team is going to mainly develop in MapKit space instead of the SwiftUI space. Cheers,
Posted
by mylaluna.
Last updated
.
Post not yet marked as solved
1 Replies
607 Views
Dear Apple Team and everyone who has experience with MapKit. I am building an app where I need to hide some 3D models and replace them with my custom 3D meshes using SceneKit. Up until now I was using Mapbox it allows to get mesh row data to reconstruct all maps 3D. Is there something like this possible with MapKit? Use cases Say you navigated to Kennedy Space Center Launch Complex 39 and there is no 3D model of actual building. I would like to be able to hide simple massing and replace it with my model. In 3D Satellite VIew some areas have detailed meshes. Say London The Queen's Walk. I would like to make specific area flat so I can place my 3D model on top of Satellite 3D View to illustrate new structure or building. Last one. Is it possible to change existing buildings colours? I know it is possible transparency Thank you @apple
Posted
by artpen.
Last updated
.
Post not yet marked as solved
1 Replies
756 Views
Hello, I am facing SwiftUI runtime warnings while implementing MapAnnotation [SwiftUI] Publishing changes from within view updates is not allowed, this will cause undefined behavior., there are new warnings when the map is moved. Implementing MapMarker instead of MapAnnotation solves the problem. What am I doing wrong with MapAnnotation? The code is running on Xcode version 14.1 (14B47b) and Simulator Version 14.1 (986.5) struct AnnotationItem: Identifiable {     let id = UUID()     var coordinate: CLLocationCoordinate2D } struct MapView: View {     @Binding var region: MKCoordinateRegion     @Binding var items: [AnnotationItem]     var body: some View {         Map(coordinateRegion: $region, annotationItems: items) { item in             MapAnnotation(coordinate: item.coordinate) {                 Image(systemName: "cup.and.saucer.fill")             }         }     } }
Posted Last updated
.
Post not yet marked as solved
2 Replies
627 Views
I'm adding Look Around into my app, but settings isNavigationEnabled to true or false does nothing. This bool is set to true by default, and my understanding is that it will enable the user to navigate around the location. I tried setting it to false and that didn't change the experience as the user was able to rotate the camera 360 degrees, but not move around freely in the area. Is this by design or am I missing something? Note: I'm on the latest Xcode 14 beta (beta 6). Here is my basic implementation: let lookAroundRequest = MKLookAroundSceneRequest(coordinate: location.coordinate!) lookAroundRequest.getSceneWithCompletionHandler { lookAroundScene, error in guard error == nil, lookAroundScene != nil else { return } let lookAroundVC = MKLookAroundViewController(scene: lookAroundScene!) lookAroundVC.pointOfInterestFilter = .includingAll self.present(lookAroundVC) }
Posted Last updated
.
Post not yet marked as solved
1 Replies
626 Views
I just want to see if anyone has worked around the following issue. I did file feedback at FB11405641. Using Apple's demo app from WWDC, if I open the LookAround when on an iPad in either split screen or using Stage Manager the full screen representation is not respecting the actual size of the window. See Here are some videos showing the issue: https://www.hotngui.com/tmp/SplitScreen.mov https://www.hotngui.com/tmp/StageManager.mov
Posted
by hotngui.
Last updated
.
Post not yet marked as solved
1 Replies
777 Views
I'm messing about with the new Look Around APIs in iOS 16, and can't seem to find a way to do a few things: Hide the current location label that shows up at the bottom of the Look Around view Go straight into the Look Around view rather than having to tap into it with the button Overlay a view on top of the Look Around view when panning/movement is active (the view seems to take highest priority and I cannot override it) Get it running on MacOS (as an iPad app) struct LookAroundView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> some UIViewController { let viewController = MKLookAroundViewController() viewController.badgePosition = .topLeading viewController.isNavigationEnabled = true viewController.pointOfInterestFilter = .excludingAll viewController.showsRoadLabels = false viewController.title = "Round 1" let location = CLLocationCoordinate2D( latitude: 37.80770, longitude: -122.47207 ) let sceneRequest = MKLookAroundSceneRequest(coordinate: location) Task { do { viewController.scene = try await sceneRequest.scene } catch { viewController.scene = nil } } return viewController } func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { } }
Posted Last updated
.
Post not yet marked as solved
1 Replies
559 Views
Does MapKit have an option for the fully texturized city view where available (i.e. NYC) as seen in the Maps app for iOS (see image)?
Posted
by platonl.
Last updated
.
Post not yet marked as solved
3 Replies
1.1k Views
I used Xcode 14 Beta 2. It worked fine on Xcode 13. If you set it to 3000m as shown below, it will work without problems. Below is the sample code. import SwiftUI import MapKit enum MapType {   case standard   case satellite   case hybrid   case satelliteFlyover   case hybridFlyover   case mutedStandard } struct MapView: UIViewRepresentable {   let searchKey: String       let mapType: MapType   func makeUIView(context: Context) -> MKMapView {     return MKMapView()   }       func updateUIView(_ uiView: MKMapView, context: Context) {     switch mapType {     case .standard:       uiView.preferredConfiguration = MKStandardMapConfiguration(elevationStyle: .flat)             case .satellite:       uiView.preferredConfiguration = MKImageryMapConfiguration()     case .hybrid:       uiView.preferredConfiguration = MKHybridMapConfiguration()     case .satelliteFlyover:       uiView.preferredConfiguration = MKImageryMapConfiguration(elevationStyle: .realistic)     case .hybridFlyover:       uiView.preferredConfiguration = MKHybridMapConfiguration(elevationStyle: .realistic)     case .mutedStandard:       uiView.preferredConfiguration = MKStandardMapConfiguration(emphasisStyle: .muted)     }     let geocoder = CLGeocoder()           geocoder.geocodeAddressString(searchKey) { placemarks, error in       if let placemarks,         let firstPlaceMark = placemarks.first ,         let location = firstPlaceMark.location {                   let targetCoordinate = location.coordinate                   print(targetCoordinate)                   let pin = MKPointAnnotation()                   pin.coordinate = targetCoordinate                   pin.title = searchKey         uiView.addAnnotation(pin)         uiView.region = MKCoordinateRegion(center: targetCoordinate,                           latitudinalMeters: 3000.0,                           longitudinalMeters: 3000.0)       }     }   } }
Posted Last updated
.