The easiest way to explain this is to show it. On any device, open Maps, set it to Driving (which will show traffic). Go to Baltimore Maryland. In the water just south east of the city there is a bridge (Francis Scott Key Bridge). <the bridge was hit by a ship and the whole bridge fell into the water last year>. On Apple Maps the road is colored dark red.
At certain zoom levels, there is a "button" (red circle with a white - in it). When you click on that "button", it says 1 Advisory (Road Closed).
How do I show this "button" on my map. My map shows the dark red color, but no "button" appears.
The only "advisory" that I've been able to find is when you create a route. Of course you can't create a route over a road that fell into the water.
struct ContentView: View {
@State private var position = MapCameraPosition.region(
MKCoordinateRegion(
center: CLLocationCoordinate2D(latitude: 39.22742855118304, longitude: -76.52228412310761),
span: MKCoordinateSpan(latitudeDelta: 0.05407607689684113, longitudeDelta: 0.04606660133347873)
)
)
var body: some View {
Map(position: $position)
.mapStyle(.standard(pointsOfInterest: .all, showsTraffic: true))
.cornerRadius(25)
}
}
Is this a WCDWAD, or is there a way to show the "button" (We Can't Do What Apple Does)
I take it from your description that you're looking for the showsTraffic
configuration to include all annotation and incident details, as found in the Apple Maps app. There isn't an API that will provide your app with live traffic incident annotations, but if you'd like us to consider adding such an API in the future, please open an enhancement request, and let us know what you'd like to do and what use cases you have in mind.
— Ed Ford, DTS Engineer