react-native-google-maps-plus 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +15 -23
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +33 -9
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +73 -18
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +59 -12
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +47 -12
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +12 -9
- package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngExtension.kt +6 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNCameraExtension.kt +1 -2
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngExtension.kt +6 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +8 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +2 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +1 -0
- package/ios/GoogleMapViewImpl.swift +18 -49
- package/ios/MapCircleBuilder.swift +30 -18
- package/ios/MapMarkerBuilder.swift +64 -20
- package/ios/MapPolygonBuilder.swift +62 -13
- package/ios/MapPolylineBuilder.swift +33 -15
- package/ios/RNGoogleMapsPlusView.swift +10 -8
- package/ios/extensions/CLLocationCoordinate2D+Extension.swift +7 -0
- package/ios/extensions/RNLatLng+Extension.swift +7 -0
- package/ios/extensions/RNMarker+Extension.swift +5 -0
- package/ios/extensions/RNPolygon+Extension.swift.swift +16 -1
- package/ios/extensions/RNPolyline+Extension.swift.swift +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +8 -0
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +29 -2
- package/nitrogen/generated/android/c++/JRNPolygonHole.hpp +72 -0
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +7 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygonHole.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +1 -1
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +16 -16
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +51 -20
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +6 -3
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +7 -56
- package/nitrogen/generated/ios/swift/RNCamera.swift +1 -8
- package/nitrogen/generated/ios/swift/RNHeatmap.swift +1 -8
- package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +11 -15
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +1 -8
- package/nitrogen/generated/ios/swift/RNLocationConfig.swift +2 -16
- package/nitrogen/generated/ios/swift/RNMarker.swift +47 -15
- package/nitrogen/generated/ios/swift/RNPolygon.swift +66 -1
- package/nitrogen/generated/ios/swift/RNPolygonHole.swift +47 -0
- package/nitrogen/generated/ios/swift/RNPolyline.swift +24 -1
- package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +1 -8
- package/nitrogen/generated/shared/c++/RNAndroidLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNCamera.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNCircle.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmap.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmapGradient.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmapPoint.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIndoorBuilding.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIndoorLevel.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNKMLayer.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLatLng.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLatLngBounds.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLocation.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLocationPermissionResult.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapPadding.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapUiSettings.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapZoomConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +17 -1
- package/nitrogen/generated/shared/c++/RNMarkerSvg.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +21 -2
- package/nitrogen/generated/shared/c++/RNPolygonHole.hpp +77 -0
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +13 -1
- package/nitrogen/generated/shared/c++/RNPosition.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNRegion.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNSize.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNSnapshotOptions.hpp +8 -0
- package/package.json +4 -4
- package/src/types.ts +9 -0
|
@@ -62,17 +62,12 @@ GMSIndoorDisplayDelegate {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
@MainActor
|
|
65
|
-
func initMapView(
|
|
65
|
+
func initMapView(googleMapOptions: GMSMapViewOptions) {
|
|
66
66
|
if initialized { return }
|
|
67
67
|
initialized = true
|
|
68
|
-
|
|
69
|
-
options.frame = bounds
|
|
68
|
+
googleMapOptions.frame = bounds
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
liteMode.map { _ in /* not supported */ }
|
|
73
|
-
camera.map { options.camera = $0 }
|
|
74
|
-
|
|
75
|
-
mapView = GMSMapView.init(options: options)
|
|
70
|
+
mapView = GMSMapView.init(options: googleMapOptions)
|
|
76
71
|
mapView?.delegate = self
|
|
77
72
|
mapView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
78
73
|
mapView?.paddingAdjustmentBehavior = .never
|
|
@@ -93,10 +88,7 @@ GMSIndoorDisplayDelegate {
|
|
|
93
88
|
!= loc.coordinate.longitude {
|
|
94
89
|
self.onLocationUpdate?(
|
|
95
90
|
RNLocation(
|
|
96
|
-
|
|
97
|
-
latitude: loc.coordinate.latitude,
|
|
98
|
-
longitude: loc.coordinate.longitude
|
|
99
|
-
),
|
|
91
|
+
loc.coordinate.toRNLatLng(),
|
|
100
92
|
loc.course
|
|
101
93
|
)
|
|
102
94
|
)
|
|
@@ -348,27 +340,16 @@ GMSIndoorDisplayDelegate {
|
|
|
348
340
|
animated: Bool,
|
|
349
341
|
durationMs: Double
|
|
350
342
|
) {
|
|
351
|
-
|
|
343
|
+
guard let firstCoordinates = coordinates.first else {
|
|
352
344
|
return
|
|
353
345
|
}
|
|
354
346
|
var bounds = GMSCoordinateBounds(
|
|
355
|
-
coordinate:
|
|
356
|
-
|
|
357
|
-
longitude: coordinates[0].longitude
|
|
358
|
-
),
|
|
359
|
-
coordinate: CLLocationCoordinate2D(
|
|
360
|
-
latitude: coordinates[0].latitude,
|
|
361
|
-
longitude: coordinates[0].longitude
|
|
362
|
-
)
|
|
347
|
+
coordinate: firstCoordinates.toCLLocationCoordinate2D(),
|
|
348
|
+
coordinate: firstCoordinates.toCLLocationCoordinate2D()
|
|
363
349
|
)
|
|
364
350
|
|
|
365
351
|
for coord in coordinates.dropFirst() {
|
|
366
|
-
bounds = bounds.includingCoordinate(
|
|
367
|
-
CLLocationCoordinate2D(
|
|
368
|
-
latitude: coord.latitude,
|
|
369
|
-
longitude: coord.longitude
|
|
370
|
-
)
|
|
371
|
-
)
|
|
352
|
+
bounds = bounds.includingCoordinate(coord.toCLLocationCoordinate2D())
|
|
372
353
|
}
|
|
373
354
|
|
|
374
355
|
let insets = UIEdgeInsets(
|
|
@@ -736,15 +717,12 @@ GMSIndoorDisplayDelegate {
|
|
|
736
717
|
|
|
737
718
|
let cp = mapView.camera
|
|
738
719
|
let region = RNRegion(
|
|
739
|
-
center:
|
|
720
|
+
center: center.toRNLatLng(),
|
|
740
721
|
latitudeDelta: latDelta,
|
|
741
722
|
longitudeDelta: lngDelta
|
|
742
723
|
)
|
|
743
724
|
let cam = RNCamera(
|
|
744
|
-
center:
|
|
745
|
-
latitude: cp.target.latitude,
|
|
746
|
-
longitude: cp.target.longitude
|
|
747
|
-
),
|
|
725
|
+
center: cp.target.toRNLatLng(),
|
|
748
726
|
zoom: Double(cp.zoom),
|
|
749
727
|
bearing: cp.bearing,
|
|
750
728
|
tilt: cp.viewingAngle
|
|
@@ -781,15 +759,12 @@ GMSIndoorDisplayDelegate {
|
|
|
781
759
|
|
|
782
760
|
let cp = mapView.camera
|
|
783
761
|
let region = RNRegion(
|
|
784
|
-
center:
|
|
762
|
+
center: center.toRNLatLng(),
|
|
785
763
|
latitudeDelta: latDelta,
|
|
786
764
|
longitudeDelta: lngDelta
|
|
787
765
|
)
|
|
788
766
|
let cam = RNCamera(
|
|
789
|
-
center:
|
|
790
|
-
latitude: cp.target.latitude,
|
|
791
|
-
longitude: cp.target.longitude
|
|
792
|
-
),
|
|
767
|
+
center: cp.target.toRNLatLng(),
|
|
793
768
|
zoom: Double(cp.zoom),
|
|
794
769
|
bearing: cp.bearing,
|
|
795
770
|
tilt: cp.viewingAngle
|
|
@@ -814,15 +789,12 @@ GMSIndoorDisplayDelegate {
|
|
|
814
789
|
|
|
815
790
|
let cp = mapView.camera
|
|
816
791
|
let region = RNRegion(
|
|
817
|
-
center:
|
|
792
|
+
center: center.toRNLatLng(),
|
|
818
793
|
latitudeDelta: latDelta,
|
|
819
794
|
longitudeDelta: lngDelta
|
|
820
795
|
)
|
|
821
796
|
let cam = RNCamera(
|
|
822
|
-
center:
|
|
823
|
-
latitude: cp.target.latitude,
|
|
824
|
-
longitude: cp.target.longitude
|
|
825
|
-
),
|
|
797
|
+
center: cp.target.toRNLatLng(),
|
|
826
798
|
zoom: Double(cp.zoom),
|
|
827
799
|
bearing: cp.bearing,
|
|
828
800
|
tilt: cp.viewingAngle
|
|
@@ -837,10 +809,7 @@ GMSIndoorDisplayDelegate {
|
|
|
837
809
|
) {
|
|
838
810
|
onMain {
|
|
839
811
|
self.onMapPress?(
|
|
840
|
-
|
|
841
|
-
latitude: coordinate.latitude,
|
|
842
|
-
longitude: coordinate.longitude
|
|
843
|
-
)
|
|
812
|
+
coordinate.toRNLatLng(),
|
|
844
813
|
)
|
|
845
814
|
}
|
|
846
815
|
}
|
|
@@ -875,7 +844,7 @@ GMSIndoorDisplayDelegate {
|
|
|
875
844
|
onMain {
|
|
876
845
|
self.onMarkerDragStart?(
|
|
877
846
|
marker.userData as? String,
|
|
878
|
-
|
|
847
|
+
marker.position.toRNLatLng()
|
|
879
848
|
)
|
|
880
849
|
}
|
|
881
850
|
}
|
|
@@ -884,7 +853,7 @@ GMSIndoorDisplayDelegate {
|
|
|
884
853
|
onMain {
|
|
885
854
|
self.onMarkerDrag?(
|
|
886
855
|
marker.userData as? String,
|
|
887
|
-
|
|
856
|
+
marker.position.toRNLatLng()
|
|
888
857
|
)
|
|
889
858
|
}
|
|
890
859
|
}
|
|
@@ -893,7 +862,7 @@ GMSIndoorDisplayDelegate {
|
|
|
893
862
|
onMain {
|
|
894
863
|
self.onMarkerDragEnd?(
|
|
895
864
|
marker.userData as? String,
|
|
896
|
-
|
|
865
|
+
marker.position.toRNLatLng()
|
|
897
866
|
)
|
|
898
867
|
}
|
|
899
868
|
}
|
|
@@ -3,11 +3,7 @@ import GoogleMaps
|
|
|
3
3
|
final class MapCircleBuilder {
|
|
4
4
|
func build(_ c: RNCircle) -> GMSCircle {
|
|
5
5
|
let circle = GMSCircle()
|
|
6
|
-
circle.position =
|
|
7
|
-
latitude: c.center.latitude,
|
|
8
|
-
longitude: c.center.longitude
|
|
9
|
-
)
|
|
10
|
-
|
|
6
|
+
circle.position = c.center.toCLLocationCoordinate2D()
|
|
11
7
|
circle.radius = c.radius
|
|
12
8
|
c.fillColor.map { circle.fillColor = $0.toUIColor() }
|
|
13
9
|
c.strokeColor.map { circle.strokeColor = $0.toUIColor() }
|
|
@@ -18,18 +14,34 @@ final class MapCircleBuilder {
|
|
|
18
14
|
return circle
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
func update(_ next: RNCircle, _ c: GMSCircle) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
func update(_ prev: RNCircle, _ next: RNCircle, _ c: GMSCircle) {
|
|
18
|
+
if prev.center.latitude != next.center.latitude
|
|
19
|
+
|| prev.center.longitude != next.center.longitude {
|
|
20
|
+
c.position = next.center.toCLLocationCoordinate2D()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if prev.radius != next.radius {
|
|
24
|
+
c.radius = next.radius ?? 0
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if prev.fillColor != next.fillColor {
|
|
28
|
+
c.fillColor = next.fillColor?.toUIColor() ?? .clear
|
|
29
|
+
}
|
|
34
30
|
|
|
31
|
+
if prev.strokeColor != next.strokeColor {
|
|
32
|
+
c.strokeColor = next.strokeColor?.toUIColor() ?? .black
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if prev.strokeWidth != next.strokeWidth {
|
|
36
|
+
c.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if prev.pressable != next.pressable {
|
|
40
|
+
c.isTappable = next.pressable ?? false
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if prev.zIndex != next.zIndex {
|
|
44
|
+
c.zIndex = Int32(next.zIndex ?? 0)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
35
47
|
}
|
|
@@ -13,10 +13,7 @@ final class MapMarkerBuilder {
|
|
|
13
13
|
|
|
14
14
|
func build(_ m: RNMarker, icon: UIImage?) -> GMSMarker {
|
|
15
15
|
let marker = GMSMarker(
|
|
16
|
-
position:
|
|
17
|
-
latitude: m.coordinate.latitude,
|
|
18
|
-
longitude: m.coordinate.longitude
|
|
19
|
-
)
|
|
16
|
+
position: m.coordinate.toCLLocationCoordinate2D()
|
|
20
17
|
)
|
|
21
18
|
marker.userData = m.id
|
|
22
19
|
marker.tracksViewChanges = true
|
|
@@ -26,6 +23,10 @@ final class MapMarkerBuilder {
|
|
|
26
23
|
m.opacity.map { marker.iconView?.alpha = CGFloat($0) }
|
|
27
24
|
m.flat.map { marker.isFlat = $0 }
|
|
28
25
|
m.draggable.map { marker.isDraggable = $0 }
|
|
26
|
+
m.rotation.map { marker.rotation = $0 }
|
|
27
|
+
m.infoWindowAnchor.map {
|
|
28
|
+
marker.infoWindowAnchor = CGPoint(x: $0.x, y: $0.y)
|
|
29
|
+
}
|
|
29
30
|
m.anchor.map {
|
|
30
31
|
marker.groundAnchor = CGPoint(
|
|
31
32
|
x: $0.x,
|
|
@@ -43,30 +44,58 @@ final class MapMarkerBuilder {
|
|
|
43
44
|
|
|
44
45
|
@MainActor
|
|
45
46
|
func update(_ prev: RNMarker, _ next: RNMarker, _ m: GMSMarker) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
if prev.coordinate.latitude != next.coordinate.latitude
|
|
48
|
+
|| prev.coordinate.longitude != next.coordinate.longitude {
|
|
49
|
+
m.position = next.coordinate.toCLLocationCoordinate2D()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if prev.title != next.title {
|
|
53
|
+
m.title = next.title
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if prev.snippet != next.snippet {
|
|
57
|
+
m.snippet = next.snippet
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if prev.opacity != next.opacity {
|
|
61
|
+
let opacity = Float(next.opacity ?? 1)
|
|
62
|
+
m.opacity = opacity
|
|
63
|
+
m.iconView?.alpha = CGFloat(opacity)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if prev.flat != next.flat {
|
|
67
|
+
m.isFlat = next.flat ?? false
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if prev.draggable != next.draggable {
|
|
71
|
+
m.isDraggable = next.draggable ?? false
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if prev.rotation != next.rotation {
|
|
75
|
+
m.rotation = next.rotation ?? 0
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if prev.zIndex != next.zIndex {
|
|
79
|
+
m.zIndex = Int32(next.zIndex ?? 0)
|
|
80
|
+
}
|
|
50
81
|
|
|
51
|
-
m.title = next.title
|
|
52
|
-
m.snippet = next.snippet
|
|
53
|
-
m.iconView?.alpha = CGFloat(next.opacity ?? 0)
|
|
54
|
-
m.isFlat = next.flat ?? false
|
|
55
|
-
m.isDraggable = next.draggable ?? false
|
|
56
|
-
m.zIndex = Int32(next.zIndex ?? 0)
|
|
57
|
-
m.groundAnchor = CGPoint(
|
|
58
|
-
x: next.anchor?.x ?? 0.5,
|
|
59
|
-
y: next.anchor?.y ?? 1
|
|
60
|
-
)
|
|
61
82
|
if !prev.markerStyleEquals(next) {
|
|
62
83
|
buildIconAsync(next.id, next) { img in
|
|
63
84
|
m.tracksViewChanges = true
|
|
64
85
|
m.icon = img
|
|
65
86
|
|
|
66
|
-
if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y
|
|
87
|
+
if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y{
|
|
67
88
|
m.groundAnchor = CGPoint(
|
|
68
89
|
x: next.anchor?.x ?? 0.5,
|
|
69
|
-
y: next.anchor?.y ??
|
|
90
|
+
y: next.anchor?.y ?? 1
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x
|
|
95
|
+
|| prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y {
|
|
96
|
+
m.infoWindowAnchor = CGPoint(
|
|
97
|
+
x: next.infoWindowAnchor?.x ?? 0.5,
|
|
98
|
+
y: next.infoWindowAnchor?.y ?? 0
|
|
70
99
|
)
|
|
71
100
|
}
|
|
72
101
|
|
|
@@ -74,6 +103,21 @@ final class MapMarkerBuilder {
|
|
|
74
103
|
m?.tracksViewChanges = false
|
|
75
104
|
}
|
|
76
105
|
}
|
|
106
|
+
} else {
|
|
107
|
+
if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y{
|
|
108
|
+
m.groundAnchor = CGPoint(
|
|
109
|
+
x: next.anchor?.x ?? 0.5,
|
|
110
|
+
y: next.anchor?.y ?? 1
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x
|
|
115
|
+
|| prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y {
|
|
116
|
+
m.infoWindowAnchor = CGPoint(
|
|
117
|
+
x: next.infoWindowAnchor?.x ?? 0.5,
|
|
118
|
+
y: next.infoWindowAnchor?.y ?? 0
|
|
119
|
+
)
|
|
120
|
+
}
|
|
77
121
|
}
|
|
78
122
|
}
|
|
79
123
|
|
|
@@ -5,7 +5,7 @@ final class MapPolygonBuilder {
|
|
|
5
5
|
let path = GMSMutablePath()
|
|
6
6
|
p.coordinates.forEach {
|
|
7
7
|
path.add(
|
|
8
|
-
|
|
8
|
+
$0.toCLLocationCoordinate2D()
|
|
9
9
|
)
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -15,24 +15,73 @@ final class MapPolygonBuilder {
|
|
|
15
15
|
p.strokeColor.map { pg.strokeColor = $0.toUIColor() }
|
|
16
16
|
p.strokeWidth.map { pg.strokeWidth = CGFloat($0) }
|
|
17
17
|
p.pressable.map { pg.isTappable = $0 }
|
|
18
|
+
p.geodesic.map { pg.geodesic = $0 }
|
|
19
|
+
p.holes.map {
|
|
20
|
+
pg.holes = $0.map { hole in
|
|
21
|
+
let path = GMSMutablePath()
|
|
22
|
+
hole.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
|
|
23
|
+
return path
|
|
24
|
+
}
|
|
25
|
+
}
|
|
18
26
|
p.zIndex.map { pg.zIndex = Int32($0) }
|
|
19
27
|
|
|
20
28
|
return pg
|
|
21
29
|
}
|
|
22
30
|
|
|
23
|
-
func update(_ next: RNPolygon, _ pg: GMSPolygon) {
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
func update(_ prev: RNPolygon, _ next: RNPolygon, _ pg: GMSPolygon) {
|
|
32
|
+
let coordsChanged =
|
|
33
|
+
prev.coordinates.count != next.coordinates.count
|
|
34
|
+
|| !zip(prev.coordinates, next.coordinates).allSatisfy {
|
|
35
|
+
$0.latitude == $1.latitude && $0.longitude == $1.longitude
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if coordsChanged {
|
|
39
|
+
let path = GMSMutablePath()
|
|
40
|
+
next.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
|
|
41
|
+
pg.path = path
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let prevHoles = prev.holes ?? []
|
|
45
|
+
let nextHoles = next.holes ?? []
|
|
46
|
+
let holesChanged =
|
|
47
|
+
prevHoles.count != nextHoles.count
|
|
48
|
+
|| !zip(prevHoles, nextHoles).allSatisfy { a, b in
|
|
49
|
+
a.coordinates.count == b.coordinates.count
|
|
50
|
+
&& zip(a.coordinates, b.coordinates).allSatisfy {
|
|
51
|
+
$0.latitude == $1.latitude && $0.longitude == $1.longitude
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if holesChanged {
|
|
56
|
+
pg.holes = nextHoles.map { hole in
|
|
57
|
+
let path = GMSMutablePath()
|
|
58
|
+
hole.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
|
|
59
|
+
return path
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if prev.fillColor != next.fillColor {
|
|
64
|
+
pg.fillColor = next.fillColor?.toUIColor() ?? .clear
|
|
29
65
|
}
|
|
30
|
-
pg.path = path
|
|
31
66
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
67
|
+
if prev.strokeColor != next.strokeColor {
|
|
68
|
+
pg.strokeColor = next.strokeColor?.toUIColor() ?? .black
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if prev.strokeWidth != next.strokeWidth {
|
|
72
|
+
pg.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if prev.pressable != next.pressable {
|
|
76
|
+
pg.isTappable = next.pressable ?? false
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if prev.geodesic != next.geodesic {
|
|
80
|
+
pg.geodesic = next.geodesic ?? false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if prev.zIndex != next.zIndex {
|
|
84
|
+
pg.zIndex = Int32(next.zIndex ?? 0)
|
|
85
|
+
}
|
|
37
86
|
}
|
|
38
87
|
}
|
|
@@ -5,7 +5,7 @@ final class MapPolylineBuilder {
|
|
|
5
5
|
let path = GMSMutablePath()
|
|
6
6
|
p.coordinates.forEach {
|
|
7
7
|
path.add(
|
|
8
|
-
|
|
8
|
+
$0.toCLLocationCoordinate2D()
|
|
9
9
|
)
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,25 +16,43 @@ final class MapPolylineBuilder {
|
|
|
16
16
|
p.lineCap.map { _ in /* not supported */ }
|
|
17
17
|
p.lineJoin.map { _ in /* not supported */ }
|
|
18
18
|
p.pressable.map { pl.isTappable = $0 }
|
|
19
|
+
p.geodesic.map { pl.geodesic = $0 }
|
|
19
20
|
p.zIndex.map { pl.zIndex = Int32($0) }
|
|
20
21
|
|
|
21
22
|
return pl
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
func update(_ next: RNPolyline, _ pl: GMSPolyline) {
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
func update(_ prev: RNPolyline, _ next: RNPolyline, _ pl: GMSPolyline) {
|
|
26
|
+
let coordsChanged =
|
|
27
|
+
prev.coordinates.count != next.coordinates.count
|
|
28
|
+
|| !zip(prev.coordinates, next.coordinates).allSatisfy {
|
|
29
|
+
$0.latitude == $1.latitude && $0.longitude == $1.longitude
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if coordsChanged {
|
|
33
|
+
let path = GMSMutablePath()
|
|
34
|
+
next.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
|
|
35
|
+
pl.path = path
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if prev.width != next.width {
|
|
39
|
+
pl.strokeWidth = CGFloat(next.width ?? 1.0)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if prev.color != next.color {
|
|
43
|
+
pl.strokeColor = next.color?.toUIColor() ?? .black
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if prev.pressable != next.pressable {
|
|
47
|
+
pl.isTappable = next.pressable ?? false
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if prev.geodesic != next.geodesic {
|
|
51
|
+
pl.geodesic = next.geodesic ?? false
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if prev.zIndex != next.zIndex {
|
|
55
|
+
pl.zIndex = Int32(next.zIndex ?? 0)
|
|
30
56
|
}
|
|
31
|
-
pl.path = path
|
|
32
|
-
|
|
33
|
-
/* lineCap not supported */
|
|
34
|
-
/* lineJoin not supported */
|
|
35
|
-
pl.strokeWidth = CGFloat(next.width ?? 1.0)
|
|
36
|
-
pl.strokeColor = next.color?.toUIColor() ?? .black
|
|
37
|
-
pl.isTappable = next.pressable ?? false
|
|
38
|
-
pl.zIndex = Int32(next.zIndex ?? 0)
|
|
39
57
|
}
|
|
40
58
|
}
|
|
@@ -34,11 +34,13 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
34
34
|
if !propsInitialized {
|
|
35
35
|
propsInitialized = true
|
|
36
36
|
Task { @MainActor in
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
let options = GMSMapViewOptions()
|
|
38
|
+
initialProps?.mapId.map { options.mapID = GMSMapID(identifier: $0) }
|
|
39
|
+
initialProps?.liteMode.map { _ in /* not supported */ }
|
|
40
|
+
initialProps?.camera.map {
|
|
41
|
+
options.camera = $0.toGMSCameraPosition(current: nil)
|
|
42
|
+
}
|
|
43
|
+
impl.initMapView(googleMapOptions: options)
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -167,7 +169,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
167
169
|
if let prev = prevById[id] {
|
|
168
170
|
if !prev.polylineEquals(next) {
|
|
169
171
|
impl.updatePolyline(id: id) { pl in
|
|
170
|
-
self.polylineBuilder.update(next, pl)
|
|
172
|
+
self.polylineBuilder.update(prev, next, pl)
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
} else {
|
|
@@ -199,7 +201,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
199
201
|
if let prev = prevById[id] {
|
|
200
202
|
if !prev.polygonEquals(next) {
|
|
201
203
|
impl.updatePolygon(id: id) { pg in
|
|
202
|
-
self.polygonBuilder.update(next, pg)
|
|
204
|
+
self.polygonBuilder.update(prev, next, pg)
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
} else {
|
|
@@ -228,7 +230,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
228
230
|
if let prev = prevById[id] {
|
|
229
231
|
if !prev.circleEquals(next) {
|
|
230
232
|
impl.updateCircle(id: id) { circle in
|
|
231
|
-
self.circleBuilder.update(next, circle)
|
|
233
|
+
self.circleBuilder.update(prev, next, circle)
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
} else {
|
|
@@ -6,6 +6,11 @@ extension RNMarker {
|
|
|
6
6
|
&& coordinate.latitude == b.coordinate.latitude
|
|
7
7
|
&& coordinate.longitude == b.coordinate.longitude
|
|
8
8
|
&& anchor?.x == b.anchor?.x && anchor?.y == b.anchor?.y
|
|
9
|
+
&& showInfoWindow == b.showInfoWindow && title == b.title
|
|
10
|
+
&& snippet == b.snippet && opacity == b.opacity && flat == b.flat
|
|
11
|
+
&& draggable == b.draggable && rotation == b.rotation
|
|
12
|
+
&& infoWindowAnchor?.x == b.infoWindowAnchor?.x
|
|
13
|
+
&& infoWindowAnchor?.y == b.infoWindowAnchor?.y
|
|
9
14
|
&& markerStyleEquals(b)
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -7,7 +7,9 @@ extension RNPolygon {
|
|
|
7
7
|
strokeWidth == b.strokeWidth,
|
|
8
8
|
fillColor == b.fillColor,
|
|
9
9
|
strokeColor == b.strokeColor,
|
|
10
|
-
|
|
10
|
+
geodesic == b.geodesic,
|
|
11
|
+
coordinates.count == b.coordinates.count,
|
|
12
|
+
holes?.count == b.holes?.count
|
|
11
13
|
else { return false }
|
|
12
14
|
|
|
13
15
|
for i in 0..<coordinates.count {
|
|
@@ -17,6 +19,19 @@ extension RNPolygon {
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
for i in 0..<(holes?.count ?? 0) {
|
|
23
|
+
let ha = holes![i]
|
|
24
|
+
let hb = b.holes![i]
|
|
25
|
+
if ha.coordinates.count != hb.coordinates.count { return false }
|
|
26
|
+
|
|
27
|
+
for j in 0..<ha.coordinates.count {
|
|
28
|
+
if ha.coordinates[j].latitude != hb.coordinates[j].latitude
|
|
29
|
+
|| ha.coordinates[j].longitude != hb.coordinates[j].longitude {
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
20
35
|
return true
|
|
21
36
|
}
|
|
22
37
|
}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNAndroidLocationPriority","RNIOSLocationAccuracy","RNAndroidLocationPermissionResult","RNIOSPermissionResult","RNLocationErrorCode","RNMapErrorCode"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAgEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["RNAndroidLocationPriority","RNIOSLocationAccuracy","RNAndroidLocationPermissionResult","RNIOSPermissionResult","RNLocationErrorCode","RNMapErrorCode"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAgEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AA4JA,WAAYA,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB,CAAzBA,yBAAyB;EAAzBA,yBAAyB,CAAzBA,yBAAyB;EAAzBA,yBAAyB,CAAzBA,yBAAyB;EAAzBA,yBAAyB,CAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAYrC,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAYjC,WAAYC,iCAAiC,0BAAjCA,iCAAiC;EAAjCA,iCAAiC,CAAjCA,iCAAiC;EAAjCA,iCAAiC,CAAjCA,iCAAiC;EAAjCA,iCAAiC,CAAjCA,iCAAiC;EAAA,OAAjCA,iCAAiC;AAAA;AAM7C,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAUjC,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAS/B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -96,6 +96,8 @@ export type RNMarker = {
|
|
|
96
96
|
opacity?: number;
|
|
97
97
|
flat?: boolean;
|
|
98
98
|
draggable?: boolean;
|
|
99
|
+
rotation?: number;
|
|
100
|
+
infoWindowAnchor?: RNPosition;
|
|
99
101
|
iconSvg?: RNMarkerSvg;
|
|
100
102
|
};
|
|
101
103
|
export type RNMarkerSvg = {
|
|
@@ -111,6 +113,11 @@ export type RNPolygon = {
|
|
|
111
113
|
fillColor?: string;
|
|
112
114
|
strokeColor?: string;
|
|
113
115
|
strokeWidth?: number;
|
|
116
|
+
holes?: RNPolygonHole[];
|
|
117
|
+
geodesic?: boolean;
|
|
118
|
+
};
|
|
119
|
+
export type RNPolygonHole = {
|
|
120
|
+
coordinates: RNLatLng[];
|
|
114
121
|
};
|
|
115
122
|
export type RNPolyline = {
|
|
116
123
|
id: string;
|
|
@@ -119,6 +126,7 @@ export type RNPolyline = {
|
|
|
119
126
|
coordinates: RNLatLng[];
|
|
120
127
|
lineCap?: RNLineCapType;
|
|
121
128
|
lineJoin?: RNLineJoinType;
|
|
129
|
+
geodesic?: boolean;
|
|
122
130
|
color?: string;
|
|
123
131
|
width?: number;
|
|
124
132
|
};
|