react-native-maps 1.28.2 → 1.29.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.
Files changed (42) hide show
  1. package/android/src/main/java/com/rnmaps/maps/MapGradientPolyline.java +4 -0
  2. package/android/src/main/java/com/rnmaps/maps/MapHeatmap.java +4 -0
  3. package/android/src/main/java/com/rnmaps/maps/MapLocalTile.java +4 -0
  4. package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +4 -0
  5. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
  6. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +2 -0
  7. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +175 -0
  8. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +157 -0
  9. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +183 -0
  10. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +431 -0
  11. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +2 -0
  12. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +22 -0
  13. package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +4 -0
  14. package/dist/src/specs/NativeComponentGoogleMarker.d.ts +250 -0
  15. package/dist/src/specs/NativeComponentPolygon.d.ts +108 -0
  16. package/dist/tsconfig.build.tsbuildinfo +1 -1
  17. package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +3 -0
  18. package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -2
  19. package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +8 -0
  20. package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.h +28 -0
  21. package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.mm +357 -0
  22. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.h +24 -0
  23. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.mm +64 -0
  24. package/ios/AirMaps/RNMapsMapView.mm +8 -0
  25. package/ios/AirMaps/RNMapsPolygonView.h +26 -0
  26. package/ios/AirMaps/RNMapsPolygonView.mm +240 -0
  27. package/ios/generated/RCTThirdPartyComponentsProvider.mm +2 -0
  28. package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
  29. package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +2 -0
  30. package/ios/generated/RNMapsSpecs/EventEmitters.cpp +175 -0
  31. package/ios/generated/RNMapsSpecs/EventEmitters.h +157 -0
  32. package/ios/generated/RNMapsSpecs/Props.cpp +178 -0
  33. package/ios/generated/RNMapsSpecs/Props.h +379 -0
  34. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +143 -0
  35. package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +2 -0
  36. package/ios/generated/RNMapsSpecs/ShadowNodes.h +22 -0
  37. package/ios/generated/RNMapsSpecs/States.h +4 -0
  38. package/package.json +4 -2
  39. package/src/MapMarker.tsx +4 -3
  40. package/src/decorateMapComponent.ts +29 -15
  41. package/src/specs/NativeComponentGoogleMarker.ts +327 -0
  42. package/src/specs/NativeComponentPolygon.ts +137 -0
@@ -12,6 +12,7 @@
12
12
  #include <react/renderer/components/view/ViewProps.h>
13
13
  #include <react/renderer/core/PropsParserContext.h>
14
14
  #include <react/renderer/core/propsConversions.h>
15
+ #include <react/renderer/debug/DebugStringConvertible.h>
15
16
  #include <react/renderer/graphics/Color.h>
16
17
  #include <react/renderer/imagemanager/primitives.h>
17
18
  #include <vector>
@@ -33,12 +34,15 @@ class RNMapsCalloutProps final : public ViewProps {
33
34
 
34
35
  folly::dynamic getDiffProps(const Props* prevProps) const override;
35
36
  #endif
37
+
38
+
36
39
  };
37
40
 
38
41
  struct RNMapsCircleCenterStruct {
39
42
  double latitude{0.0};
40
43
  double longitude{0.0};
41
44
 
45
+
42
46
  #ifdef RN_SERIALIZABLE_STATE
43
47
  bool operator==(const RNMapsCircleCenterStruct&) const = default;
44
48
 
@@ -92,6 +96,8 @@ class RNMapsCircleProps final : public ViewProps {
92
96
 
93
97
  folly::dynamic getDiffProps(const Props* prevProps) const override;
94
98
  #endif
99
+
100
+
95
101
  };
96
102
 
97
103
  enum class RNMapsGoogleMapViewMapType { Hybrid, MutedStandard, None, Satellite, Standard, Terrain, SatelliteFlyover, HybridFlyover };
@@ -202,6 +208,7 @@ struct RNMapsGoogleMapViewCameraCenterStruct {
202
208
  double latitude{0.0};
203
209
  double longitude{0.0};
204
210
 
211
+
205
212
  #ifdef RN_SERIALIZABLE_STATE
206
213
  bool operator==(const RNMapsGoogleMapViewCameraCenterStruct&) const = default;
207
214
 
@@ -244,6 +251,7 @@ struct RNMapsGoogleMapViewCameraStruct {
244
251
  double pitch{0.0};
245
252
  Float zoom{0.0};
246
253
 
254
+
247
255
  #ifdef RN_SERIALIZABLE_STATE
248
256
  bool operator==(const RNMapsGoogleMapViewCameraStruct&) const = default;
249
257
 
@@ -298,6 +306,7 @@ struct RNMapsGoogleMapViewInitialCameraCenterStruct {
298
306
  double latitude{0.0};
299
307
  double longitude{0.0};
300
308
 
309
+
301
310
  #ifdef RN_SERIALIZABLE_STATE
302
311
  bool operator==(const RNMapsGoogleMapViewInitialCameraCenterStruct&) const = default;
303
312
 
@@ -340,6 +349,7 @@ struct RNMapsGoogleMapViewInitialCameraStruct {
340
349
  double pitch{0.0};
341
350
  Float zoom{0.0};
342
351
 
352
+
343
353
  #ifdef RN_SERIALIZABLE_STATE
344
354
  bool operator==(const RNMapsGoogleMapViewInitialCameraStruct&) const = default;
345
355
 
@@ -396,6 +406,7 @@ struct RNMapsGoogleMapViewInitialRegionStruct {
396
406
  double latitudeDelta{0.0};
397
407
  double longitudeDelta{0.0};
398
408
 
409
+
399
410
  #ifdef RN_SERIALIZABLE_STATE
400
411
  bool operator==(const RNMapsGoogleMapViewInitialRegionStruct&) const = default;
401
412
 
@@ -447,6 +458,7 @@ struct RNMapsGoogleMapViewMapPaddingStruct {
447
458
  double bottom{0.0};
448
459
  double left{0.0};
449
460
 
461
+
450
462
  #ifdef RN_SERIALIZABLE_STATE
451
463
  bool operator==(const RNMapsGoogleMapViewMapPaddingStruct&) const = default;
452
464
 
@@ -498,6 +510,7 @@ struct RNMapsGoogleMapViewRegionStruct {
498
510
  double latitudeDelta{0.0};
499
511
  double longitudeDelta{0.0};
500
512
 
513
+
501
514
  #ifdef RN_SERIALIZABLE_STATE
502
515
  bool operator==(const RNMapsGoogleMapViewRegionStruct&) const = default;
503
516
 
@@ -588,12 +601,167 @@ class RNMapsGoogleMapViewProps final : public ViewProps {
588
601
 
589
602
  folly::dynamic getDiffProps(const Props* prevProps) const override;
590
603
  #endif
604
+
605
+
606
+ };
607
+
608
+ struct RNMapsGoogleMarkerAnchorStruct {
609
+ double x{0.0};
610
+ double y{0.0};
611
+
612
+
613
+ #ifdef RN_SERIALIZABLE_STATE
614
+ bool operator==(const RNMapsGoogleMarkerAnchorStruct&) const = default;
615
+
616
+ folly::dynamic toDynamic() const {
617
+ folly::dynamic result = folly::dynamic::object();
618
+ result["x"] = x;
619
+ result["y"] = y;
620
+ return result;
621
+ }
622
+ #endif
623
+ };
624
+
625
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsGoogleMarkerAnchorStruct &result) {
626
+ auto map = (std::unordered_map<std::string, RawValue>)value;
627
+
628
+ auto tmp_x = map.find("x");
629
+ if (tmp_x != map.end()) {
630
+ fromRawValue(context, tmp_x->second, result.x);
631
+ }
632
+ auto tmp_y = map.find("y");
633
+ if (tmp_y != map.end()) {
634
+ fromRawValue(context, tmp_y->second, result.y);
635
+ }
636
+ }
637
+
638
+ static inline std::string toString(const RNMapsGoogleMarkerAnchorStruct &value) {
639
+ return "[Object RNMapsGoogleMarkerAnchorStruct]";
640
+ }
641
+
642
+ #ifdef RN_SERIALIZABLE_STATE
643
+ static inline folly::dynamic toDynamic(const RNMapsGoogleMarkerAnchorStruct &value) {
644
+ return value.toDynamic();
645
+ }
646
+ #endif
647
+
648
+ struct RNMapsGoogleMarkerCalloutAnchorStruct {
649
+ double x{0.0};
650
+ double y{0.0};
651
+
652
+
653
+ #ifdef RN_SERIALIZABLE_STATE
654
+ bool operator==(const RNMapsGoogleMarkerCalloutAnchorStruct&) const = default;
655
+
656
+ folly::dynamic toDynamic() const {
657
+ folly::dynamic result = folly::dynamic::object();
658
+ result["x"] = x;
659
+ result["y"] = y;
660
+ return result;
661
+ }
662
+ #endif
663
+ };
664
+
665
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsGoogleMarkerCalloutAnchorStruct &result) {
666
+ auto map = (std::unordered_map<std::string, RawValue>)value;
667
+
668
+ auto tmp_x = map.find("x");
669
+ if (tmp_x != map.end()) {
670
+ fromRawValue(context, tmp_x->second, result.x);
671
+ }
672
+ auto tmp_y = map.find("y");
673
+ if (tmp_y != map.end()) {
674
+ fromRawValue(context, tmp_y->second, result.y);
675
+ }
676
+ }
677
+
678
+ static inline std::string toString(const RNMapsGoogleMarkerCalloutAnchorStruct &value) {
679
+ return "[Object RNMapsGoogleMarkerCalloutAnchorStruct]";
680
+ }
681
+
682
+ #ifdef RN_SERIALIZABLE_STATE
683
+ static inline folly::dynamic toDynamic(const RNMapsGoogleMarkerCalloutAnchorStruct &value) {
684
+ return value.toDynamic();
685
+ }
686
+ #endif
687
+
688
+ struct RNMapsGoogleMarkerCoordinateStruct {
689
+ double latitude{0.0};
690
+ double longitude{0.0};
691
+
692
+
693
+ #ifdef RN_SERIALIZABLE_STATE
694
+ bool operator==(const RNMapsGoogleMarkerCoordinateStruct&) const = default;
695
+
696
+ folly::dynamic toDynamic() const {
697
+ folly::dynamic result = folly::dynamic::object();
698
+ result["latitude"] = latitude;
699
+ result["longitude"] = longitude;
700
+ return result;
701
+ }
702
+ #endif
703
+ };
704
+
705
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsGoogleMarkerCoordinateStruct &result) {
706
+ auto map = (std::unordered_map<std::string, RawValue>)value;
707
+
708
+ auto tmp_latitude = map.find("latitude");
709
+ if (tmp_latitude != map.end()) {
710
+ fromRawValue(context, tmp_latitude->second, result.latitude);
711
+ }
712
+ auto tmp_longitude = map.find("longitude");
713
+ if (tmp_longitude != map.end()) {
714
+ fromRawValue(context, tmp_longitude->second, result.longitude);
715
+ }
716
+ }
717
+
718
+ static inline std::string toString(const RNMapsGoogleMarkerCoordinateStruct &value) {
719
+ return "[Object RNMapsGoogleMarkerCoordinateStruct]";
720
+ }
721
+
722
+ #ifdef RN_SERIALIZABLE_STATE
723
+ static inline folly::dynamic toDynamic(const RNMapsGoogleMarkerCoordinateStruct &value) {
724
+ return value.toDynamic();
725
+ }
726
+ #endif
727
+ class RNMapsGoogleMarkerProps final : public ViewProps {
728
+ public:
729
+ RNMapsGoogleMarkerProps() = default;
730
+ RNMapsGoogleMarkerProps(const PropsParserContext& context, const RNMapsGoogleMarkerProps &sourceProps, const RawProps &rawProps);
731
+
732
+ #pragma mark - Props
733
+
734
+ RNMapsGoogleMarkerAnchorStruct anchor{};
735
+ RNMapsGoogleMarkerCalloutAnchorStruct calloutAnchor{};
736
+ ImageSource image{};
737
+ ImageSource icon{};
738
+ RNMapsGoogleMarkerCoordinateStruct coordinate{};
739
+ std::string description{};
740
+ bool draggable{false};
741
+ std::string title{};
742
+ bool tracksViewChanges{true};
743
+ bool tracksInfoWindowChanges{false};
744
+ bool flat{false};
745
+ Float rotation{0.0};
746
+ std::string identifier{};
747
+ bool tappable{true};
748
+ double opacity{1.0};
749
+ SharedColor pinColor{};
750
+
751
+ #ifdef RN_SERIALIZABLE_STATE
752
+ ComponentName getDiffPropsImplementationTarget() const override;
753
+
754
+ folly::dynamic getDiffProps(const Props* prevProps) const override;
755
+ #endif
756
+
757
+
591
758
  };
592
759
 
593
760
  struct RNMapsGooglePolygonCoordinatesStruct {
594
761
  double latitude{0.0};
595
762
  double longitude{0.0};
596
763
 
764
+
597
765
  #ifdef RN_SERIALIZABLE_STATE
598
766
  bool operator==(const RNMapsGooglePolygonCoordinatesStruct&) const = default;
599
767
 
@@ -643,6 +811,7 @@ struct RNMapsGooglePolygonHolesStruct {
643
811
  double latitude{0.0};
644
812
  double longitude{0.0};
645
813
 
814
+
646
815
  #ifdef RN_SERIALIZABLE_STATE
647
816
  bool operator==(const RNMapsGooglePolygonHolesStruct&) const = default;
648
817
 
@@ -711,6 +880,8 @@ class RNMapsGooglePolygonProps final : public ViewProps {
711
880
 
712
881
  folly::dynamic getDiffProps(const Props* prevProps) const override;
713
882
  #endif
883
+
884
+
714
885
  };
715
886
 
716
887
  enum class RNMapsMapViewGoogleRenderer { LATEST, LEGACY };
@@ -842,6 +1013,7 @@ struct RNMapsMapViewCameraCenterStruct {
842
1013
  double latitude{0.0};
843
1014
  double longitude{0.0};
844
1015
 
1016
+
845
1017
  #ifdef RN_SERIALIZABLE_STATE
846
1018
  bool operator==(const RNMapsMapViewCameraCenterStruct&) const = default;
847
1019
 
@@ -884,6 +1056,7 @@ struct RNMapsMapViewCameraStruct {
884
1056
  double pitch{0.0};
885
1057
  Float zoom{0.0};
886
1058
 
1059
+
887
1060
  #ifdef RN_SERIALIZABLE_STATE
888
1061
  bool operator==(const RNMapsMapViewCameraStruct&) const = default;
889
1062
 
@@ -938,6 +1111,7 @@ struct RNMapsMapViewCompassOffsetStruct {
938
1111
  double x{0.0};
939
1112
  double y{0.0};
940
1113
 
1114
+
941
1115
  #ifdef RN_SERIALIZABLE_STATE
942
1116
  bool operator==(const RNMapsMapViewCompassOffsetStruct&) const = default;
943
1117
 
@@ -977,6 +1151,7 @@ struct RNMapsMapViewInitialCameraCenterStruct {
977
1151
  double latitude{0.0};
978
1152
  double longitude{0.0};
979
1153
 
1154
+
980
1155
  #ifdef RN_SERIALIZABLE_STATE
981
1156
  bool operator==(const RNMapsMapViewInitialCameraCenterStruct&) const = default;
982
1157
 
@@ -1019,6 +1194,7 @@ struct RNMapsMapViewInitialCameraStruct {
1019
1194
  double pitch{0.0};
1020
1195
  Float zoom{0.0};
1021
1196
 
1197
+
1022
1198
  #ifdef RN_SERIALIZABLE_STATE
1023
1199
  bool operator==(const RNMapsMapViewInitialCameraStruct&) const = default;
1024
1200
 
@@ -1075,6 +1251,7 @@ struct RNMapsMapViewInitialRegionStruct {
1075
1251
  double latitudeDelta{0.0};
1076
1252
  double longitudeDelta{0.0};
1077
1253
 
1254
+
1078
1255
  #ifdef RN_SERIALIZABLE_STATE
1079
1256
  bool operator==(const RNMapsMapViewInitialRegionStruct&) const = default;
1080
1257
 
@@ -1126,6 +1303,7 @@ struct RNMapsMapViewLegalLabelInsetsStruct {
1126
1303
  double bottom{0.0};
1127
1304
  double left{0.0};
1128
1305
 
1306
+
1129
1307
  #ifdef RN_SERIALIZABLE_STATE
1130
1308
  bool operator==(const RNMapsMapViewLegalLabelInsetsStruct&) const = default;
1131
1309
 
@@ -1177,6 +1355,7 @@ struct RNMapsMapViewAppleLogoInsetsStruct {
1177
1355
  double bottom{0.0};
1178
1356
  double left{0.0};
1179
1357
 
1358
+
1180
1359
  #ifdef RN_SERIALIZABLE_STATE
1181
1360
  bool operator==(const RNMapsMapViewAppleLogoInsetsStruct&) const = default;
1182
1361
 
@@ -1228,6 +1407,7 @@ struct RNMapsMapViewMapPaddingStruct {
1228
1407
  double bottom{0.0};
1229
1408
  double left{0.0};
1230
1409
 
1410
+
1231
1411
  #ifdef RN_SERIALIZABLE_STATE
1232
1412
  bool operator==(const RNMapsMapViewMapPaddingStruct&) const = default;
1233
1413
 
@@ -1279,6 +1459,7 @@ struct RNMapsMapViewRegionStruct {
1279
1459
  double latitudeDelta{0.0};
1280
1460
  double longitudeDelta{0.0};
1281
1461
 
1462
+
1282
1463
  #ifdef RN_SERIALIZABLE_STATE
1283
1464
  bool operator==(const RNMapsMapViewRegionStruct&) const = default;
1284
1465
 
@@ -1329,6 +1510,7 @@ struct RNMapsMapViewCameraZoomRangeStruct {
1329
1510
  double maxCenterCoordinateDistance{0.0};
1330
1511
  bool animated{false};
1331
1512
 
1513
+
1332
1514
  #ifdef RN_SERIALIZABLE_STATE
1333
1515
  bool operator==(const RNMapsMapViewCameraZoomRangeStruct&) const = default;
1334
1516
 
@@ -1434,6 +1616,8 @@ class RNMapsMapViewProps final : public ViewProps {
1434
1616
 
1435
1617
  folly::dynamic getDiffProps(const Props* prevProps) const override;
1436
1618
  #endif
1619
+
1620
+
1437
1621
  };
1438
1622
 
1439
1623
  enum class RNMapsMarkerDisplayPriority { Required, High, Low };
@@ -1509,6 +1693,7 @@ struct RNMapsMarkerAnchorStruct {
1509
1693
  double x{0.0};
1510
1694
  double y{0.0};
1511
1695
 
1696
+
1512
1697
  #ifdef RN_SERIALIZABLE_STATE
1513
1698
  bool operator==(const RNMapsMarkerAnchorStruct&) const = default;
1514
1699
 
@@ -1548,6 +1733,7 @@ struct RNMapsMarkerCalloutAnchorStruct {
1548
1733
  double x{0.0};
1549
1734
  double y{0.0};
1550
1735
 
1736
+
1551
1737
  #ifdef RN_SERIALIZABLE_STATE
1552
1738
  bool operator==(const RNMapsMarkerCalloutAnchorStruct&) const = default;
1553
1739
 
@@ -1587,6 +1773,7 @@ struct RNMapsMarkerCalloutOffsetStruct {
1587
1773
  double x{0.0};
1588
1774
  double y{0.0};
1589
1775
 
1776
+
1590
1777
  #ifdef RN_SERIALIZABLE_STATE
1591
1778
  bool operator==(const RNMapsMarkerCalloutOffsetStruct&) const = default;
1592
1779
 
@@ -1626,6 +1813,7 @@ struct RNMapsMarkerCenterOffsetStruct {
1626
1813
  double x{0.0};
1627
1814
  double y{0.0};
1628
1815
 
1816
+
1629
1817
  #ifdef RN_SERIALIZABLE_STATE
1630
1818
  bool operator==(const RNMapsMarkerCenterOffsetStruct&) const = default;
1631
1819
 
@@ -1665,6 +1853,7 @@ struct RNMapsMarkerCoordinateStruct {
1665
1853
  double latitude{0.0};
1666
1854
  double longitude{0.0};
1667
1855
 
1856
+
1668
1857
  #ifdef RN_SERIALIZABLE_STATE
1669
1858
  bool operator==(const RNMapsMarkerCoordinateStruct&) const = default;
1670
1859
 
@@ -1730,12 +1919,15 @@ class RNMapsMarkerProps final : public ViewProps {
1730
1919
 
1731
1920
  folly::dynamic getDiffProps(const Props* prevProps) const override;
1732
1921
  #endif
1922
+
1923
+
1733
1924
  };
1734
1925
 
1735
1926
  struct RNMapsOverlayBoundsNorthEastStruct {
1736
1927
  double latitude{0.0};
1737
1928
  double longitude{0.0};
1738
1929
 
1930
+
1739
1931
  #ifdef RN_SERIALIZABLE_STATE
1740
1932
  bool operator==(const RNMapsOverlayBoundsNorthEastStruct&) const = default;
1741
1933
 
@@ -1775,6 +1967,7 @@ struct RNMapsOverlayBoundsSouthWestStruct {
1775
1967
  double latitude{0.0};
1776
1968
  double longitude{0.0};
1777
1969
 
1970
+
1778
1971
  #ifdef RN_SERIALIZABLE_STATE
1779
1972
  bool operator==(const RNMapsOverlayBoundsSouthWestStruct&) const = default;
1780
1973
 
@@ -1814,6 +2007,7 @@ struct RNMapsOverlayBoundsStruct {
1814
2007
  RNMapsOverlayBoundsNorthEastStruct northEast{};
1815
2008
  RNMapsOverlayBoundsSouthWestStruct southWest{};
1816
2009
 
2010
+
1817
2011
  #ifdef RN_SERIALIZABLE_STATE
1818
2012
  bool operator==(const RNMapsOverlayBoundsStruct&) const = default;
1819
2013
 
@@ -1866,6 +2060,184 @@ class RNMapsOverlayProps final : public ViewProps {
1866
2060
 
1867
2061
  folly::dynamic getDiffProps(const Props* prevProps) const override;
1868
2062
  #endif
2063
+
2064
+
2065
+ };
2066
+
2067
+ enum class RNMapsPolygonLineCap { Butt, Round, Square };
2068
+
2069
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolygonLineCap &result) {
2070
+ auto string = (std::string)value;
2071
+ if (string == "butt") { result = RNMapsPolygonLineCap::Butt; return; }
2072
+ if (string == "round") { result = RNMapsPolygonLineCap::Round; return; }
2073
+ if (string == "square") { result = RNMapsPolygonLineCap::Square; return; }
2074
+ abort();
2075
+ }
2076
+
2077
+ static inline std::string toString(const RNMapsPolygonLineCap &value) {
2078
+ switch (value) {
2079
+ case RNMapsPolygonLineCap::Butt: return "butt";
2080
+ case RNMapsPolygonLineCap::Round: return "round";
2081
+ case RNMapsPolygonLineCap::Square: return "square";
2082
+ }
2083
+ }
2084
+
2085
+ #ifdef RN_SERIALIZABLE_STATE
2086
+ static inline folly::dynamic toDynamic(const RNMapsPolygonLineCap &value) {
2087
+ return toString(value);
2088
+ }
2089
+ #endif
2090
+ enum class RNMapsPolygonLineJoin { Miter, Round, Bevel };
2091
+
2092
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolygonLineJoin &result) {
2093
+ auto string = (std::string)value;
2094
+ if (string == "miter") { result = RNMapsPolygonLineJoin::Miter; return; }
2095
+ if (string == "round") { result = RNMapsPolygonLineJoin::Round; return; }
2096
+ if (string == "bevel") { result = RNMapsPolygonLineJoin::Bevel; return; }
2097
+ abort();
2098
+ }
2099
+
2100
+ static inline std::string toString(const RNMapsPolygonLineJoin &value) {
2101
+ switch (value) {
2102
+ case RNMapsPolygonLineJoin::Miter: return "miter";
2103
+ case RNMapsPolygonLineJoin::Round: return "round";
2104
+ case RNMapsPolygonLineJoin::Bevel: return "bevel";
2105
+ }
2106
+ }
2107
+
2108
+ #ifdef RN_SERIALIZABLE_STATE
2109
+ static inline folly::dynamic toDynamic(const RNMapsPolygonLineJoin &value) {
2110
+ return toString(value);
2111
+ }
2112
+ #endif
2113
+ struct RNMapsPolygonCoordinatesStruct {
2114
+ double latitude{0.0};
2115
+ double longitude{0.0};
2116
+
2117
+
2118
+ #ifdef RN_SERIALIZABLE_STATE
2119
+ bool operator==(const RNMapsPolygonCoordinatesStruct&) const = default;
2120
+
2121
+ folly::dynamic toDynamic() const {
2122
+ folly::dynamic result = folly::dynamic::object();
2123
+ result["latitude"] = latitude;
2124
+ result["longitude"] = longitude;
2125
+ return result;
2126
+ }
2127
+ #endif
2128
+ };
2129
+
2130
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolygonCoordinatesStruct &result) {
2131
+ auto map = (std::unordered_map<std::string, RawValue>)value;
2132
+
2133
+ auto tmp_latitude = map.find("latitude");
2134
+ if (tmp_latitude != map.end()) {
2135
+ fromRawValue(context, tmp_latitude->second, result.latitude);
2136
+ }
2137
+ auto tmp_longitude = map.find("longitude");
2138
+ if (tmp_longitude != map.end()) {
2139
+ fromRawValue(context, tmp_longitude->second, result.longitude);
2140
+ }
2141
+ }
2142
+
2143
+ static inline std::string toString(const RNMapsPolygonCoordinatesStruct &value) {
2144
+ return "[Object RNMapsPolygonCoordinatesStruct]";
2145
+ }
2146
+
2147
+ #ifdef RN_SERIALIZABLE_STATE
2148
+ static inline folly::dynamic toDynamic(const RNMapsPolygonCoordinatesStruct &value) {
2149
+ return value.toDynamic();
2150
+ }
2151
+ #endif
2152
+
2153
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<RNMapsPolygonCoordinatesStruct> &result) {
2154
+ auto items = (std::vector<RawValue>)value;
2155
+ for (const auto &item : items) {
2156
+ RNMapsPolygonCoordinatesStruct newItem;
2157
+ fromRawValue(context, item, newItem);
2158
+ result.emplace_back(newItem);
2159
+ }
2160
+ }
2161
+
2162
+
2163
+ struct RNMapsPolygonHolesStruct {
2164
+ double latitude{0.0};
2165
+ double longitude{0.0};
2166
+
2167
+
2168
+ #ifdef RN_SERIALIZABLE_STATE
2169
+ bool operator==(const RNMapsPolygonHolesStruct&) const = default;
2170
+
2171
+ folly::dynamic toDynamic() const {
2172
+ folly::dynamic result = folly::dynamic::object();
2173
+ result["latitude"] = latitude;
2174
+ result["longitude"] = longitude;
2175
+ return result;
2176
+ }
2177
+ #endif
2178
+ };
2179
+
2180
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolygonHolesStruct &result) {
2181
+ auto map = (std::unordered_map<std::string, RawValue>)value;
2182
+
2183
+ auto tmp_latitude = map.find("latitude");
2184
+ if (tmp_latitude != map.end()) {
2185
+ fromRawValue(context, tmp_latitude->second, result.latitude);
2186
+ }
2187
+ auto tmp_longitude = map.find("longitude");
2188
+ if (tmp_longitude != map.end()) {
2189
+ fromRawValue(context, tmp_longitude->second, result.longitude);
2190
+ }
2191
+ }
2192
+
2193
+ static inline std::string toString(const RNMapsPolygonHolesStruct &value) {
2194
+ return "[Object RNMapsPolygonHolesStruct]";
2195
+ }
2196
+
2197
+ #ifdef RN_SERIALIZABLE_STATE
2198
+ static inline folly::dynamic toDynamic(const RNMapsPolygonHolesStruct &value) {
2199
+ return value.toDynamic();
2200
+ }
2201
+ #endif
2202
+
2203
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<std::vector<RNMapsPolygonHolesStruct>> &result) {
2204
+ auto items = (std::vector<std::vector<RawValue>>)value;
2205
+ for (const std::vector<RawValue> &item : items) {
2206
+ auto nestedArray = std::vector<RNMapsPolygonHolesStruct>{};
2207
+ for (const RawValue &nestedItem : item) {
2208
+ RNMapsPolygonHolesStruct newItem;
2209
+ fromRawValue(context, nestedItem, newItem);
2210
+ nestedArray.emplace_back(newItem);
2211
+ }
2212
+ result.emplace_back(nestedArray);
2213
+ }
2214
+ }
2215
+
2216
+ class RNMapsPolygonProps final : public ViewProps {
2217
+ public:
2218
+ RNMapsPolygonProps() = default;
2219
+ RNMapsPolygonProps(const PropsParserContext& context, const RNMapsPolygonProps &sourceProps, const RawProps &rawProps);
2220
+
2221
+ #pragma mark - Props
2222
+
2223
+ std::vector<RNMapsPolygonCoordinatesStruct> coordinates{};
2224
+ SharedColor fillColor{};
2225
+ SharedColor strokeColor{};
2226
+ Float strokeWidth{1.0};
2227
+ std::vector<std::vector<RNMapsPolygonHolesStruct>> holes{};
2228
+ RNMapsPolygonLineCap lineCap{RNMapsPolygonLineCap::Round};
2229
+ RNMapsPolygonLineJoin lineJoin{RNMapsPolygonLineJoin::Round};
2230
+ Float miterLimit{10.0};
2231
+ Float lineDashPhase{0.0};
2232
+ std::vector<Float> lineDashPattern{};
2233
+
2234
+ #ifdef RN_SERIALIZABLE_STATE
2235
+ ComponentName getDiffPropsImplementationTarget() const override;
2236
+
2237
+ folly::dynamic getDiffProps(const Props* prevProps) const override;
2238
+ #endif
2239
+
2240
+
1869
2241
  };
1870
2242
 
1871
2243
  enum class RNMapsPolylineLineCap { Butt, Round, Square };
@@ -1918,6 +2290,7 @@ struct RNMapsPolylineCoordinatesStruct {
1918
2290
  double latitude{0.0};
1919
2291
  double longitude{0.0};
1920
2292
 
2293
+
1921
2294
  #ifdef RN_SERIALIZABLE_STATE
1922
2295
  bool operator==(const RNMapsPolylineCoordinatesStruct&) const = default;
1923
2296
 
@@ -1984,6 +2357,8 @@ class RNMapsPolylineProps final : public ViewProps {
1984
2357
 
1985
2358
  folly::dynamic getDiffProps(const Props* prevProps) const override;
1986
2359
  #endif
2360
+
2361
+
1987
2362
  };
1988
2363
 
1989
2364
  class RNMapsUrlTileProps final : public ViewProps {
@@ -2010,6 +2385,8 @@ class RNMapsUrlTileProps final : public ViewProps {
2010
2385
 
2011
2386
  folly::dynamic getDiffProps(const Props* prevProps) const override;
2012
2387
  #endif
2388
+
2389
+
2013
2390
  };
2014
2391
 
2015
2392
  class RNMapsWMSTileProps final : public ViewProps {
@@ -2034,6 +2411,8 @@ class RNMapsWMSTileProps final : public ViewProps {
2034
2411
 
2035
2412
  folly::dynamic getDiffProps(const Props* prevProps) const override;
2036
2413
  #endif
2414
+
2415
+
2037
2416
  };
2038
2417
 
2039
2418
  } // namespace facebook::react