Skip to content

Instantly share code, notes, and snippets.

@Koshimizu-Takehito
Created February 11, 2025 06:49
Show Gist options
  • Save Koshimizu-Takehito/27827403ba21528f19727d4953572da8 to your computer and use it in GitHub Desktop.
Save Koshimizu-Takehito/27827403ba21528f19727d4953572da8 to your computer and use it in GitHub Desktop.
MonotoneMap
import SwiftUI
import MapKit
struct MonotoneMap: View {
@State var position = MapCameraPosition.region(
MKCoordinateRegion(
center: CLLocationCoordinate2DMake(35.685175, 139.7528),
span: MKCoordinateSpan(latitudeDelta: 0.03, longitudeDelta: 0.03)
)
)
var body: some View {
Map(position: $position)
.overlay {
Rectangle()
.ignoresSafeArea()
.blendMode(.saturation)
.allowsHitTesting(false)
}
.compositingGroup()
.colorScheme(.light)
}
}
#Preview {
MonotoneMap()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment