react-native-map4d-map-dtqg 0.1.0 → 0.1.2

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 (210) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +133 -41
  3. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  5. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/8.9/gc.properties +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  10. package/android/.gradle/vcs-1/gc.properties +0 -0
  11. package/android/build.gradle +60 -60
  12. package/android/src/main/AndroidManifest.xml +4 -4
  13. package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -87
  14. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -298
  15. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -35
  16. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -31
  17. package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -167
  18. package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -121
  19. package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -105
  20. package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +121 -121
  21. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -502
  22. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -143
  23. package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +17 -17
  24. package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -1172
  25. package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +231 -226
  26. package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -412
  27. package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +211 -211
  28. package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -222
  29. package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -119
  30. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +172 -172
  31. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +147 -147
  32. package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -146
  33. package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +137 -137
  34. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -95
  35. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +64 -64
  36. package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -31
  37. package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -31
  38. package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -70
  39. package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -9
  40. package/ios/Map4dMap.h +7 -7
  41. package/ios/Map4dMap.m +14 -14
  42. package/ios/Map4dMapViewManager.m +34 -34
  43. package/ios/RCTConvert+Map4dMap.h +33 -33
  44. package/ios/RCTConvert+Map4dMap.m +112 -112
  45. package/ios/RMFCircle.h +37 -37
  46. package/ios/RMFCircle.m +100 -100
  47. package/ios/RMFCircleManager.h +18 -18
  48. package/ios/RMFCircleManager.m +155 -155
  49. package/ios/RMFCircleMap4d.h +23 -23
  50. package/ios/RMFCircleMap4d.m +13 -13
  51. package/ios/RMFCoordinate.h +22 -22
  52. package/ios/RMFCoordinate.m +13 -13
  53. package/ios/RMFDirectionsMarkerOptions.h +24 -24
  54. package/ios/RMFDirectionsMarkerOptions.m +23 -23
  55. package/ios/RMFDirectionsRenderer.h +47 -47
  56. package/ios/RMFDirectionsRenderer.m +182 -182
  57. package/ios/RMFDirectionsRendererManager.h +17 -17
  58. package/ios/RMFDirectionsRendererManager.m +84 -84
  59. package/ios/RMFDirectionsRendererMap4d.h +21 -21
  60. package/ios/RMFDirectionsRendererMap4d.m +12 -12
  61. package/ios/RMFDummyView.h +6 -6
  62. package/ios/RMFDummyView.m +12 -12
  63. package/ios/RMFEventResponse.h +39 -39
  64. package/ios/RMFEventResponse.m +98 -98
  65. package/ios/RMFIcon.h +24 -24
  66. package/ios/RMFIcon.m +35 -35
  67. package/ios/RMFMapView.h +84 -84
  68. package/ios/RMFMapView.m +376 -376
  69. package/ios/RMFMapViewManager.h +17 -17
  70. package/ios/RMFMapViewManager.m +508 -493
  71. package/ios/RMFMarker.h +57 -57
  72. package/ios/RMFMarker.m +267 -267
  73. package/ios/RMFMarkerManager.h +17 -17
  74. package/ios/RMFMarkerManager.m +156 -156
  75. package/ios/RMFMarkerMap4d.h +19 -19
  76. package/ios/RMFMarkerMap4d.m +13 -13
  77. package/ios/RMFPOI.h +38 -38
  78. package/ios/RMFPOI.m +123 -123
  79. package/ios/RMFPOIManager.h +18 -18
  80. package/ios/RMFPOIManager.m +168 -168
  81. package/ios/RMFPOIMap4d.h +22 -22
  82. package/ios/RMFPOIMap4d.m +12 -12
  83. package/ios/RMFPolygon.h +41 -41
  84. package/ios/RMFPolygon.m +106 -106
  85. package/ios/RMFPolygonManager.h +18 -18
  86. package/ios/RMFPolygonManager.m +141 -141
  87. package/ios/RMFPolygonMap4d.h +23 -23
  88. package/ios/RMFPolygonMap4d.m +15 -15
  89. package/ios/RMFPolyline.h +38 -38
  90. package/ios/RMFPolyline.m +101 -101
  91. package/ios/RMFPolylineManager.h +18 -18
  92. package/ios/RMFPolylineManager.m +139 -139
  93. package/ios/RMFPolylineMap4d.h +22 -22
  94. package/ios/RMFPolylineMap4d.m +15 -15
  95. package/ios/building/RMFBuilding.h +41 -41
  96. package/ios/building/RMFBuilding.m +104 -104
  97. package/ios/building/RMFBuildingManager.h +19 -19
  98. package/ios/building/RMFBuildingManager.m +133 -133
  99. package/ios/building/RMFBuildingMap4d.h +23 -23
  100. package/ios/building/RMFBuildingMap4d.m +15 -15
  101. package/ios/overlays/RMFTileOverlay.h +36 -36
  102. package/ios/overlays/RMFTileOverlay.m +64 -64
  103. package/ios/overlays/RMFTileOverlayManager.h +17 -17
  104. package/ios/overlays/RMFTileOverlayManager.m +27 -27
  105. package/lib/commonjs/components/MFBanDoSo.js +109 -0
  106. package/lib/commonjs/components/MFBanDoSo.js.map +1 -0
  107. package/lib/commonjs/components/MFBuilding.js +26 -26
  108. package/lib/commonjs/components/MFBuilding.js.map +1 -1
  109. package/lib/commonjs/components/MFCircle.js +20 -20
  110. package/lib/commonjs/components/MFCircle.js.map +1 -1
  111. package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
  112. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
  113. package/lib/commonjs/components/MFMapView.js +152 -71
  114. package/lib/commonjs/components/MFMapView.js.map +1 -1
  115. package/lib/commonjs/components/MFMarker.js +35 -35
  116. package/lib/commonjs/components/MFMarker.js.map +1 -1
  117. package/lib/commonjs/components/MFPOI.js +20 -20
  118. package/lib/commonjs/components/MFPOI.js.map +1 -1
  119. package/lib/commonjs/components/MFPolygon.js +22 -22
  120. package/lib/commonjs/components/MFPolygon.js.map +1 -1
  121. package/lib/commonjs/components/MFPolyline.js +18 -18
  122. package/lib/commonjs/components/MFPolyline.js.map +1 -1
  123. package/lib/commonjs/components/MFTileOverlay.js +9 -9
  124. package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
  125. package/lib/commonjs/components/Map4dMapView.js.map +1 -1
  126. package/lib/commonjs/components/extends/AreaFocusManager.js +205 -0
  127. package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -0
  128. package/lib/commonjs/components/extends/AreaFocuser.js +73 -0
  129. package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -0
  130. package/lib/commonjs/components/extends/BoundHelper.js +36 -0
  131. package/lib/commonjs/components/extends/BoundHelper.js.map +1 -0
  132. package/lib/commonjs/components/extends/area/AreaFocusAreas.js +167 -0
  133. package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -0
  134. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +164 -0
  135. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
  136. package/lib/commonjs/components/extends/area/AreaFocusSession.js +100 -0
  137. package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -0
  138. package/lib/commonjs/components/extends/area/AreaFocusTypes.js +40 -0
  139. package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -0
  140. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +2288 -0
  141. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -0
  142. package/lib/commonjs/components/internal/GeojsonStyleUtils.js +139 -0
  143. package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -0
  144. package/lib/commonjs/index.js +16 -0
  145. package/lib/commonjs/index.js.map +1 -1
  146. package/lib/module/components/MFBanDoSo.js +92 -0
  147. package/lib/module/components/MFBanDoSo.js.map +1 -0
  148. package/lib/module/components/MFBuilding.js +26 -26
  149. package/lib/module/components/MFBuilding.js.map +1 -1
  150. package/lib/module/components/MFCircle.js +20 -20
  151. package/lib/module/components/MFCircle.js.map +1 -1
  152. package/lib/module/components/MFDirectionsRenderer.js +32 -32
  153. package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
  154. package/lib/module/components/MFMapView.js +149 -71
  155. package/lib/module/components/MFMapView.js.map +1 -1
  156. package/lib/module/components/MFMarker.js +35 -35
  157. package/lib/module/components/MFMarker.js.map +1 -1
  158. package/lib/module/components/MFPOI.js +20 -20
  159. package/lib/module/components/MFPOI.js.map +1 -1
  160. package/lib/module/components/MFPolygon.js +22 -22
  161. package/lib/module/components/MFPolygon.js.map +1 -1
  162. package/lib/module/components/MFPolyline.js +18 -18
  163. package/lib/module/components/MFPolyline.js.map +1 -1
  164. package/lib/module/components/MFTileOverlay.js +9 -9
  165. package/lib/module/components/MFTileOverlay.js.map +1 -1
  166. package/lib/module/components/Map4dMapView.js.map +1 -1
  167. package/lib/module/components/extends/AreaFocusManager.js +193 -0
  168. package/lib/module/components/extends/AreaFocusManager.js.map +1 -0
  169. package/lib/module/components/extends/AreaFocuser.js +64 -0
  170. package/lib/module/components/extends/AreaFocuser.js.map +1 -0
  171. package/lib/module/components/extends/BoundHelper.js +29 -0
  172. package/lib/module/components/extends/BoundHelper.js.map +1 -0
  173. package/lib/module/components/extends/area/AreaFocusAreas.js +156 -0
  174. package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -0
  175. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +153 -0
  176. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
  177. package/lib/module/components/extends/area/AreaFocusSession.js +93 -0
  178. package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -0
  179. package/lib/module/components/extends/area/AreaFocusTypes.js +33 -0
  180. package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -0
  181. package/lib/module/components/internal/DefaultRoadmapStyle.js +2281 -0
  182. package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -0
  183. package/lib/module/components/internal/GeojsonStyleUtils.js +130 -0
  184. package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -0
  185. package/lib/module/index.js +3 -1
  186. package/lib/module/index.js.map +1 -1
  187. package/lib/typescript/components/Map4dMapView.d.ts +7 -7
  188. package/package.json +152 -152
  189. package/react-native-map4d-map.podspec +20 -20
  190. package/src/components/MFBanDoSo.js +124 -0
  191. package/src/components/MFBuilding.js +187 -187
  192. package/src/components/MFCircle.js +173 -173
  193. package/src/components/MFDirectionsRenderer.js +237 -237
  194. package/src/components/MFMapView.js +464 -373
  195. package/src/components/MFMarker.js +246 -246
  196. package/src/components/MFPOI.js +184 -184
  197. package/src/components/MFPolygon.js +186 -186
  198. package/src/components/MFPolyline.js +172 -172
  199. package/src/components/MFTileOverlay.js +45 -45
  200. package/src/components/Map4dMapView.tsx +26 -26
  201. package/src/components/extends/AreaFocusManager.js +196 -0
  202. package/src/components/extends/AreaFocuser.js +62 -0
  203. package/src/components/extends/BoundHelper.js +32 -0
  204. package/src/components/extends/area/AreaFocusAreas.js +164 -0
  205. package/src/components/extends/area/AreaFocusGeometryUtils.js +164 -0
  206. package/src/components/extends/area/AreaFocusSession.js +100 -0
  207. package/src/components/extends/area/AreaFocusTypes.js +36 -0
  208. package/src/components/internal/DefaultRoadmapStyle.js +3365 -0
  209. package/src/components/internal/GeojsonStyleUtils.js +143 -0
  210. package/src/index.js +25 -21
@@ -1,237 +1,237 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
4
- import {
5
- requireNativeComponent,
6
- Platform,
7
- Image,
8
- NativeModules,
9
- findNodeHandle,
10
- processColor
11
- } from 'react-native';
12
-
13
- const viewPropTypes = ViewPropTypes || View.propTypes;
14
-
15
- const propTypes = {
16
- ...viewPropTypes,
17
-
18
- /**
19
- * The directions to display on the map,
20
- * retrieved as an array of array of coordinates to describe the routes.
21
- * Similar to directions prop but has higher priority
22
- */
23
- routes: PropTypes.arrayOf(
24
- PropTypes.arrayOf(
25
- PropTypes.shape({
26
- latitude: PropTypes.number.isRequired,
27
- longitude: PropTypes.number.isRequired,
28
- })
29
- )
30
- ),
31
-
32
- /**
33
- * The directions to display on the map,
34
- * retrieved as a json string from Get route Map4D API (/sdk/route).
35
- * Similar to routes prop but with lower priority
36
- */
37
- directions: PropTypes.string,
38
-
39
- /**
40
- * The index of the main route, default value is 0.
41
- */
42
- activedIndex: PropTypes.number,
43
-
44
- /**
45
- * The active route stroke width.
46
- */
47
- activeStrokeWidth: PropTypes.number,
48
-
49
- /**
50
- * The active route color.
51
- */
52
- activeStrokeColor: ColorPropType,
53
-
54
- /**
55
- * The active route outline stroke width.
56
- */
57
- activeOutlineWidth: PropTypes.number,
58
-
59
- /**
60
- * The active route outline color.
61
- */
62
- activeOutlineColor: ColorPropType,
63
-
64
- /**
65
- * The inactive route stroke width.
66
- */
67
- inactiveStrokeWidth: PropTypes.number,
68
-
69
- /**
70
- * The inactive route color.
71
- */
72
- inactiveStrokeColor: ColorPropType,
73
-
74
- /**
75
- * The inactive route outline stroke width.
76
- */
77
- inactiveOutlineWidth: PropTypes.number,
78
-
79
- /**
80
- * The inactive route outline color.
81
- */
82
- inactiveOutlineColor: ColorPropType,
83
-
84
- /**
85
- * The options of the origin POI.
86
- */
87
- originPOIOptions: PropTypes.shape({
88
- coordinate: PropTypes.shape({
89
- latitude: PropTypes.number.isRequired,
90
- longitude: PropTypes.number.isRequired,
91
- }),
92
-
93
- icon: PropTypes.shape({
94
- uri: PropTypes.any.isRequired
95
- }),
96
-
97
- title: PropTypes.string,
98
-
99
- titleColor: ColorPropType,
100
-
101
- visible: PropTypes.bool,
102
- }),
103
-
104
- /**
105
- * The options of the destination POI.
106
- */
107
- destinationPOIOptions: PropTypes.shape({
108
- coordinate: PropTypes.shape({
109
- latitude: PropTypes.number.isRequired,
110
- longitude: PropTypes.number.isRequired,
111
- }),
112
-
113
- icon: PropTypes.shape({
114
- uri: PropTypes.any.isRequired
115
- }),
116
-
117
- title: PropTypes.string,
118
-
119
- titleColor: ColorPropType,
120
-
121
- visible: PropTypes.bool,
122
- }),
123
-
124
- /**
125
- * Callback that is called when the user presses on the routes.
126
- */
127
- onPress: PropTypes.func,
128
- };
129
-
130
- class MFDirectionsRenderer extends React.Component {
131
- constructor(props) {
132
- super(props)
133
- this._ref = this._ref.bind(this)
134
- this._onPress = this._onPress.bind(this)
135
- }
136
-
137
- setActivedIndex(index) {
138
- this._runCommand("setActivedIndex", [index])
139
- }
140
-
141
- setRoutes(routes) {
142
- this._runCommand("setRoutes", [routes])
143
- }
144
-
145
- setDirections(directions) {
146
- this._runCommand("setDirections", [directions])
147
- }
148
-
149
- render() {
150
- let originPOIOptions = this.props.originPOIOptions
151
- if (originPOIOptions) {
152
- if (originPOIOptions.titleColor) {
153
- originPOIOptions.titleColor = processColor(originPOIOptions.titleColor)
154
- }
155
- if (originPOIOptions.icon) {
156
- let uri = Image.resolveAssetSource(originPOIOptions.icon.uri) || {uri: originPOIOptions.icon.uri};
157
- originPOIOptions.icon = {uri: uri.uri}
158
- }
159
- }
160
-
161
- let destinationPOIOptions = this.props.destinationPOIOptions
162
- if (destinationPOIOptions) {
163
- if (destinationPOIOptions.titleColor) {
164
- destinationPOIOptions.titleColor = processColor(destinationPOIOptions.titleColor)
165
- }
166
- if (destinationPOIOptions.icon) {
167
- let uri = Image.resolveAssetSource(destinationPOIOptions.icon.uri) || {uri: destinationPOIOptions.icon.uri};
168
- destinationPOIOptions.icon = {uri: uri.uri}
169
- }
170
- }
171
-
172
- return <RMFDirectionsRenderer
173
- {...this.props}
174
- originPOIOptions={originPOIOptions}
175
- destinationPOIOptions={destinationPOIOptions}
176
- ref={this._ref}
177
- onPress={this._onPress}
178
- />;
179
- }
180
-
181
- _ref(ref) {
182
- this.renderer = ref;
183
- }
184
-
185
- _onPress(event) {
186
- event.stopPropagation();
187
- if (this.props.onPress) {
188
- this.props.onPress(event);
189
- }
190
- }
191
-
192
- _runCommand(name, args) {
193
- switch (Platform.OS) {
194
- case 'android':
195
- NativeModules.UIManager.dispatchViewManagerCommand(
196
- this._getHandle(),
197
- this._uiManagerCommand(name),
198
- args
199
- );
200
- break;
201
-
202
- case 'ios':
203
- this._mapManagerCommand(name)(this._getHandle(), ...args);
204
- break;
205
-
206
- default:
207
- break;
208
- }
209
- }
210
-
211
- _getHandle() {
212
- return findNodeHandle(this.renderer);
213
- }
214
-
215
- _uiManagerCommand(name) {
216
- const UIManager = NativeModules.UIManager;
217
- const componentName = "RMFDirectionsRenderer";
218
-
219
- if (!UIManager.getViewManagerConfig) {
220
- // RN < 0.58
221
- return UIManager[componentName].Commands[name];
222
- }
223
-
224
- // RN >= 0.58
225
- return UIManager.getViewManagerConfig(componentName).Commands[name];
226
- }
227
-
228
- _mapManagerCommand(name) {
229
- return NativeModules[`RMFDirectionsRenderer`][name];
230
- }
231
- }
232
-
233
- MFDirectionsRenderer.propTypes = propTypes;
234
-
235
- var RMFDirectionsRenderer = requireNativeComponent(`RMFDirectionsRenderer`, MFDirectionsRenderer);
236
-
237
- export { MFDirectionsRenderer }
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';
4
+ import {
5
+ requireNativeComponent,
6
+ Platform,
7
+ Image,
8
+ NativeModules,
9
+ findNodeHandle,
10
+ processColor
11
+ } from 'react-native';
12
+
13
+ const viewPropTypes = ViewPropTypes || View.propTypes;
14
+
15
+ const propTypes = {
16
+ ...viewPropTypes,
17
+
18
+ /**
19
+ * The directions to display on the map,
20
+ * retrieved as an array of array of coordinates to describe the routes.
21
+ * Similar to directions prop but has higher priority
22
+ */
23
+ routes: PropTypes.arrayOf(
24
+ PropTypes.arrayOf(
25
+ PropTypes.shape({
26
+ latitude: PropTypes.number.isRequired,
27
+ longitude: PropTypes.number.isRequired,
28
+ })
29
+ )
30
+ ),
31
+
32
+ /**
33
+ * The directions to display on the map,
34
+ * retrieved as a json string from Get route Map4D API (/sdk/route).
35
+ * Similar to routes prop but with lower priority
36
+ */
37
+ directions: PropTypes.string,
38
+
39
+ /**
40
+ * The index of the main route, default value is 0.
41
+ */
42
+ activedIndex: PropTypes.number,
43
+
44
+ /**
45
+ * The active route stroke width.
46
+ */
47
+ activeStrokeWidth: PropTypes.number,
48
+
49
+ /**
50
+ * The active route color.
51
+ */
52
+ activeStrokeColor: ColorPropType,
53
+
54
+ /**
55
+ * The active route outline stroke width.
56
+ */
57
+ activeOutlineWidth: PropTypes.number,
58
+
59
+ /**
60
+ * The active route outline color.
61
+ */
62
+ activeOutlineColor: ColorPropType,
63
+
64
+ /**
65
+ * The inactive route stroke width.
66
+ */
67
+ inactiveStrokeWidth: PropTypes.number,
68
+
69
+ /**
70
+ * The inactive route color.
71
+ */
72
+ inactiveStrokeColor: ColorPropType,
73
+
74
+ /**
75
+ * The inactive route outline stroke width.
76
+ */
77
+ inactiveOutlineWidth: PropTypes.number,
78
+
79
+ /**
80
+ * The inactive route outline color.
81
+ */
82
+ inactiveOutlineColor: ColorPropType,
83
+
84
+ /**
85
+ * The options of the origin POI.
86
+ */
87
+ originPOIOptions: PropTypes.shape({
88
+ coordinate: PropTypes.shape({
89
+ latitude: PropTypes.number.isRequired,
90
+ longitude: PropTypes.number.isRequired,
91
+ }),
92
+
93
+ icon: PropTypes.shape({
94
+ uri: PropTypes.any.isRequired
95
+ }),
96
+
97
+ title: PropTypes.string,
98
+
99
+ titleColor: ColorPropType,
100
+
101
+ visible: PropTypes.bool,
102
+ }),
103
+
104
+ /**
105
+ * The options of the destination POI.
106
+ */
107
+ destinationPOIOptions: PropTypes.shape({
108
+ coordinate: PropTypes.shape({
109
+ latitude: PropTypes.number.isRequired,
110
+ longitude: PropTypes.number.isRequired,
111
+ }),
112
+
113
+ icon: PropTypes.shape({
114
+ uri: PropTypes.any.isRequired
115
+ }),
116
+
117
+ title: PropTypes.string,
118
+
119
+ titleColor: ColorPropType,
120
+
121
+ visible: PropTypes.bool,
122
+ }),
123
+
124
+ /**
125
+ * Callback that is called when the user presses on the routes.
126
+ */
127
+ onPress: PropTypes.func,
128
+ };
129
+
130
+ class MFDirectionsRenderer extends React.Component {
131
+ constructor(props) {
132
+ super(props)
133
+ this._ref = this._ref.bind(this)
134
+ this._onPress = this._onPress.bind(this)
135
+ }
136
+
137
+ setActivedIndex(index) {
138
+ this._runCommand("setActivedIndex", [index])
139
+ }
140
+
141
+ setRoutes(routes) {
142
+ this._runCommand("setRoutes", [routes])
143
+ }
144
+
145
+ setDirections(directions) {
146
+ this._runCommand("setDirections", [directions])
147
+ }
148
+
149
+ render() {
150
+ let originPOIOptions = this.props.originPOIOptions
151
+ if (originPOIOptions) {
152
+ if (originPOIOptions.titleColor) {
153
+ originPOIOptions.titleColor = processColor(originPOIOptions.titleColor)
154
+ }
155
+ if (originPOIOptions.icon) {
156
+ let uri = Image.resolveAssetSource(originPOIOptions.icon.uri) || {uri: originPOIOptions.icon.uri};
157
+ originPOIOptions.icon = {uri: uri.uri}
158
+ }
159
+ }
160
+
161
+ let destinationPOIOptions = this.props.destinationPOIOptions
162
+ if (destinationPOIOptions) {
163
+ if (destinationPOIOptions.titleColor) {
164
+ destinationPOIOptions.titleColor = processColor(destinationPOIOptions.titleColor)
165
+ }
166
+ if (destinationPOIOptions.icon) {
167
+ let uri = Image.resolveAssetSource(destinationPOIOptions.icon.uri) || {uri: destinationPOIOptions.icon.uri};
168
+ destinationPOIOptions.icon = {uri: uri.uri}
169
+ }
170
+ }
171
+
172
+ return <RMFDirectionsRenderer
173
+ {...this.props}
174
+ originPOIOptions={originPOIOptions}
175
+ destinationPOIOptions={destinationPOIOptions}
176
+ ref={this._ref}
177
+ onPress={this._onPress}
178
+ />;
179
+ }
180
+
181
+ _ref(ref) {
182
+ this.renderer = ref;
183
+ }
184
+
185
+ _onPress(event) {
186
+ event.stopPropagation();
187
+ if (this.props.onPress) {
188
+ this.props.onPress(event);
189
+ }
190
+ }
191
+
192
+ _runCommand(name, args) {
193
+ switch (Platform.OS) {
194
+ case 'android':
195
+ NativeModules.UIManager.dispatchViewManagerCommand(
196
+ this._getHandle(),
197
+ this._uiManagerCommand(name),
198
+ args
199
+ );
200
+ break;
201
+
202
+ case 'ios':
203
+ this._mapManagerCommand(name)(this._getHandle(), ...args);
204
+ break;
205
+
206
+ default:
207
+ break;
208
+ }
209
+ }
210
+
211
+ _getHandle() {
212
+ return findNodeHandle(this.renderer);
213
+ }
214
+
215
+ _uiManagerCommand(name) {
216
+ const UIManager = NativeModules.UIManager;
217
+ const componentName = "RMFDirectionsRenderer";
218
+
219
+ if (!UIManager.getViewManagerConfig) {
220
+ // RN < 0.58
221
+ return UIManager[componentName].Commands[name];
222
+ }
223
+
224
+ // RN >= 0.58
225
+ return UIManager.getViewManagerConfig(componentName).Commands[name];
226
+ }
227
+
228
+ _mapManagerCommand(name) {
229
+ return NativeModules[`RMFDirectionsRenderer`][name];
230
+ }
231
+ }
232
+
233
+ MFDirectionsRenderer.propTypes = propTypes;
234
+
235
+ var RMFDirectionsRenderer = requireNativeComponent(`RMFDirectionsRenderer`, MFDirectionsRenderer);
236
+
237
+ export { MFDirectionsRenderer }