react-native-map4d-map-dtqg 0.1.4 → 0.1.6

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 (217) hide show
  1. package/README.md +58 -0
  2. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  3. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  4. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  5. package/android/build.gradle +23 -2
  6. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +39 -27
  7. package/ios/Map4dMap.h +12 -3
  8. package/ios/Map4dMap.m +108 -3
  9. package/ios/Map4dMapTurbo.mm +16 -0
  10. package/ios/RMFCircleManager.m +40 -68
  11. package/ios/RMFDirectionsRendererManager.m +26 -24
  12. package/ios/RMFMapViewManager.m +64 -149
  13. package/ios/RMFMarkerManager.m +36 -64
  14. package/ios/RMFPOIManager.m +40 -74
  15. package/ios/RMFPolygonManager.m +38 -60
  16. package/ios/RMFPolylineManager.m +36 -58
  17. package/ios/building/RMFBuildingManager.m +36 -64
  18. package/lib/commonjs/components/MFBanDoSo/constants.js +30 -0
  19. package/lib/commonjs/components/MFBanDoSo/constants.js.map +1 -0
  20. package/lib/commonjs/components/MFBanDoSo/helpers.js +200 -0
  21. package/lib/commonjs/components/MFBanDoSo/helpers.js.map +1 -0
  22. package/lib/commonjs/components/MFBanDoSo/propTypes.js +18 -0
  23. package/lib/commonjs/components/MFBanDoSo/propTypes.js.map +1 -0
  24. package/lib/commonjs/components/MFBanDoSo/styles.js +334 -0
  25. package/lib/commonjs/components/MFBanDoSo/styles.js.map +1 -0
  26. package/lib/commonjs/components/MFBanDoSo/ui.js +231 -0
  27. package/lib/commonjs/components/MFBanDoSo/ui.js.map +1 -0
  28. package/lib/commonjs/components/MFBanDoSo.js +201 -73
  29. package/lib/commonjs/components/MFBanDoSo.js.map +1 -1
  30. package/lib/commonjs/components/MFBuilding.js +15 -90
  31. package/lib/commonjs/components/MFBuilding.js.map +1 -1
  32. package/lib/commonjs/components/MFCircle.js +20 -88
  33. package/lib/commonjs/components/MFCircle.js.map +1 -1
  34. package/lib/commonjs/components/MFDirectionsRenderer.js +15 -93
  35. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
  36. package/lib/commonjs/components/MFMapView.js +50 -147
  37. package/lib/commonjs/components/MFMapView.js.map +1 -1
  38. package/lib/commonjs/components/MFMarker.js +15 -101
  39. package/lib/commonjs/components/MFMarker.js.map +1 -1
  40. package/lib/commonjs/components/MFPOI.js +17 -92
  41. package/lib/commonjs/components/MFPOI.js.map +1 -1
  42. package/lib/commonjs/components/MFPolygon.js +15 -87
  43. package/lib/commonjs/components/MFPolygon.js.map +1 -1
  44. package/lib/commonjs/components/MFPolyline.js +17 -87
  45. package/lib/commonjs/components/MFPolyline.js.map +1 -1
  46. package/lib/commonjs/components/MFTileOverlay.js +7 -15
  47. package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
  48. package/lib/commonjs/components/Map4dMapView.js +1 -4
  49. package/lib/commonjs/components/Map4dMapView.js.map +1 -1
  50. package/lib/commonjs/components/extends/AreaFocusManager.js +4 -38
  51. package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -1
  52. package/lib/commonjs/components/extends/AreaFocuser.js +1 -17
  53. package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
  54. package/lib/commonjs/components/extends/BoundHelper.js +0 -6
  55. package/lib/commonjs/components/extends/BoundHelper.js.map +1 -1
  56. package/lib/commonjs/components/extends/area/AreaFocusAreas.js +0 -37
  57. package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -1
  58. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +1 -35
  59. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
  60. package/lib/commonjs/components/extends/area/AreaFocusSession.js +0 -18
  61. package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -1
  62. package/lib/commonjs/components/extends/area/AreaFocusTypes.js +2 -3
  63. package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -1
  64. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +1 -2
  65. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -1
  66. package/lib/commonjs/components/internal/GeojsonStyleUtils.js +20 -31
  67. package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -1
  68. package/lib/commonjs/index.js +0 -11
  69. package/lib/commonjs/index.js.map +1 -1
  70. package/lib/commonjs/native/Map4dMapNativeModule.js +10 -0
  71. package/lib/commonjs/native/Map4dMapNativeModule.js.map +1 -0
  72. package/lib/commonjs/native/NativeModuleResolver.js +35 -0
  73. package/lib/commonjs/native/NativeModuleResolver.js.map +1 -0
  74. package/lib/commonjs/native/ViewManagerCommand.js +67 -0
  75. package/lib/commonjs/native/ViewManagerCommand.js.map +1 -0
  76. package/lib/commonjs/package.json +1 -0
  77. package/lib/commonjs/specs/NativeMap4dMap.js +9 -0
  78. package/lib/commonjs/specs/NativeMap4dMap.js.map +1 -0
  79. package/lib/module/components/MFBanDoSo/constants.js +25 -0
  80. package/lib/module/components/MFBanDoSo/constants.js.map +1 -0
  81. package/lib/module/components/MFBanDoSo/helpers.js +188 -0
  82. package/lib/module/components/MFBanDoSo/helpers.js.map +1 -0
  83. package/lib/module/components/MFBanDoSo/propTypes.js +14 -0
  84. package/lib/module/components/MFBanDoSo/propTypes.js.map +1 -0
  85. package/lib/module/components/MFBanDoSo/styles.js +332 -0
  86. package/lib/module/components/MFBanDoSo/styles.js.map +1 -0
  87. package/lib/module/components/MFBanDoSo/ui.js +224 -0
  88. package/lib/module/components/MFBanDoSo/ui.js.map +1 -0
  89. package/lib/module/components/MFBanDoSo.js +203 -63
  90. package/lib/module/components/MFBanDoSo.js.map +1 -1
  91. package/lib/module/components/MFBuilding.js +17 -82
  92. package/lib/module/components/MFBuilding.js.map +1 -1
  93. package/lib/module/components/MFCircle.js +22 -80
  94. package/lib/module/components/MFCircle.js.map +1 -1
  95. package/lib/module/components/MFDirectionsRenderer.js +16 -85
  96. package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
  97. package/lib/module/components/MFMapView.js +51 -136
  98. package/lib/module/components/MFMapView.js.map +1 -1
  99. package/lib/module/components/MFMarker.js +17 -92
  100. package/lib/module/components/MFMarker.js.map +1 -1
  101. package/lib/module/components/MFPOI.js +19 -84
  102. package/lib/module/components/MFPOI.js.map +1 -1
  103. package/lib/module/components/MFPolygon.js +17 -79
  104. package/lib/module/components/MFPolygon.js.map +1 -1
  105. package/lib/module/components/MFPolyline.js +19 -79
  106. package/lib/module/components/MFPolyline.js.map +1 -1
  107. package/lib/module/components/MFTileOverlay.js +10 -9
  108. package/lib/module/components/MFTileOverlay.js.map +1 -1
  109. package/lib/module/components/Map4dMapView.js +2 -0
  110. package/lib/module/components/Map4dMapView.js.map +1 -1
  111. package/lib/module/components/extends/AreaFocusManager.js +6 -32
  112. package/lib/module/components/extends/AreaFocusManager.js.map +1 -1
  113. package/lib/module/components/extends/AreaFocuser.js +3 -15
  114. package/lib/module/components/extends/AreaFocuser.js.map +1 -1
  115. package/lib/module/components/extends/BoundHelper.js +2 -5
  116. package/lib/module/components/extends/BoundHelper.js.map +1 -1
  117. package/lib/module/components/extends/area/AreaFocusAreas.js +2 -33
  118. package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -1
  119. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +2 -32
  120. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
  121. package/lib/module/components/extends/area/AreaFocusSession.js +2 -17
  122. package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -1
  123. package/lib/module/components/extends/area/AreaFocusTypes.js +3 -0
  124. package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -1
  125. package/lib/module/components/internal/DefaultRoadmapStyle.js +2 -0
  126. package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -1
  127. package/lib/module/components/internal/GeojsonStyleUtils.js +21 -28
  128. package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -1
  129. package/lib/module/index.js +2 -0
  130. package/lib/module/index.js.map +1 -1
  131. package/lib/module/native/Map4dMapNativeModule.js +5 -0
  132. package/lib/module/native/Map4dMapNativeModule.js.map +1 -0
  133. package/lib/module/native/NativeModuleResolver.js +29 -0
  134. package/lib/module/native/NativeModuleResolver.js.map +1 -0
  135. package/lib/module/native/ViewManagerCommand.js +61 -0
  136. package/lib/module/native/ViewManagerCommand.js.map +1 -0
  137. package/lib/module/specs/NativeMap4dMap.js +5 -0
  138. package/lib/module/specs/NativeMap4dMap.js.map +1 -0
  139. package/lib/typescript/components/MFBanDoSo/constants.d.ts +11 -0
  140. package/lib/typescript/components/MFBanDoSo/constants.d.ts.map +1 -0
  141. package/lib/typescript/components/MFBanDoSo/helpers.d.ts +14 -0
  142. package/lib/typescript/components/MFBanDoSo/helpers.d.ts.map +1 -0
  143. package/lib/typescript/components/MFBanDoSo/propTypes.d.ts +2 -0
  144. package/lib/typescript/components/MFBanDoSo/propTypes.d.ts.map +1 -0
  145. package/lib/typescript/components/MFBanDoSo/styles.d.ts +336 -0
  146. package/lib/typescript/components/MFBanDoSo/styles.d.ts.map +1 -0
  147. package/lib/typescript/components/MFBanDoSo/ui.d.ts +32 -0
  148. package/lib/typescript/components/MFBanDoSo/ui.d.ts.map +1 -0
  149. package/lib/typescript/components/MFBanDoSo.d.ts +38 -0
  150. package/lib/typescript/components/MFBanDoSo.d.ts.map +1 -0
  151. package/lib/typescript/components/MFBuilding.d.ts +24 -0
  152. package/lib/typescript/components/MFBuilding.d.ts.map +1 -0
  153. package/lib/typescript/components/MFCircle.d.ts +24 -0
  154. package/lib/typescript/components/MFCircle.d.ts.map +1 -0
  155. package/lib/typescript/components/MFDirectionsRenderer.d.ts +19 -0
  156. package/lib/typescript/components/MFDirectionsRenderer.d.ts.map +1 -0
  157. package/lib/typescript/components/MFMapView.d.ts +66 -0
  158. package/lib/typescript/components/MFMapView.d.ts.map +1 -0
  159. package/lib/typescript/components/MFMarker.d.ts +26 -0
  160. package/lib/typescript/components/MFMarker.d.ts.map +1 -0
  161. package/lib/typescript/components/MFPOI.d.ts +24 -0
  162. package/lib/typescript/components/MFPOI.d.ts.map +1 -0
  163. package/lib/typescript/components/MFPolygon.d.ts +24 -0
  164. package/lib/typescript/components/MFPolygon.d.ts.map +1 -0
  165. package/lib/typescript/components/MFPolyline.d.ts +24 -0
  166. package/lib/typescript/components/MFPolyline.d.ts.map +1 -0
  167. package/lib/typescript/components/MFTileOverlay.d.ts +12 -0
  168. package/lib/typescript/components/MFTileOverlay.d.ts.map +1 -0
  169. package/lib/typescript/components/Map4dMapView.d.ts +8 -7
  170. package/lib/typescript/components/Map4dMapView.d.ts.map +1 -0
  171. package/lib/typescript/components/extends/AreaFocusManager.d.ts +34 -0
  172. package/lib/typescript/components/extends/AreaFocusManager.d.ts.map +1 -0
  173. package/lib/typescript/components/extends/AreaFocuser.d.ts +15 -0
  174. package/lib/typescript/components/extends/AreaFocuser.d.ts.map +1 -0
  175. package/lib/typescript/components/extends/BoundHelper.d.ts +11 -0
  176. package/lib/typescript/components/extends/BoundHelper.d.ts.map +1 -0
  177. package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts +58 -0
  178. package/lib/typescript/components/extends/area/AreaFocusAreas.d.ts.map +1 -0
  179. package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts +19 -0
  180. package/lib/typescript/components/extends/area/AreaFocusGeometryUtils.d.ts.map +1 -0
  181. package/lib/typescript/components/extends/area/AreaFocusSession.d.ts +14 -0
  182. package/lib/typescript/components/extends/area/AreaFocusSession.d.ts.map +1 -0
  183. package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts +40 -0
  184. package/lib/typescript/components/extends/area/AreaFocusTypes.d.ts.map +1 -0
  185. package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts +820 -0
  186. package/lib/typescript/components/internal/DefaultRoadmapStyle.d.ts.map +1 -0
  187. package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts +3 -0
  188. package/lib/typescript/components/internal/GeojsonStyleUtils.d.ts.map +1 -0
  189. package/lib/typescript/index.d.ts +13 -0
  190. package/lib/typescript/index.d.ts.map +1 -0
  191. package/lib/typescript/native/Map4dMapNativeModule.d.ts +2 -0
  192. package/lib/typescript/native/Map4dMapNativeModule.d.ts.map +1 -0
  193. package/lib/typescript/native/NativeModuleResolver.d.ts +3 -0
  194. package/lib/typescript/native/NativeModuleResolver.d.ts.map +1 -0
  195. package/lib/typescript/native/ViewManagerCommand.d.ts +11 -0
  196. package/lib/typescript/native/ViewManagerCommand.d.ts.map +1 -0
  197. package/package.json +27 -11
  198. package/src/components/MFBanDoSo/constants.js +38 -0
  199. package/src/components/MFBanDoSo/helpers.js +273 -0
  200. package/src/components/MFBanDoSo/propTypes.js +14 -0
  201. package/src/components/MFBanDoSo/styles.js +323 -0
  202. package/src/components/MFBanDoSo/ui.js +261 -0
  203. package/src/components/MFBanDoSo.js +280 -78
  204. package/src/components/MFBuilding.js +8 -48
  205. package/src/components/MFCircle.js +8 -48
  206. package/src/components/MFDirectionsRenderer.js +8 -47
  207. package/src/components/MFMapView.js +31 -53
  208. package/src/components/MFMarker.js +9 -50
  209. package/src/components/MFPOI.js +8 -48
  210. package/src/components/MFPolygon.js +8 -48
  211. package/src/components/MFPolyline.js +8 -48
  212. package/src/components/internal/GeojsonStyleUtils.js +3 -0
  213. package/src/native/Map4dMapNativeModule.js +3 -0
  214. package/src/native/NativeModuleResolver.js +33 -0
  215. package/src/native/ViewManagerCommand.js +82 -0
  216. package/src/specs/NativeMap4dMap.js +12 -0
  217. package/ios/Map4dMapViewManager.m +0 -34
@@ -1,92 +1,232 @@
1
- import PropTypes from 'prop-types';
2
- import { MFMapView } from './MFMapView';
3
- import { buildGeojsonStyle, createCategoryItemsSignature } from './internal/GeojsonStyleUtils';
4
- const FilterStylePropType = PropTypes.shape({
5
- kind: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
6
- kind_detail: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)])
7
- });
8
- const DrawLinePropType = PropTypes.shape({
9
- color: PropTypes.string,
10
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.array])
11
- });
12
- const DrawFillPropType = PropTypes.shape({
13
- color: PropTypes.string
14
- });
15
- const DrawSymbolPropType = PropTypes.shape({
16
- icon_image: PropTypes.string,
17
- icon_index: PropTypes.number,
18
- icon_color: PropTypes.string,
19
- use_direct_icon_url: PropTypes.bool
20
- });
21
- const CategoryStylePropType = PropTypes.shape({
22
- line: PropTypes.arrayOf(PropTypes.shape({
23
- layer: PropTypes.string,
24
- filter: FilterStylePropType,
25
- draw: DrawLinePropType
26
- })),
27
- fill: PropTypes.arrayOf(PropTypes.shape({
28
- layer: PropTypes.string,
29
- filter: FilterStylePropType,
30
- draw: DrawFillPropType
31
- })),
32
- symbol: PropTypes.arrayOf(PropTypes.shape({
33
- layer: PropTypes.string,
34
- filter: FilterStylePropType,
35
- draw: DrawSymbolPropType
36
- }))
37
- });
38
- const CategoryItemPropType = PropTypes.shape({
39
- key: PropTypes.string,
40
- title: PropTypes.string,
41
- group: PropTypes.string,
42
- order: PropTypes.number,
43
- checked: PropTypes.bool,
44
- style: CategoryStylePropType
45
- });
1
+ "use strict";
46
2
 
3
+ import React from 'react';
4
+ import { Animated, Easing } from 'react-native';
5
+ import { LEGEND_TITLE, SELECTOR_CLOSE_DURATION_MS, SELECTOR_DRAWER_TRANSLATE_X, SELECTOR_OPEN_DURATION_MS, SELECTOR_TITLE, getCategoryConfigUrl, getSourceUrl } from './MFBanDoSo/constants';
6
+ import { createCategoryGroupSections, createSelectedCategoryItemsSignature, getSelectedCategoryItems, normalizeCategoryItems, reconcileExpandedGroupKeys, resolveCategoryGroupMetadataFromResponse, resolveCategoryItemColor, resolveItemsFromCategoryResponse, toggleCategoryGroupChecked, toggleCategoryItemChecked } from './MFBanDoSo/helpers';
7
+ import { banDoSoPropTypes } from './MFBanDoSo/propTypes';
8
+ import { MFMapView } from './MFMapView';
9
+ import { LayerButton, LegendButton, LegendPanel, SelectorDrawer } from './MFBanDoSo/ui';
10
+ import { buildGeojsonStyle } from './internal/GeojsonStyleUtils';
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
47
12
  class MFBanDoSo extends MFMapView {
48
13
  constructor(props) {
49
14
  super(props);
50
15
  this._appliedGeojsonStyle = null;
16
+ this._isMounted = false;
17
+ this._categoryRequestId = 0;
18
+ this._selectorAnim = new Animated.Value(0);
19
+ this.state = {
20
+ ...this.state,
21
+ categoryItems: [],
22
+ expandedGroupKeys: {},
23
+ groupTitleByKey: {},
24
+ groupOrderedKeys: [],
25
+ isLegendVisible: false,
26
+ isSelectorVisible: false,
27
+ isSelectorMounted: false
28
+ };
29
+ this._toggleItem = this._toggleItem.bind(this);
30
+ this._toggleGroupChecked = this._toggleGroupChecked.bind(this);
31
+ this._toggleGroup = this._toggleGroup.bind(this);
32
+ this._toggleSelectorVisibility = this._toggleSelectorVisibility.bind(this);
33
+ this._toggleLegendVisibility = this._toggleLegendVisibility.bind(this);
34
+ this._openSelector = this._openSelector.bind(this);
35
+ this._closeSelector = this._closeSelector.bind(this);
36
+ this._snapSelectorOpen = this._snapSelectorOpen.bind(this);
51
37
  }
52
-
53
38
  componentDidMount() {
39
+ this._isMounted = true;
40
+ this._loadCategoryItems();
54
41
  this._syncGeojsonStyle();
55
42
  }
56
-
57
43
  componentDidUpdate(prevProps, prevState) {
58
44
  const mapReadyChanged = prevState.isReady !== this.state.isReady;
59
45
  const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;
60
- const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;
61
- const itemsChanged = createCategoryItemsSignature(prevProps.items) !== createCategoryItemsSignature(this.props.items);
62
-
63
- if (mapReadyChanged || mapStyleChanged || sourceUrlChanged || itemsChanged) {
46
+ const isStagingChanged = prevProps.isStaging !== this.props.isStaging;
47
+ if (isStagingChanged) {
48
+ this._loadCategoryItems();
49
+ }
50
+ const itemsChanged = createSelectedCategoryItemsSignature(prevState.categoryItems) !== createSelectedCategoryItemsSignature(this.state.categoryItems);
51
+ if (mapReadyChanged || mapStyleChanged || isStagingChanged || itemsChanged) {
64
52
  this._syncGeojsonStyle();
65
53
  }
66
54
  }
67
-
55
+ componentWillUnmount() {
56
+ this._isMounted = false;
57
+ }
58
+ async _loadCategoryItems() {
59
+ const requestId = this._categoryRequestId + 1;
60
+ this._categoryRequestId = requestId;
61
+ try {
62
+ const response = await fetch(getCategoryConfigUrl(this.props.isStaging));
63
+ if (!response.ok) {
64
+ throw new Error(`Failed to fetch category config: ${response.status}`);
65
+ }
66
+ const json = await response.json();
67
+ const nextItems = resolveItemsFromCategoryResponse(json);
68
+ const groupMetadata = resolveCategoryGroupMetadataFromResponse(json);
69
+ if (!this._isMounted || requestId !== this._categoryRequestId) {
70
+ return;
71
+ }
72
+ this.setState(prevState => {
73
+ const categoryItems = normalizeCategoryItems(nextItems);
74
+ const groupSections = createCategoryGroupSections(categoryItems, groupMetadata.titleByKey, groupMetadata.orderedKeys);
75
+ return {
76
+ categoryItems,
77
+ groupTitleByKey: groupMetadata.titleByKey,
78
+ groupOrderedKeys: groupMetadata.orderedKeys,
79
+ expandedGroupKeys: reconcileExpandedGroupKeys(groupSections, prevState.expandedGroupKeys)
80
+ };
81
+ });
82
+ } catch (error) {
83
+ if (requestId !== this._categoryRequestId) {
84
+ return;
85
+ }
86
+ console.warn('Cannot load category items', error);
87
+ }
88
+ }
89
+ _toggleItem(targetKey, targetIndex) {
90
+ this.setState(prevState => ({
91
+ categoryItems: toggleCategoryItemChecked(prevState.categoryItems, targetKey, targetIndex)
92
+ }));
93
+ }
94
+ _toggleGroup(groupKey) {
95
+ if (typeof groupKey !== 'string' || groupKey.length === 0) {
96
+ return;
97
+ }
98
+ this.setState(prevState => ({
99
+ expandedGroupKeys: {
100
+ ...prevState.expandedGroupKeys,
101
+ [groupKey]: !(prevState.expandedGroupKeys[groupKey] !== false)
102
+ }
103
+ }));
104
+ }
105
+ _toggleGroupChecked(groupKey, checkedValue) {
106
+ this.setState(prevState => ({
107
+ categoryItems: toggleCategoryGroupChecked(prevState.categoryItems, groupKey, checkedValue)
108
+ }));
109
+ }
110
+ _toggleSelectorVisibility() {
111
+ if (this.state.isSelectorVisible) {
112
+ this._closeSelector();
113
+ return;
114
+ }
115
+ this._openSelector();
116
+ }
117
+ _toggleLegendVisibility() {
118
+ this.setState(prevState => ({
119
+ isLegendVisible: !prevState.isLegendVisible
120
+ }));
121
+ }
122
+ _openSelector() {
123
+ this.setState({
124
+ isSelectorMounted: true,
125
+ isSelectorVisible: true
126
+ }, () => {
127
+ Animated.timing(this._selectorAnim, {
128
+ toValue: 1,
129
+ duration: SELECTOR_OPEN_DURATION_MS,
130
+ easing: Easing.out(Easing.cubic),
131
+ useNativeDriver: true
132
+ }).start();
133
+ });
134
+ }
135
+ _closeSelector() {
136
+ Animated.timing(this._selectorAnim, {
137
+ toValue: 0,
138
+ duration: SELECTOR_CLOSE_DURATION_MS,
139
+ easing: Easing.in(Easing.cubic),
140
+ useNativeDriver: true
141
+ }).start(() => {
142
+ if (!this._isMounted) {
143
+ return;
144
+ }
145
+ this.setState({
146
+ isSelectorVisible: false,
147
+ isSelectorMounted: false
148
+ });
149
+ });
150
+ }
151
+ _snapSelectorOpen() {
152
+ Animated.timing(this._selectorAnim, {
153
+ toValue: 1,
154
+ duration: SELECTOR_OPEN_DURATION_MS,
155
+ easing: Easing.out(Easing.cubic),
156
+ useNativeDriver: true
157
+ }).start();
158
+ }
68
159
  _syncGeojsonStyle() {
69
160
  if (!this.state.isReady) {
70
161
  return;
71
162
  }
72
-
73
- const items = this.props.items || [];
74
- const geojsonStyle = buildGeojsonStyle(this.props.mapStyle, this.props.sourceUrl, items);
75
-
163
+ const items = getSelectedCategoryItems(this.state.categoryItems);
164
+ const geojsonStyle = buildGeojsonStyle(this.props.mapStyle, getSourceUrl(this.props.isStaging), items);
76
165
  if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {
77
166
  return;
78
167
  }
79
-
80
168
  this._appliedGeojsonStyle = geojsonStyle;
81
-
82
169
  this._runCommand('setMapStyle', [geojsonStyle]);
83
170
  }
84
-
171
+ render() {
172
+ const items = this.state.categoryItems;
173
+ const groupSections = createCategoryGroupSections(items, this.state.groupTitleByKey, this.state.groupOrderedKeys);
174
+ const hasItems = Array.isArray(items) && items.length > 0;
175
+ const showLayerButton = hasItems;
176
+ const showSelector = this.state.isSelectorMounted && hasItems;
177
+ const showLegendButton = hasItems;
178
+ const showLegend = this.state.isLegendVisible && hasItems;
179
+ const selectorTitle = SELECTOR_TITLE;
180
+ const legendTitle = LEGEND_TITLE;
181
+ const backdropAnimatedStyle = {
182
+ opacity: this._selectorAnim.interpolate({
183
+ inputRange: [0, 1],
184
+ outputRange: [0, 1]
185
+ })
186
+ };
187
+ const panelAnimatedStyle = {
188
+ transform: [{
189
+ translateX: this._selectorAnim.interpolate({
190
+ inputRange: [0, 1],
191
+ outputRange: [SELECTOR_DRAWER_TRANSLATE_X, 0]
192
+ })
193
+ }]
194
+ };
195
+ return /*#__PURE__*/_jsxs(React.Fragment, {
196
+ children: [super.render(), /*#__PURE__*/_jsx(LayerButton, {
197
+ show: showLayerButton,
198
+ isActive: this.state.isSelectorVisible,
199
+ onPress: this._toggleSelectorVisibility
200
+ }), /*#__PURE__*/_jsx(LegendButton, {
201
+ show: showLegendButton,
202
+ isActive: this.state.isLegendVisible,
203
+ onPress: this._toggleLegendVisibility
204
+ }), /*#__PURE__*/_jsx(SelectorDrawer, {
205
+ show: showSelector,
206
+ title: selectorTitle,
207
+ groupSections: groupSections,
208
+ expandedGroupKeys: this.state.expandedGroupKeys,
209
+ dragAnim: this._selectorAnim,
210
+ backdropAnimatedStyle: backdropAnimatedStyle,
211
+ panelAnimatedStyle: panelAnimatedStyle,
212
+ onClose: this._toggleSelectorVisibility,
213
+ onDragCancel: this._snapSelectorOpen,
214
+ onToggleGroup: this._toggleGroup,
215
+ onToggleGroupChecked: this._toggleGroupChecked,
216
+ onToggleItem: this._toggleItem
217
+ }), /*#__PURE__*/_jsx(LegendPanel, {
218
+ show: showLegend,
219
+ title: legendTitle,
220
+ items: items,
221
+ getItemColor: item => resolveCategoryItemColor(item)
222
+ })]
223
+ });
224
+ }
85
225
  }
86
-
87
- MFBanDoSo.propTypes = { ...MFMapView.propTypes,
88
- items: PropTypes.arrayOf(CategoryItemPropType),
89
- sourceUrl: PropTypes.string.isRequired
226
+ MFBanDoSo.propTypes = banDoSoPropTypes;
227
+ MFBanDoSo.defaultProps = {
228
+ ...MFMapView.defaultProps,
229
+ isStaging: true
90
230
  };
91
231
  export { MFBanDoSo };
92
232
  //# sourceMappingURL=MFBanDoSo.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PropTypes","MFMapView","buildGeojsonStyle","createCategoryItemsSignature","FilterStylePropType","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","constructor","props","_appliedGeojsonStyle","componentDidMount","_syncGeojsonStyle","componentDidUpdate","prevProps","prevState","mapReadyChanged","isReady","state","mapStyleChanged","mapStyle","sourceUrlChanged","sourceUrl","itemsChanged","items","geojsonStyle","_runCommand","propTypes","isRequired"],"sources":["MFBanDoSo.js"],"sourcesContent":["import PropTypes from 'prop-types';\r\nimport { MFMapView } from './MFMapView';\r\nimport {\r\n buildGeojsonStyle,\r\n createCategoryItemsSignature,\r\n} from './internal/GeojsonStyleUtils';\r\n\r\nconst FilterStylePropType = PropTypes.shape({\r\n kind: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.arrayOf(PropTypes.string),\r\n ]),\r\n kind_detail: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.arrayOf(PropTypes.string),\r\n ]),\r\n});\r\n\r\nconst DrawLinePropType = PropTypes.shape({\r\n color: PropTypes.string,\r\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\r\n});\r\n\r\nconst DrawFillPropType = PropTypes.shape({\r\n color: PropTypes.string,\r\n});\r\n\r\nconst DrawSymbolPropType = PropTypes.shape({\r\n icon_image: PropTypes.string,\r\n icon_index: PropTypes.number,\r\n icon_color: PropTypes.string,\r\n use_direct_icon_url: PropTypes.bool,\r\n});\r\n\r\nconst CategoryStylePropType = PropTypes.shape({\r\n line: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawLinePropType,\r\n })\r\n ),\r\n fill: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawFillPropType,\r\n })\r\n ),\r\n symbol: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawSymbolPropType,\r\n })\r\n ),\r\n});\r\n\r\nconst CategoryItemPropType = PropTypes.shape({\r\n key: PropTypes.string,\r\n title: PropTypes.string,\r\n group: PropTypes.string,\r\n order: PropTypes.number,\r\n checked: PropTypes.bool,\r\n style: CategoryStylePropType,\r\n});\r\n\r\nclass MFBanDoSo extends MFMapView {\r\n constructor(props) {\r\n super(props);\r\n this._appliedGeojsonStyle = null;\r\n }\r\n\r\n componentDidMount() {\r\n this._syncGeojsonStyle();\r\n }\r\n\r\n componentDidUpdate(prevProps, prevState) {\r\n const mapReadyChanged = prevState.isReady !== this.state.isReady;\r\n const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;\r\n const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;\r\n const itemsChanged =\r\n createCategoryItemsSignature(prevProps.items) !==\r\n createCategoryItemsSignature(this.props.items);\r\n\r\n if (\r\n mapReadyChanged ||\r\n mapStyleChanged ||\r\n sourceUrlChanged ||\r\n itemsChanged\r\n ) {\r\n this._syncGeojsonStyle();\r\n }\r\n }\r\n\r\n _syncGeojsonStyle() {\r\n if (!this.state.isReady) {\r\n return;\r\n }\r\n\r\n const items = this.props.items || [];\r\n\r\n const geojsonStyle = buildGeojsonStyle(\r\n this.props.mapStyle,\r\n this.props.sourceUrl,\r\n items\r\n );\r\n\r\n if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {\r\n return;\r\n }\r\n\r\n this._appliedGeojsonStyle = geojsonStyle;\r\n this._runCommand('setMapStyle', [geojsonStyle]);\r\n }\r\n}\r\n\r\nMFBanDoSo.propTypes = {\r\n ...MFMapView.propTypes,\r\n items: PropTypes.arrayOf(CategoryItemPropType),\r\n sourceUrl: PropTypes.string.isRequired,\r\n};\r\n\r\nexport { MFBanDoSo };\r\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SACEC,iBADF,EAEEC,4BAFF,QAGO,8BAHP;AAKA,MAAMC,mBAAmB,GAAGJ,SAAS,CAACK,KAAV,CAAgB;EAC1CC,IAAI,EAAEN,SAAS,CAACO,SAAV,CAAoB,CACxBP,SAAS,CAACQ,MADc,EAExBR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAFwB,CAApB,CADoC;EAK1CE,WAAW,EAAEV,SAAS,CAACO,SAAV,CAAoB,CAC/BP,SAAS,CAACQ,MADqB,EAE/BR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAF+B,CAApB;AAL6B,CAAhB,CAA5B;AAWA,MAAMG,gBAAgB,GAAGX,SAAS,CAACK,KAAV,CAAgB;EACvCO,KAAK,EAAEZ,SAAS,CAACQ,MADsB;EAEvCK,KAAK,EAAEb,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACc,MAAX,EAAmBd,SAAS,CAACe,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AgC,CAACD,YAAD,CAAhC;EACD;;AA/C+B;;AAkDlClB,SAAS,CAACoB,SAAV,GAAsB,EACpB,GAAGxD,SAAS,CAACwD,SADO;EAEpBH,KAAK,EAAEtD,SAAS,CAACS,OAAV,CAAkBqB,oBAAlB,CAFa;EAGpBsB,SAAS,EAAEpD,SAAS,CAACQ,MAAV,CAAiBkD;AAHR,CAAtB;AAMA,SAASrB,SAAT"}
1
+ {"version":3,"names":["React","Animated","Easing","LEGEND_TITLE","SELECTOR_CLOSE_DURATION_MS","SELECTOR_DRAWER_TRANSLATE_X","SELECTOR_OPEN_DURATION_MS","SELECTOR_TITLE","getCategoryConfigUrl","getSourceUrl","createCategoryGroupSections","createSelectedCategoryItemsSignature","getSelectedCategoryItems","normalizeCategoryItems","reconcileExpandedGroupKeys","resolveCategoryGroupMetadataFromResponse","resolveCategoryItemColor","resolveItemsFromCategoryResponse","toggleCategoryGroupChecked","toggleCategoryItemChecked","banDoSoPropTypes","MFMapView","LayerButton","LegendButton","LegendPanel","SelectorDrawer","buildGeojsonStyle","jsx","_jsx","jsxs","_jsxs","MFBanDoSo","constructor","props","_appliedGeojsonStyle","_isMounted","_categoryRequestId","_selectorAnim","Value","state","categoryItems","expandedGroupKeys","groupTitleByKey","groupOrderedKeys","isLegendVisible","isSelectorVisible","isSelectorMounted","_toggleItem","bind","_toggleGroupChecked","_toggleGroup","_toggleSelectorVisibility","_toggleLegendVisibility","_openSelector","_closeSelector","_snapSelectorOpen","componentDidMount","_loadCategoryItems","_syncGeojsonStyle","componentDidUpdate","prevProps","prevState","mapReadyChanged","isReady","mapStyleChanged","mapStyle","isStagingChanged","isStaging","itemsChanged","componentWillUnmount","requestId","response","fetch","ok","Error","status","json","nextItems","groupMetadata","setState","groupSections","titleByKey","orderedKeys","error","console","warn","targetKey","targetIndex","groupKey","length","checkedValue","timing","toValue","duration","easing","out","cubic","useNativeDriver","start","in","items","geojsonStyle","_runCommand","render","hasItems","Array","isArray","showLayerButton","showSelector","showLegendButton","showLegend","selectorTitle","legendTitle","backdropAnimatedStyle","opacity","interpolate","inputRange","outputRange","panelAnimatedStyle","transform","translateX","Fragment","children","show","isActive","onPress","title","dragAnim","onClose","onDragCancel","onToggleGroup","onToggleGroupChecked","onToggleItem","getItemColor","item","propTypes","defaultProps"],"sourceRoot":"..\\..\\..\\src","sources":["components/MFBanDoSo.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,QAAQ,EACRC,MAAM,QACD,cAAc;AACrB,SACEC,YAAY,EACZC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,yBAAyB,EACzBC,cAAc,EACdC,oBAAoB,EACpBC,YAAY,QACP,uBAAuB;AAC9B,SACEC,2BAA2B,EAC3BC,oCAAoC,EACpCC,wBAAwB,EACxBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,wCAAwC,EACxCC,wBAAwB,EACxBC,gCAAgC,EAChCC,0BAA0B,EAC1BC,yBAAyB,QACpB,qBAAqB;AAC5B,SACEC,gBAAgB,QACX,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,aAAa;AACvC,SACEC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,cAAc,QACT,gBAAgB;AACvB,SACEC,iBAAiB,QACZ,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtC,MAAMC,SAAS,SAASV,SAAS,CAAC;EAChCW,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,oBAAoB,GAAG,IAAI;IAChC,IAAI,CAACC,UAAU,GAAG,KAAK;IACvB,IAAI,CAACC,kBAAkB,GAAG,CAAC;IAC3B,IAAI,CAACC,aAAa,GAAG,IAAIpC,QAAQ,CAACqC,KAAK,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACC,KAAK,GAAG;MACX,GAAG,IAAI,CAACA,KAAK;MACbC,aAAa,EAAE,EAAE;MACjBC,iBAAiB,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C7B4E,qBAAqB,EAAEA,qBAAsB;QAC7CK,kBAAkB,EAAEA,kBAAmB;QACvCU,OAAO,EAAE,IAAI,CAAC7E,yBAA0B;QACxC8E,YAAY,EAAE,IAAI,CAAC1E,iBAAkB;QACrC2E,aAAa,EAAE,IAAI,CAAChF,YAAa;QACjCiF,oBAAoB,EAAE,IAAI,CAAClF,mBAAoB;QAC/CmF,YAAY,EAAE,IAAI,CAACrF;MAAY,CAChC,CAAC,eACFnB,IAAA,CAACJ,WAAW;QACVmG,IAAI,EAAEb,UAAW;QACjBgB,KAAK,EAAEd,WAAY;QACnBZ,KAAK,EAAEA,KAAM;QACbiC,YAAY,EAAGC,IAAI,IAAKtH,wBAAwB,CAACsH,IAAI;MAAE,CACxD,CAAC;IAAA,CACY,CAAC;EAErB;AACF;AAEAvG,SAAS,CAACwG,SAAS,GAAGnH,gBAAgB;AACtCW,SAAS,CAACyG,YAAY,GAAG;EACvB,GAAGnH,SAAS,CAACmH,YAAY;EACzBrE,SAAS,EAAE;AACb,CAAC;AAED,SAASpC,SAAS","ignoreList":[]}
@@ -1,18 +1,20 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ "use strict";
2
2
 
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { ViewPropTypes } from 'deprecated-react-native-prop-types';
6
- import { requireNativeComponent, Platform, UIManager, NativeModules, findNodeHandle } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
6
+ import { runViewManagerCommand } from '../native/ViewManagerCommand';
7
+ import { requireNativeComponent, findNodeHandle } from 'react-native';
7
8
 
9
+ // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
10
+ import { jsx as _jsx } from "react/jsx-runtime";
8
11
  const viewPropTypes = ViewPropTypes || View.propTypes;
9
- const propTypes = { ...viewPropTypes,
10
-
12
+ const propTypes = {
13
+ ...viewPropTypes,
11
14
  /**
12
15
  * The name of the building.
13
16
  */
14
17
  name: PropTypes.string,
15
-
16
18
  /**
17
19
  * The position of the building
18
20
  */
@@ -23,173 +25,106 @@ const propTypes = { ...viewPropTypes,
23
25
  latitude: PropTypes.number.isRequired,
24
26
  longitude: PropTypes.number.isRequired
25
27
  }),
26
-
27
28
  /**
28
29
  * The model URL for the building.
29
30
  */
30
31
  modelUrl: PropTypes.string,
31
-
32
32
  /**
33
33
  * The texture URL for the building.
34
34
  */
35
35
  textureUrl: PropTypes.string,
36
-
37
36
  /**
38
37
  * The scale of the building.
39
38
  */
40
39
  scale: PropTypes.number,
41
-
42
40
  /**
43
41
  * The bearing of the building.
44
42
  */
45
43
  bearing: PropTypes.number,
46
-
47
44
  /**
48
45
  * The elevation of the building.
49
46
  */
50
47
  elevation: PropTypes.number,
51
-
52
48
  /**
53
49
  * Is the building selectable by the user ?
54
50
  */
55
51
  selected: PropTypes.bool,
56
-
57
52
  /**
58
53
  * touchable
59
54
  */
60
55
  touchable: PropTypes.bool,
61
-
62
56
  /**
63
57
  * visible
64
58
  */
65
59
  visible: PropTypes.bool,
66
-
67
60
  /**
68
61
  * userData
69
62
  */
70
63
  userData: PropTypes.object,
71
-
72
64
  /**
73
65
  * Callback that is called when the user presses on the building
74
66
  */
75
67
  onPress: PropTypes.func
76
68
  };
77
-
78
69
  class MFBuilding extends React.Component {
79
70
  constructor(props) {
80
71
  super(props);
81
72
  this._onPress = this._onPress.bind(this);
82
73
  this._ref = this._ref.bind(this);
83
74
  }
84
-
85
75
  _onPress(event) {
86
76
  event.stopPropagation();
87
-
88
77
  if (this.props.onPress) {
89
78
  this.props.onPress(event);
90
79
  }
91
80
  }
92
-
93
81
  _ref(ref) {
94
82
  this.building = ref;
95
83
  }
96
-
97
84
  setName(name) {
98
85
  this._runCommand("setName", [name]);
99
86
  }
100
-
101
87
  setScale(scale) {
102
88
  this._runCommand("setScale", [scale]);
103
89
  }
104
-
105
90
  setBearing(bearing) {
106
91
  this._runCommand("setBearing", [bearing]);
107
92
  }
108
-
109
93
  setElevation(elevation) {
110
94
  this._runCommand("setElevation", [elevation]);
111
95
  }
112
-
113
96
  setSelected(selected) {
114
97
  this._runCommand("setSelected", [selected]);
115
98
  }
116
-
117
99
  setTouchable(touchable) {
118
100
  this._runCommand("setTouchable", [touchable]);
119
101
  }
120
-
121
102
  setVisible(visible) {
122
103
  this._runCommand("setVisible", [visible]);
123
104
  }
124
-
125
105
  setUserData(userData) {
126
106
  this._runCommand("setUserData", [userData]);
127
107
  }
128
-
129
108
  _getHandle() {
130
109
  return findNodeHandle(this.building);
131
110
  }
132
-
133
111
  _runCommand(name, args) {
134
- switch (Platform.OS) {
135
- case 'android':
136
- {
137
- if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
138
- return;
139
- }
140
-
141
- const commandId = this._uiManagerCommand(name);
142
-
143
- if (commandId == null) {
144
- return;
145
- }
146
-
147
- UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
148
- break;
149
- }
150
-
151
- case 'ios':
152
- this._mapManagerCommand(name)(this._getHandle(), ...args);
153
-
154
- break;
155
-
156
- default:
157
- break;
158
- }
159
- }
160
-
161
- _uiManagerCommand(name) {
162
- const uiManager = UIManager || NativeModules.UIManager;
163
- const componentName = "RMFBuilding";
164
-
165
- if (!uiManager) {
166
- return null;
167
- }
168
-
169
- if (!uiManager.getViewManagerConfig) {
170
- // RN < 0.58
171
- const legacyConfig = uiManager[componentName];
172
- return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
173
- } // RN >= 0.58
174
-
175
-
176
- const config = uiManager.getViewManagerConfig(componentName);
177
- return config && config.Commands ? config.Commands[name] : null;
112
+ return runViewManagerCommand({
113
+ componentName: 'RMFBuilding',
114
+ moduleName: 'RMFBuilding',
115
+ commandName: name,
116
+ args,
117
+ reactTag: this._getHandle()
118
+ });
178
119
  }
179
-
180
- _mapManagerCommand(name) {
181
- return NativeModules[`RMFBuilding`][name];
182
- }
183
-
184
120
  render() {
185
- return /*#__PURE__*/React.createElement(RMFBuilding, _extends({}, this.props, {
121
+ return /*#__PURE__*/_jsx(RMFBuilding, {
122
+ ...this.props,
186
123
  ref: this._ref,
187
124
  onPress: this._onPress
188
- }));
125
+ });
189
126
  }
190
-
191
127
  }
192
-
193
128
  MFBuilding.propTypes = propTypes;
194
129
  var RMFBuilding = requireNativeComponent(`RMFBuilding`, MFBuilding);
195
130
  export { MFBuilding };
@@ -1 +1 @@
1
- {"version":3,"names":["React","PropTypes","ViewPropTypes","requireNativeComponent","Platform","UIManager","NativeModules","findNodeHandle","viewPropTypes","View","propTypes","name","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","args","OS","dispatchViewManagerCommand","commandId","_uiManagerCommand","_mapManagerCommand","uiManager","componentName","getViewManagerConfig","legacyConfig","Commands","config","render","RMFBuilding"],"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 UIManager,\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 if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {\r\n return;\r\n }\r\n\r\n const commandId = this._uiManagerCommand(name);\r\n if (commandId == null) {\r\n return;\r\n }\r\n\r\n UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);\r\n break;\r\n }\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 = UIManager || NativeModules.UIManager;\r\n const componentName = \"RMFBuilding\";\r\n\r\n if (!uiManager) {\r\n return null;\r\n }\r\n\r\n if (!uiManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n const legacyConfig = uiManager[componentName];\r\n return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;\r\n }\r\n\r\n // RN >= 0.58\r\n const config = uiManager.getViewManagerConfig(componentName);\r\n return config && config.Commands ? config.Commands[name] : null;\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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,QAA4B,oCAA5B;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,aAJF,EAKEC,cALF,QAMO,cANP,C,CAQA;;AACA,MAAMC,aAAa,GAAGN,aAAa,IAAIO,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;A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AW,GAAG/D,sBAAsB,CAAE,aAAF,EAAgB6B,UAAhB,CAAxC;AAEA,SAASA,UAAT"}
1
+ {"version":3,"names":["React","PropTypes","ViewPropTypes","runViewManagerCommand","requireNativeComponent","findNodeHandle","jsx","_jsx","viewPropTypes","View","propTypes","name","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","args","componentName","moduleName","commandName","reactTag","render","RMFBuilding"],"sourceRoot":"..\\..\\..\\src","sources":["components/MFBuilding.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,aAAa,QAAO,oCAAoC;AAChE,SAAQC,qBAAqB,QAAO,8BAA8B;AAClE,SACEC,sBAAsB,EACtBC,cAAc,QACT,cAAc;;AAErB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,MAAMC,aAAa,GAAGN,aAAa,IAAIO,IAAI,CAACC,SAAS;AAErD,MAAMA,SAAS,GAAG;EAChB,GAAGF,aAAa;EAEhB;AACF;AACA;EACEG,IAAI,EAAEV,SAAS,CAACW,MAAM;EAEtB;AACF;AACA;EACEC,UAAU,EAAEZ,SAAS,CAACa,KAAK,CAAC;IAC1B;AACJ;AACA;IACIC,QAAQ,EAAEd,SAAS,CAACe,MAAM,CAACC,UAAU;IACrCC,SAAS,EAAEjB,SAAS,CAACe,MAAM,CAACC;EAC9B,CAAC,CAAC;EAEF;AACF;AACA;EACEE,QAAQ,EAAElB,SAAS,CAACW,MAAM;EAE1B;AACF;AACA;EACEQ,UAAU,EAAEnB,SAAS,CAACW,MAAM;EAE5B;AACF;AACA;EACES,KAAK,EAAEpB,SAAS,CAACe,MAAM;EAEvB;AACF;AACA;EACEM,OAAO,EAAErB,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