Created
October 23, 2024 13:43
-
-
Save takoikatakotako/8ee2e32c38d3bbcd17902c48b2e58427 to your computer and use it in GitHub Desktop.
SwiftUIでMapを表示する
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
| import SwiftUI | |
| import MapKit | |
| struct ContentView: View { | |
| var body: some View { | |
| Map( | |
| initialPosition: | |
| MapCameraPosition.region( | |
| MKCoordinateRegion( | |
| center: CLLocationCoordinate2D(latitude: 35.7005, longitude: 139.7726), | |
| latitudinalMeters: 300, | |
| longitudinalMeters: 300 | |
| ) | |
| ) | |
| ) | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment