react-native-map4d-map-dtqg 0.1.1 → 0.1.3

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 (229) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +133 -88
  3. package/android/build.gradle +60 -60
  4. package/android/src/main/AndroidManifest.xml +4 -4
  5. package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -87
  6. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -298
  7. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -35
  8. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -31
  9. package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -167
  10. package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -121
  11. package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -105
  12. package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +121 -121
  13. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -502
  14. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -143
  15. package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +17 -17
  16. package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -1172
  17. package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +231 -226
  18. package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -412
  19. package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +211 -211
  20. package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -222
  21. package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -119
  22. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +172 -172
  23. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +147 -147
  24. package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -146
  25. package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +137 -137
  26. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -95
  27. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +64 -64
  28. package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -31
  29. package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -31
  30. package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -70
  31. package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -9
  32. package/ios/Map4dMap.h +7 -7
  33. package/ios/Map4dMap.m +14 -14
  34. package/ios/Map4dMap.xcodeproj/project.pbxproj +2 -2
  35. package/ios/Map4dMapViewManager.m +34 -34
  36. package/ios/RCTConvert+Map4dMap.h +33 -33
  37. package/ios/RCTConvert+Map4dMap.m +112 -112
  38. package/ios/RMFCircle.h +37 -37
  39. package/ios/RMFCircle.m +100 -100
  40. package/ios/RMFCircleManager.h +18 -18
  41. package/ios/RMFCircleManager.m +155 -155
  42. package/ios/RMFCircleMap4d.h +23 -23
  43. package/ios/RMFCircleMap4d.m +13 -13
  44. package/ios/RMFCoordinate.h +22 -22
  45. package/ios/RMFCoordinate.m +13 -13
  46. package/ios/RMFDirectionsMarkerOptions.h +24 -24
  47. package/ios/RMFDirectionsMarkerOptions.m +23 -23
  48. package/ios/RMFDirectionsRenderer.h +47 -47
  49. package/ios/RMFDirectionsRenderer.m +182 -182
  50. package/ios/RMFDirectionsRendererManager.h +17 -17
  51. package/ios/RMFDirectionsRendererManager.m +84 -84
  52. package/ios/RMFDirectionsRendererMap4d.h +21 -21
  53. package/ios/RMFDirectionsRendererMap4d.m +12 -12
  54. package/ios/RMFDummyView.h +6 -6
  55. package/ios/RMFDummyView.m +12 -12
  56. package/ios/RMFEventResponse.h +39 -39
  57. package/ios/RMFEventResponse.m +98 -98
  58. package/ios/RMFIcon.h +24 -24
  59. package/ios/RMFIcon.m +35 -35
  60. package/ios/RMFMapView.h +84 -84
  61. package/ios/RMFMapView.m +376 -376
  62. package/ios/RMFMapViewManager.h +17 -17
  63. package/ios/RMFMapViewManager.m +509 -493
  64. package/ios/RMFMarker.h +57 -57
  65. package/ios/RMFMarker.m +267 -267
  66. package/ios/RMFMarkerManager.h +17 -17
  67. package/ios/RMFMarkerManager.m +156 -156
  68. package/ios/RMFMarkerMap4d.h +19 -19
  69. package/ios/RMFMarkerMap4d.m +13 -13
  70. package/ios/RMFPOI.h +38 -38
  71. package/ios/RMFPOI.m +123 -123
  72. package/ios/RMFPOIManager.h +18 -18
  73. package/ios/RMFPOIManager.m +168 -168
  74. package/ios/RMFPOIMap4d.h +22 -22
  75. package/ios/RMFPOIMap4d.m +12 -12
  76. package/ios/RMFPolygon.h +41 -41
  77. package/ios/RMFPolygon.m +106 -106
  78. package/ios/RMFPolygonManager.h +18 -18
  79. package/ios/RMFPolygonManager.m +141 -141
  80. package/ios/RMFPolygonMap4d.h +23 -23
  81. package/ios/RMFPolygonMap4d.m +15 -15
  82. package/ios/RMFPolyline.h +38 -38
  83. package/ios/RMFPolyline.m +101 -101
  84. package/ios/RMFPolylineManager.h +18 -18
  85. package/ios/RMFPolylineManager.m +139 -139
  86. package/ios/RMFPolylineMap4d.h +22 -22
  87. package/ios/RMFPolylineMap4d.m +15 -15
  88. package/ios/building/RMFBuilding.h +41 -41
  89. package/ios/building/RMFBuilding.m +104 -104
  90. package/ios/building/RMFBuildingManager.h +19 -19
  91. package/ios/building/RMFBuildingManager.m +133 -133
  92. package/ios/building/RMFBuildingMap4d.h +23 -23
  93. package/ios/building/RMFBuildingMap4d.m +15 -15
  94. package/ios/overlays/RMFTileOverlay.h +36 -36
  95. package/ios/overlays/RMFTileOverlay.m +64 -64
  96. package/ios/overlays/RMFTileOverlayManager.h +17 -17
  97. package/ios/overlays/RMFTileOverlayManager.m +27 -27
  98. package/lib/commonjs/components/MFBanDoSo.js +109 -0
  99. package/lib/commonjs/components/MFBanDoSo.js.map +1 -0
  100. package/lib/commonjs/components/MFBuilding.js +26 -26
  101. package/lib/commonjs/components/MFBuilding.js.map +1 -1
  102. package/lib/commonjs/components/MFCircle.js +20 -20
  103. package/lib/commonjs/components/MFCircle.js.map +1 -1
  104. package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
  105. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
  106. package/lib/commonjs/components/MFMapView.js +89 -70
  107. package/lib/commonjs/components/MFMapView.js.map +1 -1
  108. package/lib/commonjs/components/MFMarker.js +35 -35
  109. package/lib/commonjs/components/MFMarker.js.map +1 -1
  110. package/lib/commonjs/components/MFPOI.js +20 -20
  111. package/lib/commonjs/components/MFPOI.js.map +1 -1
  112. package/lib/commonjs/components/MFPolygon.js +22 -22
  113. package/lib/commonjs/components/MFPolygon.js.map +1 -1
  114. package/lib/commonjs/components/MFPolyline.js +18 -18
  115. package/lib/commonjs/components/MFPolyline.js.map +1 -1
  116. package/lib/commonjs/components/MFTileOverlay.js +9 -9
  117. package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
  118. package/lib/commonjs/components/Map4dMapView.js.map +1 -1
  119. package/lib/commonjs/components/extends/AreaFocusManager.js +205 -0
  120. package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -0
  121. package/lib/commonjs/components/extends/AreaFocuser.js +21 -259
  122. package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
  123. package/lib/commonjs/components/extends/BoundHelper.js +36 -0
  124. package/lib/commonjs/components/extends/BoundHelper.js.map +1 -0
  125. package/lib/commonjs/components/extends/area/AreaFocusAreas.js +167 -0
  126. package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -0
  127. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +164 -0
  128. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
  129. package/lib/commonjs/components/extends/area/AreaFocusSession.js +100 -0
  130. package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -0
  131. package/lib/commonjs/components/extends/area/AreaFocusTypes.js +40 -0
  132. package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -0
  133. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +2288 -0
  134. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -0
  135. package/lib/commonjs/components/internal/GeojsonStyleUtils.js +139 -0
  136. package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -0
  137. package/lib/commonjs/index.js +8 -0
  138. package/lib/commonjs/index.js.map +1 -1
  139. package/lib/module/components/MFBanDoSo.js +92 -0
  140. package/lib/module/components/MFBanDoSo.js.map +1 -0
  141. package/lib/module/components/MFBuilding.js +26 -26
  142. package/lib/module/components/MFBuilding.js.map +1 -1
  143. package/lib/module/components/MFCircle.js +20 -20
  144. package/lib/module/components/MFCircle.js.map +1 -1
  145. package/lib/module/components/MFDirectionsRenderer.js +32 -32
  146. package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
  147. package/lib/module/components/MFMapView.js +88 -70
  148. package/lib/module/components/MFMapView.js.map +1 -1
  149. package/lib/module/components/MFMarker.js +35 -35
  150. package/lib/module/components/MFMarker.js.map +1 -1
  151. package/lib/module/components/MFPOI.js +20 -20
  152. package/lib/module/components/MFPOI.js.map +1 -1
  153. package/lib/module/components/MFPolygon.js +22 -22
  154. package/lib/module/components/MFPolygon.js.map +1 -1
  155. package/lib/module/components/MFPolyline.js +18 -18
  156. package/lib/module/components/MFPolyline.js.map +1 -1
  157. package/lib/module/components/MFTileOverlay.js +9 -9
  158. package/lib/module/components/MFTileOverlay.js.map +1 -1
  159. package/lib/module/components/Map4dMapView.js.map +1 -1
  160. package/lib/module/components/extends/AreaFocusManager.js +193 -0
  161. package/lib/module/components/extends/AreaFocusManager.js.map +1 -0
  162. package/lib/module/components/extends/AreaFocuser.js +21 -259
  163. package/lib/module/components/extends/AreaFocuser.js.map +1 -1
  164. package/lib/module/components/extends/BoundHelper.js +29 -0
  165. package/lib/module/components/extends/BoundHelper.js.map +1 -0
  166. package/lib/module/components/extends/area/AreaFocusAreas.js +156 -0
  167. package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -0
  168. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +153 -0
  169. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
  170. package/lib/module/components/extends/area/AreaFocusSession.js +93 -0
  171. package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -0
  172. package/lib/module/components/extends/area/AreaFocusTypes.js +33 -0
  173. package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -0
  174. package/lib/module/components/internal/DefaultRoadmapStyle.js +2281 -0
  175. package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -0
  176. package/lib/module/components/internal/GeojsonStyleUtils.js +130 -0
  177. package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -0
  178. package/lib/module/index.js +2 -1
  179. package/lib/module/index.js.map +1 -1
  180. package/lib/typescript/components/Map4dMapView.d.ts +7 -7
  181. package/package.json +152 -152
  182. package/react-native-map4d-map.podspec +20 -20
  183. package/src/components/MFBanDoSo.js +124 -0
  184. package/src/components/MFBuilding.js +187 -187
  185. package/src/components/MFCircle.js +173 -173
  186. package/src/components/MFDirectionsRenderer.js +237 -237
  187. package/src/components/MFMapView.js +464 -447
  188. package/src/components/MFMarker.js +246 -246
  189. package/src/components/MFPOI.js +184 -184
  190. package/src/components/MFPolygon.js +186 -186
  191. package/src/components/MFPolyline.js +172 -172
  192. package/src/components/MFTileOverlay.js +45 -45
  193. package/src/components/Map4dMapView.tsx +26 -26
  194. package/src/components/extends/AreaFocusManager.js +196 -0
  195. package/src/components/extends/AreaFocuser.js +61 -338
  196. package/src/components/extends/BoundHelper.js +32 -0
  197. package/src/components/extends/area/AreaFocusAreas.js +164 -0
  198. package/src/components/extends/area/AreaFocusGeometryUtils.js +164 -0
  199. package/src/components/extends/area/AreaFocusSession.js +100 -0
  200. package/src/components/extends/area/AreaFocusTypes.js +36 -0
  201. package/src/components/internal/DefaultRoadmapStyle.js +3365 -0
  202. package/src/components/internal/GeojsonStyleUtils.js +143 -0
  203. package/src/index.js +25 -23
  204. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  205. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  206. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  207. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  208. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  209. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  210. package/android/.gradle/8.9/gc.properties +0 -0
  211. package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
  212. package/android/.gradle/9.0-milestone-1/checksums/md5-checksums.bin +0 -0
  213. package/android/.gradle/9.0-milestone-1/checksums/sha1-checksums.bin +0 -0
  214. package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
  215. package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
  216. package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
  217. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  218. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  219. package/android/.gradle/config.properties +0 -2
  220. package/android/.gradle/vcs-1/gc.properties +0 -0
  221. package/android/.idea/AndroidProjectSystem.xml +0 -6
  222. package/android/.idea/caches/deviceStreaming.xml +0 -1570
  223. package/android/.idea/copilot.data.migration.ask2agent.xml +0 -6
  224. package/android/.idea/gradle.xml +0 -12
  225. package/android/.idea/migrations.xml +0 -10
  226. package/android/.idea/misc.xml +0 -10
  227. package/android/.idea/runConfigurations.xml +0 -17
  228. package/android/.idea/vcs.xml +0 -6
  229. package/android/local.properties +0 -8
@@ -1,23 +1,23 @@
1
- //
2
- // RMFBuildingMap4d.h
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 6/10/25.
6
- // Copyright © 2025 IOTLink. All rights reserved.
7
- //
8
-
9
- #ifndef RMFBuildingMap4d_h
10
- #define RMFBuildingMap4d_h
11
-
12
- #import <Map4dMap/Map4dMap.h>
13
-
14
- @class RMFBuilding;
15
-
16
- @interface RMFBuildingMap4d : MFBuilding
17
-
18
- @property (nonatomic, weak) RMFBuilding *reactBuilding;
19
-
20
- @end
21
-
22
-
23
- #endif /* RMFBuildingMap4d_h */
1
+ //
2
+ // RMFBuildingMap4d.h
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 6/10/25.
6
+ // Copyright © 2025 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #ifndef RMFBuildingMap4d_h
10
+ #define RMFBuildingMap4d_h
11
+
12
+ #import <Map4dMap/Map4dMap.h>
13
+
14
+ @class RMFBuilding;
15
+
16
+ @interface RMFBuildingMap4d : MFBuilding
17
+
18
+ @property (nonatomic, weak) RMFBuilding *reactBuilding;
19
+
20
+ @end
21
+
22
+
23
+ #endif /* RMFBuildingMap4d_h */
@@ -1,15 +1,15 @@
1
- //
2
- // RMFBuildingMap4d.m
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 6/10/25.
6
- // Copyright © 2025 IOTLink. All rights reserved.
7
- //
8
-
9
- #import "RMFBuildingMap4d.h"
10
-
11
- @implementation RMFBuildingMap4d
12
-
13
-
14
-
15
- @end
1
+ //
2
+ // RMFBuildingMap4d.m
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 6/10/25.
6
+ // Copyright © 2025 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #import "RMFBuildingMap4d.h"
10
+
11
+ @implementation RMFBuildingMap4d
12
+
13
+
14
+
15
+ @end
@@ -1,36 +1,36 @@
1
- //
2
- // RMFTileOverlay.h
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 12/15/21.
6
- //
7
-
8
- #ifndef RMFTileOverlay_h
9
- #define RMFTileOverlay_h
10
-
11
- #import <React/UIView+React.h>
12
- #import <Map4dMap/Map4dMap.h>
13
- #import "RMFMapView.h"
14
-
15
- @class RMFTileOverlay;
16
-
17
- @interface RMFTileURLConstructor : NSObject<MFTileURLConstructor>
18
- @property(nonatomic, weak, nullable) RMFTileOverlay *reactTileOverlay;
19
- @end
20
-
21
- #pragma mark - RMFTileOverlay
22
-
23
- @interface RMFTileOverlay : UIView
24
-
25
- @property(nonatomic, strong, nullable) MFURLTileLayer* urlTileLayer;
26
-
27
- @property(nonatomic, strong, nullable) NSString *urlTemplate;
28
- @property(nonatomic, assign) float zIndex;
29
- @property(nonatomic, assign) BOOL visible;
30
-
31
- - (void)setMapView:(RMFMapView* _Nullable)mapView;
32
-
33
- @end
34
-
35
-
36
- #endif /* RMFTileOverlay_h */
1
+ //
2
+ // RMFTileOverlay.h
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 12/15/21.
6
+ //
7
+
8
+ #ifndef RMFTileOverlay_h
9
+ #define RMFTileOverlay_h
10
+
11
+ #import <React/UIView+React.h>
12
+ #import <Map4dMap/Map4dMap.h>
13
+ #import "RMFMapView.h"
14
+
15
+ @class RMFTileOverlay;
16
+
17
+ @interface RMFTileURLConstructor : NSObject<MFTileURLConstructor>
18
+ @property(nonatomic, weak, nullable) RMFTileOverlay *reactTileOverlay;
19
+ @end
20
+
21
+ #pragma mark - RMFTileOverlay
22
+
23
+ @interface RMFTileOverlay : UIView
24
+
25
+ @property(nonatomic, strong, nullable) MFURLTileLayer* urlTileLayer;
26
+
27
+ @property(nonatomic, strong, nullable) NSString *urlTemplate;
28
+ @property(nonatomic, assign) float zIndex;
29
+ @property(nonatomic, assign) BOOL visible;
30
+
31
+ - (void)setMapView:(RMFMapView* _Nullable)mapView;
32
+
33
+ @end
34
+
35
+
36
+ #endif /* RMFTileOverlay_h */
@@ -1,64 +1,64 @@
1
- //
2
- // RMFTileOverlay.m
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 12/15/21.
6
- //
7
-
8
- #import "RMFTileOverlay.h"
9
-
10
- @implementation RMFTileURLConstructor
11
-
12
- - (NSURL * _Nullable)getTileUrlWithX:(NSUInteger)x y:(NSUInteger)y zoom:(NSUInteger)zoom {
13
- if (_reactTileOverlay.urlTemplate == nil) {
14
- return nil;
15
- }
16
-
17
- NSString* url = _reactTileOverlay.urlTemplate;
18
- if ([url containsString:@"{z}"]) {
19
- url = [url stringByReplacingOccurrencesOfString:@"{z}" withString:[@(zoom) stringValue]];
20
- }
21
- else {
22
- url = [url stringByReplacingOccurrencesOfString:@"{zoom}" withString:[@(zoom) stringValue]];
23
- }
24
- url = [url stringByReplacingOccurrencesOfString:@"{x}" withString:[@(x) stringValue]];
25
- url = [url stringByReplacingOccurrencesOfString:@"{y}" withString:[@(y) stringValue]];
26
- return [NSURL URLWithString:url];
27
- }
28
-
29
- @end
30
-
31
- @implementation RMFTileOverlay
32
-
33
- - (instancetype)init {
34
- if (self = [super init]) {
35
- RMFTileURLConstructor* constructor = [[RMFTileURLConstructor alloc] init];
36
- constructor.reactTileOverlay = self;
37
-
38
- _urlTileLayer = [MFURLTileLayer tileLayerWithURLConstructor:constructor];
39
- }
40
- return self;
41
- }
42
-
43
- - (void)setMapView:(RMFMapView *)mapView {
44
- _urlTileLayer.map = mapView;
45
- }
46
-
47
- - (void)setUrlTemplate:(NSString *)urlTemplate {
48
- _urlTemplate = urlTemplate;
49
- if (_urlTileLayer.map != nil) {
50
- [_urlTileLayer clearTileCache];
51
- }
52
- }
53
-
54
- - (void)setVisible:(BOOL)visible {
55
- _visible = visible;
56
- _urlTileLayer.isHidden = !visible;
57
- }
58
-
59
- - (void)setZIndex:(float)zIndex {
60
- _zIndex = zIndex;
61
- _urlTileLayer.zIndex = zIndex;
62
- }
63
-
64
- @end
1
+ //
2
+ // RMFTileOverlay.m
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 12/15/21.
6
+ //
7
+
8
+ #import "RMFTileOverlay.h"
9
+
10
+ @implementation RMFTileURLConstructor
11
+
12
+ - (NSURL * _Nullable)getTileUrlWithX:(NSUInteger)x y:(NSUInteger)y zoom:(NSUInteger)zoom {
13
+ if (_reactTileOverlay.urlTemplate == nil) {
14
+ return nil;
15
+ }
16
+
17
+ NSString* url = _reactTileOverlay.urlTemplate;
18
+ if ([url containsString:@"{z}"]) {
19
+ url = [url stringByReplacingOccurrencesOfString:@"{z}" withString:[@(zoom) stringValue]];
20
+ }
21
+ else {
22
+ url = [url stringByReplacingOccurrencesOfString:@"{zoom}" withString:[@(zoom) stringValue]];
23
+ }
24
+ url = [url stringByReplacingOccurrencesOfString:@"{x}" withString:[@(x) stringValue]];
25
+ url = [url stringByReplacingOccurrencesOfString:@"{y}" withString:[@(y) stringValue]];
26
+ return [NSURL URLWithString:url];
27
+ }
28
+
29
+ @end
30
+
31
+ @implementation RMFTileOverlay
32
+
33
+ - (instancetype)init {
34
+ if (self = [super init]) {
35
+ RMFTileURLConstructor* constructor = [[RMFTileURLConstructor alloc] init];
36
+ constructor.reactTileOverlay = self;
37
+
38
+ _urlTileLayer = [MFURLTileLayer tileLayerWithURLConstructor:constructor];
39
+ }
40
+ return self;
41
+ }
42
+
43
+ - (void)setMapView:(RMFMapView *)mapView {
44
+ _urlTileLayer.map = mapView;
45
+ }
46
+
47
+ - (void)setUrlTemplate:(NSString *)urlTemplate {
48
+ _urlTemplate = urlTemplate;
49
+ if (_urlTileLayer.map != nil) {
50
+ [_urlTileLayer clearTileCache];
51
+ }
52
+ }
53
+
54
+ - (void)setVisible:(BOOL)visible {
55
+ _visible = visible;
56
+ _urlTileLayer.isHidden = !visible;
57
+ }
58
+
59
+ - (void)setZIndex:(float)zIndex {
60
+ _zIndex = zIndex;
61
+ _urlTileLayer.zIndex = zIndex;
62
+ }
63
+
64
+ @end
@@ -1,17 +1,17 @@
1
- //
2
- // RMFTileOverlayManager.h
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 12/15/21.
6
- //
7
-
8
- #ifndef RMFTileOverlayManager_h
9
- #define RMFTileOverlayManager_h
10
-
11
- #import <React/RCTViewManager.h>
12
-
13
- @interface RMFTileOverlayManager : RCTViewManager
14
-
15
- @end
16
-
17
- #endif /* RMFTileOverlayManager_h */
1
+ //
2
+ // RMFTileOverlayManager.h
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 12/15/21.
6
+ //
7
+
8
+ #ifndef RMFTileOverlayManager_h
9
+ #define RMFTileOverlayManager_h
10
+
11
+ #import <React/RCTViewManager.h>
12
+
13
+ @interface RMFTileOverlayManager : RCTViewManager
14
+
15
+ @end
16
+
17
+ #endif /* RMFTileOverlayManager_h */
@@ -1,27 +1,27 @@
1
- //
2
- // RMFTileOverlayManager.m
3
- // react-native-map4d-map
4
- //
5
- // Created by Huy Dang on 12/15/21.
6
- //
7
-
8
- #import "RMFTileOverlayManager.h"
9
- #import "RMFTileOverlay.h"
10
- #import <React/RCTConvert+CoreLocation.h>
11
- #import <React/RCTBridge.h>
12
- #import <React/RCTUIManager.h>
13
-
14
- @implementation RMFTileOverlayManager
15
-
16
- RCT_EXPORT_MODULE(RMFTileOverlay)
17
-
18
- - (UIView *)view {
19
- RMFTileOverlay * overlay = [[RMFTileOverlay alloc] init];
20
- return overlay;
21
- }
22
-
23
- RCT_EXPORT_VIEW_PROPERTY(urlTemplate, NSString)
24
- RCT_EXPORT_VIEW_PROPERTY(zIndex, float)
25
- RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
26
-
27
- @end
1
+ //
2
+ // RMFTileOverlayManager.m
3
+ // react-native-map4d-map
4
+ //
5
+ // Created by Huy Dang on 12/15/21.
6
+ //
7
+
8
+ #import "RMFTileOverlayManager.h"
9
+ #import "RMFTileOverlay.h"
10
+ #import <React/RCTConvert+CoreLocation.h>
11
+ #import <React/RCTBridge.h>
12
+ #import <React/RCTUIManager.h>
13
+
14
+ @implementation RMFTileOverlayManager
15
+
16
+ RCT_EXPORT_MODULE(RMFTileOverlay)
17
+
18
+ - (UIView *)view {
19
+ RMFTileOverlay * overlay = [[RMFTileOverlay alloc] init];
20
+ return overlay;
21
+ }
22
+
23
+ RCT_EXPORT_VIEW_PROPERTY(urlTemplate, NSString)
24
+ RCT_EXPORT_VIEW_PROPERTY(zIndex, float)
25
+ RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
26
+
27
+ @end
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MFBanDoSo = void 0;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _MFMapView = require("./MFMapView");
11
+
12
+ var _GeojsonStyleUtils = require("./internal/GeojsonStyleUtils");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const FilterStylePropType = _propTypes.default.shape({
17
+ kind: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
18
+ kind_detail: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)])
19
+ });
20
+
21
+ const DrawLinePropType = _propTypes.default.shape({
22
+ color: _propTypes.default.string,
23
+ width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.array])
24
+ });
25
+
26
+ const DrawFillPropType = _propTypes.default.shape({
27
+ color: _propTypes.default.string
28
+ });
29
+
30
+ const DrawSymbolPropType = _propTypes.default.shape({
31
+ icon_image: _propTypes.default.string,
32
+ icon_index: _propTypes.default.number,
33
+ icon_color: _propTypes.default.string,
34
+ use_direct_icon_url: _propTypes.default.bool
35
+ });
36
+
37
+ const CategoryStylePropType = _propTypes.default.shape({
38
+ line: _propTypes.default.arrayOf(_propTypes.default.shape({
39
+ layer: _propTypes.default.string,
40
+ filter: FilterStylePropType,
41
+ draw: DrawLinePropType
42
+ })),
43
+ fill: _propTypes.default.arrayOf(_propTypes.default.shape({
44
+ layer: _propTypes.default.string,
45
+ filter: FilterStylePropType,
46
+ draw: DrawFillPropType
47
+ })),
48
+ symbol: _propTypes.default.arrayOf(_propTypes.default.shape({
49
+ layer: _propTypes.default.string,
50
+ filter: FilterStylePropType,
51
+ draw: DrawSymbolPropType
52
+ }))
53
+ });
54
+
55
+ const CategoryItemPropType = _propTypes.default.shape({
56
+ key: _propTypes.default.string,
57
+ title: _propTypes.default.string,
58
+ group: _propTypes.default.string,
59
+ order: _propTypes.default.number,
60
+ checked: _propTypes.default.bool,
61
+ style: CategoryStylePropType
62
+ });
63
+
64
+ class MFBanDoSo extends _MFMapView.MFMapView {
65
+ constructor(props) {
66
+ super(props);
67
+ this._appliedGeojsonStyle = null;
68
+ }
69
+
70
+ componentDidMount() {
71
+ this._syncGeojsonStyle();
72
+ }
73
+
74
+ componentDidUpdate(prevProps, prevState) {
75
+ const mapReadyChanged = prevState.isReady !== this.state.isReady;
76
+ const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;
77
+ const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;
78
+ const itemsChanged = (0, _GeojsonStyleUtils.createCategoryItemsSignature)(prevProps.items) !== (0, _GeojsonStyleUtils.createCategoryItemsSignature)(this.props.items);
79
+
80
+ if (mapReadyChanged || mapStyleChanged || sourceUrlChanged || itemsChanged) {
81
+ this._syncGeojsonStyle();
82
+ }
83
+ }
84
+
85
+ _syncGeojsonStyle() {
86
+ if (!this.state.isReady) {
87
+ return;
88
+ }
89
+
90
+ const items = this.props.items || [];
91
+ const geojsonStyle = (0, _GeojsonStyleUtils.buildGeojsonStyle)(this.props.mapStyle, this.props.sourceUrl, items);
92
+
93
+ if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {
94
+ return;
95
+ }
96
+
97
+ this._appliedGeojsonStyle = geojsonStyle;
98
+
99
+ this._runCommand('setMapStyle', [geojsonStyle]);
100
+ }
101
+
102
+ }
103
+
104
+ exports.MFBanDoSo = MFBanDoSo;
105
+ MFBanDoSo.propTypes = { ..._MFMapView.MFMapView.propTypes,
106
+ items: _propTypes.default.arrayOf(CategoryItemPropType),
107
+ sourceUrl: _propTypes.default.string.isRequired
108
+ };
109
+ //# sourceMappingURL=MFBanDoSo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FilterStylePropType","PropTypes","shape","kind","oneOfType","string","arrayOf","kind_detail","DrawLinePropType","color","width","number","array","DrawFillPropType","DrawSymbolPropType","icon_image","icon_index","icon_color","use_direct_icon_url","bool","CategoryStylePropType","line","layer","filter","draw","fill","symbol","CategoryItemPropType","key","title","group","order","checked","style","MFBanDoSo","MFMapView","constructor","props","_appliedGeojsonStyle","componentDidMount","_syncGeojsonStyle","componentDidUpdate","prevProps","prevState","mapReadyChanged","isReady","state","mapStyleChanged","mapStyle","sourceUrlChanged","sourceUrl","itemsChanged","createCategoryItemsSignature","items","geojsonStyle","buildGeojsonStyle","_runCommand","propTypes","isRequired"],"sources":["MFBanDoSo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { MFMapView } from './MFMapView';\nimport {\n buildGeojsonStyle,\n createCategoryItemsSignature,\n} from './internal/GeojsonStyleUtils';\n\nconst FilterStylePropType = PropTypes.shape({\n kind: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n kind_detail: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n});\n\nconst DrawLinePropType = PropTypes.shape({\n color: PropTypes.string,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n});\n\nconst DrawFillPropType = PropTypes.shape({\n color: PropTypes.string,\n});\n\nconst DrawSymbolPropType = PropTypes.shape({\n icon_image: PropTypes.string,\n icon_index: PropTypes.number,\n icon_color: PropTypes.string,\n use_direct_icon_url: PropTypes.bool,\n});\n\nconst CategoryStylePropType = PropTypes.shape({\n line: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawLinePropType,\n })\n ),\n fill: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawFillPropType,\n })\n ),\n symbol: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawSymbolPropType,\n })\n ),\n});\n\nconst CategoryItemPropType = PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string,\n group: PropTypes.string,\n order: PropTypes.number,\n checked: PropTypes.bool,\n style: CategoryStylePropType,\n});\n\nclass MFBanDoSo extends MFMapView {\n constructor(props) {\n super(props);\n this._appliedGeojsonStyle = null;\n }\n\n componentDidMount() {\n this._syncGeojsonStyle();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const mapReadyChanged = prevState.isReady !== this.state.isReady;\n const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;\n const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;\n const itemsChanged =\n createCategoryItemsSignature(prevProps.items) !==\n createCategoryItemsSignature(this.props.items);\n\n if (\n mapReadyChanged ||\n mapStyleChanged ||\n sourceUrlChanged ||\n itemsChanged\n ) {\n this._syncGeojsonStyle();\n }\n }\n\n _syncGeojsonStyle() {\n if (!this.state.isReady) {\n return;\n }\n\n const items = this.props.items || [];\n\n const geojsonStyle = buildGeojsonStyle(\n this.props.mapStyle,\n this.props.sourceUrl,\n items\n );\n\n if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {\n return;\n }\n\n this._appliedGeojsonStyle = geojsonStyle;\n this._runCommand('setMapStyle', [geojsonStyle]);\n }\n}\n\nMFBanDoSo.propTypes = {\n ...MFMapView.propTypes,\n items: PropTypes.arrayOf(CategoryItemPropType),\n sourceUrl: PropTypes.string.isRequired,\n};\n\nexport { MFBanDoSo };\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAKA,MAAMA,mBAAmB,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC1CC,IAAI,EAAEF,kBAAA,CAAUG,SAAV,CAAoB,CACxBH,kBAAA,CAAUI,MADc,EAExBJ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BAFA,IAGAE,YAJF,EAKE;MACA,KAAKX,iBAAL;IACD;EACF;;EAEDA,iBAAiB,GAAG;IAClB,IAAI,CAAC,KAAKM,KAAL,CAAWD,OAAhB,EAAyB;MACvB;IACD;;IAED,MAAMQ,KAAK,GAAG,KAAKhB,KAAL,CAAWgB,KAAX,IAAoB,EAAlC;IAEA,MAAMC,YAAY,GAAG,IAAAC,oCAAA,EACnB,KAAKlB,KAAL,CAAWW,QADQ,EAEnB,KAAKX,KAAL,CAAWa,SAFQ,EAGnBG,KAHmB,CAArB;;IAMA,IAAI,CAACC,YAAD,IAAiBA,YAAY,KAAK,KAAKhB,oBAA3C,EAAiE;MAC/D;IACD;;IAED,KAAKA,oBAAL,GAA4BgB,YAA5B;;IACA,KAAKE,WAAL,CAAiB,aAAjB,EAAgC,CAACF,YAAD,CAAhC;EACD;;AA/C+B;;;AAkDlCpB,SAAS,CAACuB,SAAV,GAAsB,EACpB,GAAGtB,oBAAA,CAAUsB,SADO;EAEpBJ,KAAK,EAAEpD,kBAAA,CAAUK,OAAV,CAAkBqB,oBAAlB,CAFa;EAGpBuB,SAAS,EAAEjD,kBAAA,CAAUI,MAAV,CAAiBqD;AAHR,CAAtB"}
@@ -21,69 +21,69 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
21
21
  const viewPropTypes = _deprecatedReactNativePropTypes.ViewPropTypes || View.propTypes;
22
22
  const propTypes = { ...viewPropTypes,
23
23
 
24
- /**
25
- * The name of the building.
24
+ /**
25
+ * The name of the building.
26
26
  */
27
27
  name: _propTypes.default.string,
28
28
 
29
- /**
30
- * The position of the building
29
+ /**
30
+ * The position of the building
31
31
  */
32
32
  coordinate: _propTypes.default.shape({
33
- /**
34
- * Position for the building.
33
+ /**
34
+ * Position for the building.
35
35
  */
36
36
  latitude: _propTypes.default.number.isRequired,
37
37
  longitude: _propTypes.default.number.isRequired
38
38
  }),
39
39
 
40
- /**
41
- * The model URL for the building.
40
+ /**
41
+ * The model URL for the building.
42
42
  */
43
43
  modelUrl: _propTypes.default.string,
44
44
 
45
- /**
46
- * The texture URL for the building.
45
+ /**
46
+ * The texture URL for the building.
47
47
  */
48
48
  textureUrl: _propTypes.default.string,
49
49
 
50
- /**
51
- * The scale of the building.
50
+ /**
51
+ * The scale of the building.
52
52
  */
53
53
  scale: _propTypes.default.number,
54
54
 
55
- /**
56
- * The bearing of the building.
55
+ /**
56
+ * The bearing of the building.
57
57
  */
58
58
  bearing: _propTypes.default.number,
59
59
 
60
- /**
61
- * The elevation of the building.
60
+ /**
61
+ * The elevation of the building.
62
62
  */
63
63
  elevation: _propTypes.default.number,
64
64
 
65
- /**
66
- * Is the building selectable by the user ?
65
+ /**
66
+ * Is the building selectable by the user ?
67
67
  */
68
68
  selected: _propTypes.default.bool,
69
69
 
70
- /**
71
- * touchable
70
+ /**
71
+ * touchable
72
72
  */
73
73
  touchable: _propTypes.default.bool,
74
74
 
75
- /**
76
- * visible
75
+ /**
76
+ * visible
77
77
  */
78
78
  visible: _propTypes.default.bool,
79
79
 
80
- /**
81
- * userData
80
+ /**
81
+ * userData
82
82
  */
83
83
  userData: _propTypes.default.object,
84
84
 
85
- /**
86
- * Callback that is called when the user presses on the building
85
+ /**
86
+ * Callback that is called when the user presses on the building
87
87
  */
88
88
  onPress: _propTypes.default.func
89
89
  };
@@ -1 +1 @@
1
- {"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","name","PropTypes","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","React","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","findNodeHandle","args","Platform","OS","NativeModules","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFBuilding","requireNativeComponent"],"sources":["MFBuilding.js"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {ViewPropTypes} from 'deprecated-react-native-prop-types';\r\nimport {\r\n requireNativeComponent,\r\n Platform,\r\n NativeModules,\r\n findNodeHandle\r\n} from 'react-native';\r\n\r\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\r\nconst viewPropTypes = ViewPropTypes || View.propTypes;\r\n\r\nconst propTypes = {\r\n ...viewPropTypes,\r\n\r\n /**\r\n * The name of the building.\r\n */\r\n name: PropTypes.string,\r\n\r\n /**\r\n * The position of the building\r\n */\r\n coordinate: PropTypes.shape({\r\n /**\r\n * Position for the building.\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n }),\r\n\r\n /**\r\n * The model URL for the building.\r\n */\r\n modelUrl: PropTypes.string,\r\n\r\n /**\r\n * The texture URL for the building.\r\n */\r\n textureUrl: PropTypes.string,\r\n\r\n /**\r\n * The scale of the building.\r\n */\r\n scale: PropTypes.number,\r\n\r\n /**\r\n * The bearing of the building.\r\n */\r\n bearing: PropTypes.number,\r\n\r\n /**\r\n * The elevation of the building.\r\n */\r\n elevation: PropTypes.number,\r\n\r\n /**\r\n * Is the building selectable by the user ?\r\n */\r\n selected: PropTypes.bool,\r\n\r\n /**\r\n * touchable\r\n */\r\n touchable: PropTypes.bool,\r\n\r\n /**\r\n * visible\r\n */\r\n visible: PropTypes.bool,\r\n\r\n /**\r\n * userData\r\n */\r\n userData:PropTypes.object,\r\n\r\n /**\r\n * Callback that is called when the user presses on the building\r\n */\r\n onPress: PropTypes.func,\r\n};\r\n\r\n\r\nclass MFBuilding extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this._onPress = this._onPress.bind(this)\r\n this._ref = this._ref.bind(this)\r\n }\r\n\r\n _onPress(event) {\r\n event.stopPropagation();\r\n if (this.props.onPress) {\r\n this.props.onPress(event);\r\n }\r\n }\r\n\r\n _ref(ref) {\r\n this.building = ref;\r\n }\r\n\r\n setName(name) {\r\n this._runCommand(\"setName\", [name])\r\n }\r\n\r\n setScale(scale) {\r\n this._runCommand(\"setScale\", [scale])\r\n }\r\n\r\n setBearing(bearing) {\r\n this._runCommand(\"setBearing\", [bearing])\r\n }\r\n\r\n setElevation(elevation) {\r\n this._runCommand(\"setElevation\", [elevation])\r\n }\r\n\r\n setSelected(selected) {\r\n this._runCommand(\"setSelected\", [selected])\r\n }\r\n\r\n setTouchable(touchable) {\r\n this._runCommand(\"setTouchable\", [touchable])\r\n }\r\n\r\n setVisible(visible) {\r\n this._runCommand(\"setVisible\", [visible])\r\n }\r\n\r\n setUserData(userData) {\r\n this._runCommand(\"setUserData\", [userData])\r\n }\r\n\r\n _getHandle() {\r\n return findNodeHandle(this.building);\r\n }\r\n\r\n _runCommand(name, args) {\r\n switch (Platform.OS) {\r\n case 'android':\r\n NativeModules.UIManager.dispatchViewManagerCommand(\r\n this._getHandle(),\r\n this._uiManagerCommand(name),\r\n args\r\n );\r\n break;\r\n\r\n case 'ios':\r\n this._mapManagerCommand(name)(this._getHandle(), ...args);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n _uiManagerCommand(name) {\r\n const UIManager = NativeModules.UIManager;\r\n const componentName = \"RMFBuilding\";\r\n\r\n if (!UIManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n return UIManager[componentName].Commands[name];\r\n }\r\n\r\n // RN >= 0.58\r\n return UIManager.getViewManagerConfig(componentName).Commands[name];\r\n }\r\n\r\n _mapManagerCommand(name) {\r\n return NativeModules[`RMFBuilding`][name];\r\n }\r\n\r\n render() {\r\n return <RMFBuilding\r\n {...this.props}\r\n ref={this._ref}\r\n onPress={this._onPress}\r\n />;\r\n }\r\n}\r\n\r\nMFBuilding.propTypes = propTypes;\r\n\r\nvar RMFBuilding = requireNativeComponent(`RMFBuilding`, MFBuilding);\r\n\r\nexport { MFBuilding }"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAOA;AACA,MAAMA,aAAa,GAAGC,6CAAA,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,0BAAxB,CACE,KAAKP,UAAL,EADF,EAEE,KAAKQ,iBAAL,CAAuBnD,IAAvB,CAFF,EAGE6C,IAHF;;QAKA;;MAEF,KAAK,KAAL;QACE,KAAKO,kBAAL,CAAwBpD,IAAxB,EAA8B,KAAK2C,UAAL,EAA9B,EAAiD,GAAGE,IAApD;;QACA;;MAEF;QACE;IAdJ;EAgBD;;EAEDM,iBAAiB,CAACnD,IAAD,EAAO;IACtB,MAAMiD,SAAS,GAAGD,0BAAA,CAAcC,SAAhC;IACA,MAAMI,aAAa,GAAG,aAAtB;;IAEA,IAAI,CAACJ,SAAS,CAACK,oBAAf,EAAqC;MACnC;MACA,OAAOL,SAAS,CAACI,aAAD,CAAT,CAAyBE,QAAzB,CAAkCvD,IAAlC,CAAP;IACD,CAPqB,CAStB;;;IACA,OAAOiD,SAAS,CAACK,oBAAV,CAA+BD,aAA/B,EAA8CE,QAA9C,CAAuDvD,IAAvD,CAAP;EACD;;EAEDoD,kBAAkB,CAACpD,IAAD,EAAO;IACvB,OAAOgD,0BAAA,CAAe,aAAf,EAA6BhD,IAA7B,CAAP;EACD;;EAEDwD,MAAM,GAAG;IACP,oBAAO,6BAAC,WAAD,eACD,KAAK9B,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AAhGsC;;;AAmGzCL,UAAU,CAACvB,SAAX,GAAuBA,SAAvB;AAEA,IAAI0D,WAAW,GAAG,IAAAC,mCAAA,EAAwB,aAAxB,EAAsCpC,UAAtC,CAAlB"}
1
+ {"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","name","PropTypes","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","React","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","findNodeHandle","args","Platform","OS","NativeModules","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFBuilding","requireNativeComponent"],"sources":["MFBuilding.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {ViewPropTypes} from 'deprecated-react-native-prop-types';\nimport {\n requireNativeComponent,\n Platform,\n NativeModules,\n findNodeHandle\n} from 'react-native';\n\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\nconst viewPropTypes = ViewPropTypes || View.propTypes;\n\nconst propTypes = {\n ...viewPropTypes,\n\n /**\n * The name of the building.\n */\n name: PropTypes.string,\n\n /**\n * The position of the building\n */\n coordinate: PropTypes.shape({\n /**\n * Position for the building.\n */\n latitude: PropTypes.number.isRequired,\n longitude: PropTypes.number.isRequired,\n }),\n\n /**\n * The model URL for the building.\n */\n modelUrl: PropTypes.string,\n\n /**\n * The texture URL for the building.\n */\n textureUrl: PropTypes.string,\n\n /**\n * The scale of the building.\n */\n scale: PropTypes.number,\n\n /**\n * The bearing of the building.\n */\n bearing: PropTypes.number,\n\n /**\n * The elevation of the building.\n */\n elevation: PropTypes.number,\n\n /**\n * Is the building selectable by the user ?\n */\n selected: PropTypes.bool,\n\n /**\n * touchable\n */\n touchable: PropTypes.bool,\n\n /**\n * visible\n */\n visible: PropTypes.bool,\n\n /**\n * userData\n */\n userData:PropTypes.object,\n\n /**\n * Callback that is called when the user presses on the building\n */\n onPress: PropTypes.func,\n};\n\n\nclass MFBuilding extends React.Component {\n constructor(props) {\n super(props);\n this._onPress = this._onPress.bind(this)\n this._ref = this._ref.bind(this)\n }\n\n _onPress(event) {\n event.stopPropagation();\n if (this.props.onPress) {\n this.props.onPress(event);\n }\n }\n\n _ref(ref) {\n this.building = ref;\n }\n\n setName(name) {\n this._runCommand(\"setName\", [name])\n }\n\n setScale(scale) {\n this._runCommand(\"setScale\", [scale])\n }\n\n setBearing(bearing) {\n this._runCommand(\"setBearing\", [bearing])\n }\n\n setElevation(elevation) {\n this._runCommand(\"setElevation\", [elevation])\n }\n\n setSelected(selected) {\n this._runCommand(\"setSelected\", [selected])\n }\n\n setTouchable(touchable) {\n this._runCommand(\"setTouchable\", [touchable])\n }\n\n setVisible(visible) {\n this._runCommand(\"setVisible\", [visible])\n }\n\n setUserData(userData) {\n this._runCommand(\"setUserData\", [userData])\n }\n\n _getHandle() {\n return findNodeHandle(this.building);\n }\n\n _runCommand(name, args) {\n switch (Platform.OS) {\n case 'android':\n NativeModules.UIManager.dispatchViewManagerCommand(\n this._getHandle(),\n this._uiManagerCommand(name),\n args\n );\n break;\n\n case 'ios':\n this._mapManagerCommand(name)(this._getHandle(), ...args);\n break;\n\n default:\n break;\n }\n }\n\n _uiManagerCommand(name) {\n const UIManager = NativeModules.UIManager;\n const componentName = \"RMFBuilding\";\n\n if (!UIManager.getViewManagerConfig) {\n // RN < 0.58\n return UIManager[componentName].Commands[name];\n }\n\n // RN >= 0.58\n return UIManager.getViewManagerConfig(componentName).Commands[name];\n }\n\n _mapManagerCommand(name) {\n return NativeModules[`RMFBuilding`][name];\n }\n\n render() {\n return <RMFBuilding\n {...this.props}\n ref={this._ref}\n onPress={this._onPress}\n />;\n }\n}\n\nMFBuilding.propTypes = propTypes;\n\nvar RMFBuilding = requireNativeComponent(`RMFBuilding`, MFBuilding);\n\nexport { MFBuilding }"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAOA;AACA,MAAMA,aAAa,GAAGC,6CAAA,IAAiBC,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGH,aADa;;EAGhB;AACF;AACA;EACEI,IAAI,EAAEC,kBAAA,CAAUC,MANA;;EAQhB;AACF;AACA;EACEC,UAAU,EAAEF,kBAAA,CAAUG,KAAV,CAAgB;IAC1B;AACJ;AACA;IACIC,QAAQ,EAAEJ,kBAAA,CAAUK,MAAV,CAAiBC,UAJD;IAK1BC,SAAS,EAAEP,kBAAA,CAA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