Skip to content

Commit 300614f

Browse files
committed
feat: add mapType
1 parent e32a3f5 commit 300614f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ios/GoogleMapViewImpl.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ final class GoogleMapsViewImpl: UIView, GMSMapViewDelegate {
1717
private var pendingMinZoomLevel: Double?
1818
private var pendingMaxZoomLevel: Double?
1919
private var pendingMapPadding: RNMapPadding?
20+
private var pendingMapType: GMSMapViewType?
2021

2122
private var pendingPolygons: [(id: String, polygon: GMSPolygon)] = []
2223
private var pendingPolylines: [(id: String, polyline: GMSPolyline)] = []
@@ -131,6 +132,10 @@ final class GoogleMapsViewImpl: UIView, GMSMapViewDelegate {
131132
mapView.mapStyle = style
132133
}
133134

135+
if let mapType = pendingMapType {
136+
mapView.mapType = mapType
137+
}
138+
134139
if let buildings = pendingBuildingEnabled {
135140
mapView.isBuildingsEnabled = buildings
136141
}
@@ -266,6 +271,14 @@ final class GoogleMapsViewImpl: UIView, GMSMapViewDelegate {
266271
}
267272
}
268273

274+
@MainActor var mapType: Int32? {
275+
get { pendingMapType.map { Int32($0.rawValue) } }
276+
set {
277+
pendingMapType = GMSMapViewType(rawValue: UInt(newValue ?? 1))
278+
mapView.mapType = pendingMapType ?? .normal
279+
}
280+
}
281+
269282
func setCamera(camera: RNCamera, animated: Bool, durationMS: Double) {
270283
let current = mapView.camera
271284

0 commit comments

Comments
 (0)