Mercurial > public > geoquiz
diff GeoQuiz/Helpers/CityMap.swift @ 6:1946bbfde4af
reformat data structures
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 29 Sep 2022 12:00:17 +0200 |
parents | |
children | d945e52b0704 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/Helpers/CityMap.swift Thu Sep 29 12:00:17 2022 +0200 @@ -0,0 +1,31 @@ +// +// CityMap.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 24/9/22. +// + +import SwiftUI +import MapKit + +struct CityMap: View { + @State var region: MKCoordinateRegion + + var body: some View { + Map(coordinateRegion: $region, interactionModes: MapInteractionModes()) + .clipShape(RoundedRectangle(cornerRadius: 20)) + .shadow(radius: 10) + } +} + +struct CityMap_Previews: PreviewProvider { + static var region = MKCoordinateRegion( + center: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), + span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5) + ) + + static var previews: some View { + CityMap(region: region) + .frame(width: 300, height: 300) + } +}