Post

Replies

Boosts

Views

Activity

Black border around elements in icon composer
I noticed in the PNG export of my icon in icon composer that there is a border around a layer of my icon. This doesn’t show up in the in app preview, but only when exported. My icon composer file is here: https://github.com/user-attachments/files/28973433/rootshell.27.zip This is the 1024@2x exported image https://private-user-images.githubusercontent.com/65378120/608158382-7b2a8e59-9822-465b-95d0-1dc624d6a617.png
1
0
35
1h
Random Look Around Coordinates
I want to generate randomised MKLookAroundScene for my world exploration app (think geogussr functionality). How can i achieve that with MapKit? I have tried struct LookAroundView: View { @State private var lookAroundScene: MKLookAroundScene? @State private var yOffset: CGFloat = 0 func generateRandomCoordinate() { let minLatitude = -90.0 let maxLatitude = 90.0 let minLongitude = -180.0 let maxLongitude = 180.0 let randomCoordinate = CLLocationCoordinate2D( latitude: Double.random(in: minLatitude...maxLatitude), longitude: Double.random(in: minLongitude...maxLongitude) ) checkLookAroundAvailability(coordinate: randomCoordinate) } func checkLookAroundAvailability(coordinate: CLLocationCoordinate2D) { Task { let request = MKLookAroundSceneRequest(coordinate: coordinate) if let scene = try? await request.scene { DispatchQueue.main.async { self.lookAroundScene = scene } } else { generateRandomCoordinate() } } } var body: some View { Group { if let scene = lookAroundScene { LookAroundPreview(initialScene: scene) } else { Button(action: { generateRandomCoordinate() }) { Text("Generate Random Coordinate") } .offset(y: yOffset) } } } } but it didn't work. I put the yOffset change there to debug, and it seems that self.lookAroundScene = scene never gets executed. If there are any other options, please let me know!
1
1
831
Dec ’23
Black border around elements in icon composer
I noticed in the PNG export of my icon in icon composer that there is a border around a layer of my icon. This doesn’t show up in the in app preview, but only when exported. My icon composer file is here: https://github.com/user-attachments/files/28973433/rootshell.27.zip This is the 1024@2x exported image https://private-user-images.githubusercontent.com/65378120/608158382-7b2a8e59-9822-465b-95d0-1dc624d6a617.png
Replies
1
Boosts
0
Views
35
Activity
1h
Random Look Around Coordinates
I want to generate randomised MKLookAroundScene for my world exploration app (think geogussr functionality). How can i achieve that with MapKit? I have tried struct LookAroundView: View { @State private var lookAroundScene: MKLookAroundScene? @State private var yOffset: CGFloat = 0 func generateRandomCoordinate() { let minLatitude = -90.0 let maxLatitude = 90.0 let minLongitude = -180.0 let maxLongitude = 180.0 let randomCoordinate = CLLocationCoordinate2D( latitude: Double.random(in: minLatitude...maxLatitude), longitude: Double.random(in: minLongitude...maxLongitude) ) checkLookAroundAvailability(coordinate: randomCoordinate) } func checkLookAroundAvailability(coordinate: CLLocationCoordinate2D) { Task { let request = MKLookAroundSceneRequest(coordinate: coordinate) if let scene = try? await request.scene { DispatchQueue.main.async { self.lookAroundScene = scene } } else { generateRandomCoordinate() } } } var body: some View { Group { if let scene = lookAroundScene { LookAroundPreview(initialScene: scene) } else { Button(action: { generateRandomCoordinate() }) { Text("Generate Random Coordinate") } .offset(y: yOffset) } } } } but it didn't work. I put the yOffset change there to debug, and it seems that self.lookAroundScene = scene never gets executed. If there are any other options, please let me know!
Replies
1
Boosts
1
Views
831
Activity
Dec ’23
MapKit hide the current location label at the bottom of the Look Around View
I want to hide the bottom location label of the look around view. I'm using a LookAroundPreview to display it in the view, because if i used the controller, it will return a NSView instead of a View.
Replies
0
Boosts
1
Views
546
Activity
Nov ’23