Created
June 9, 2023 22:00
-
-
Save byaruhaf/513b80744b96979dec573840b40fcb3d to your computer and use it in GitHub Desktop.
Testing out MapKit
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 | |
extension CLLocationCoordinate2D { | |
private static let r1 = CLLocationCoordinate2D(latitude: 0.39693247863763503, longitude: 32.635483516072625) | |
private static let r2 = CLLocationCoordinate2D(latitude: 0.3969011303451089, longitude: 32.635464706645294) | |
private static let r3 = CLLocationCoordinate2D(latitude: 0.396853818673706, longitude: 32.63547246284327) | |
private static let r4 = CLLocationCoordinate2D(latitude: 0.39683210184085765, longitude: 32.63549960953619) | |
private static let r5 = CLLocationCoordinate2D(latitude: 0.39681558174718023, longitude: 32.63555565271399) | |
private static let r6 = CLLocationCoordinate2D(latitude: 0.3967988183431943, longitude: 32.63562002573073) | |
private static let r7 = CLLocationCoordinate2D(latitude: 0.3967719968967302, longitude: 32.63570853862876) | |
// static let home = CLLocationCoordinate2D(latitude: 0.39675322188110373, longitude: 32.63573804292879) | |
static let home = CLLocationCoordinate2D(latitude: 42.354528, longitude: -71.068369) | |
static let road = [r1,r2,r3,r4,r5,r6,r7] | |
} | |
struct ContentView: View { | |
var body: some View { | |
Map { | |
Marker("Home", systemImage: "house.fill", coordinate: .home).tag(0) | |
MapPolyline(coordinates: .road) | |
.stroke(.blue, lineWidth: 13) | |
} | |
.mapStyle(.hybrid(elevation: .realistic)) | |
} | |
} | |
#Preview { | |
ContentView() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment