also looking at this
feat(maps): add key-free native Android maps and shared map controls
#363
28 files
+1857
-481
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -709,7 +709,9 @@ final class NativeRenderUnitTests: XCTestCase { | ||
| 709 | 709 | XCTAssertEqual(map.camera.pitch, 30, accuracy: 1) |
| 710 | 710 | let annotation = try XCTUnwrap(map.annotations.first) |
| 711 | 711 | let marker = try XCTUnwrap(map.delegate?.mapView?(map, viewFor: annotation)) |
| 712 | XCTAssertNotNil(marker.image) | |
| 712 | let image = try XCTUnwrap(marker.image) | |
| 713 | XCTAssertEqual(image.renderingMode, .alwaysOriginal, "MapKit must preserve the arrow's contrasting palette") | |
| 714 | XCTAssertLessThanOrEqual(image.size.width, 24, "Direction signs must leave the route visible in compact maps") | |
| 713 | 715 | XCTAssertEqual(marker.accessibilityIdentifier, "direction") |
| 714 | 716 | XCTAssertEqual(marker.transform.b, 1, accuracy: 0.02) |
| 715 | 717 | } |
| @@ -1411,9 +1411,12 @@ private final class CraftNativeMapView: MKMapView, MKMapViewDelegate { | ||
| 1411 | 1411 | |
| 1412 | 1412 | private func configureMarkerView(_ view: MKAnnotationView, id: String) { |
| 1413 | 1413 | if let bearing = markerBearings[id] { |
| 1414 | let configuration = UIImage.SymbolConfiguration(pointSize: 24, weight: .semibold) | |
| 1414 | let configuration = UIImage.SymbolConfiguration(pointSize: 16, weight: .semibold) | |
| 1415 | 1415 | .applying(UIImage.SymbolConfiguration(paletteColors: [.white, .systemGreen])) |
| 1416 | view.image = UIImage(systemName: "arrow.up.circle.fill", withConfiguration: configuration) | |
| 1416 | // MapKit otherwise tints this as a monochrome template and loses | |
| 1417 | // the contrasting route arrow when displayed over map content. | |
| 1418 | view.image = UIImage(systemName: "arrow.up.circle.fill", withConfiguration: configuration)? | |
| 1419 | .withRenderingMode(.alwaysOriginal) | |
| 1417 | 1420 | view.transform = CGAffineTransform(rotationAngle: CGFloat((bearing - camera.heading) * .pi / 180)) |
| 1418 | 1421 | } else { |
| 1419 | 1422 | view.image = UIImage(systemName: "mappin.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 28))? |