react-native-map4d-map-dtqg 0.1.2 → 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 (195) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +133 -133
  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 -231
  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 -508
  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.map +1 -1
  99. package/lib/commonjs/components/MFBuilding.js +26 -26
  100. package/lib/commonjs/components/MFBuilding.js.map +1 -1
  101. package/lib/commonjs/components/MFCircle.js +20 -20
  102. package/lib/commonjs/components/MFCircle.js.map +1 -1
  103. package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
  104. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
  105. package/lib/commonjs/components/MFMapView.js +69 -69
  106. package/lib/commonjs/components/MFMapView.js.map +1 -1
  107. package/lib/commonjs/components/MFMarker.js +35 -35
  108. package/lib/commonjs/components/MFMarker.js.map +1 -1
  109. package/lib/commonjs/components/MFPOI.js +20 -20
  110. package/lib/commonjs/components/MFPOI.js.map +1 -1
  111. package/lib/commonjs/components/MFPolygon.js +22 -22
  112. package/lib/commonjs/components/MFPolygon.js.map +1 -1
  113. package/lib/commonjs/components/MFPolyline.js +18 -18
  114. package/lib/commonjs/components/MFPolyline.js.map +1 -1
  115. package/lib/commonjs/components/MFTileOverlay.js +9 -9
  116. package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
  117. package/lib/commonjs/components/Map4dMapView.js.map +1 -1
  118. package/lib/commonjs/components/extends/AreaFocusManager.js +16 -16
  119. package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -1
  120. package/lib/commonjs/components/extends/AreaFocuser.js +2 -2
  121. package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
  122. package/lib/commonjs/components/extends/BoundHelper.js.map +1 -1
  123. package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -1
  124. package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
  125. package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -1
  126. package/lib/commonjs/components/extends/area/AreaFocusTypes.js +18 -18
  127. package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -1
  128. package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -1
  129. package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -1
  130. package/lib/commonjs/index.js.map +1 -1
  131. package/lib/module/components/MFBanDoSo.js.map +1 -1
  132. package/lib/module/components/MFBuilding.js +26 -26
  133. package/lib/module/components/MFBuilding.js.map +1 -1
  134. package/lib/module/components/MFCircle.js +20 -20
  135. package/lib/module/components/MFCircle.js.map +1 -1
  136. package/lib/module/components/MFDirectionsRenderer.js +32 -32
  137. package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
  138. package/lib/module/components/MFMapView.js +69 -69
  139. package/lib/module/components/MFMapView.js.map +1 -1
  140. package/lib/module/components/MFMarker.js +35 -35
  141. package/lib/module/components/MFMarker.js.map +1 -1
  142. package/lib/module/components/MFPOI.js +20 -20
  143. package/lib/module/components/MFPOI.js.map +1 -1
  144. package/lib/module/components/MFPolygon.js +22 -22
  145. package/lib/module/components/MFPolygon.js.map +1 -1
  146. package/lib/module/components/MFPolyline.js +18 -18
  147. package/lib/module/components/MFPolyline.js.map +1 -1
  148. package/lib/module/components/MFTileOverlay.js +9 -9
  149. package/lib/module/components/MFTileOverlay.js.map +1 -1
  150. package/lib/module/components/Map4dMapView.js.map +1 -1
  151. package/lib/module/components/extends/AreaFocusManager.js +16 -16
  152. package/lib/module/components/extends/AreaFocusManager.js.map +1 -1
  153. package/lib/module/components/extends/AreaFocuser.js +2 -2
  154. package/lib/module/components/extends/AreaFocuser.js.map +1 -1
  155. package/lib/module/components/extends/BoundHelper.js.map +1 -1
  156. package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -1
  157. package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
  158. package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -1
  159. package/lib/module/components/extends/area/AreaFocusTypes.js +18 -18
  160. package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -1
  161. package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -1
  162. package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -1
  163. package/lib/module/index.js.map +1 -1
  164. package/lib/typescript/components/Map4dMapView.d.ts +7 -7
  165. package/package.json +152 -152
  166. package/react-native-map4d-map.podspec +20 -20
  167. package/src/components/MFBanDoSo.js +124 -124
  168. package/src/components/MFBuilding.js +187 -187
  169. package/src/components/MFCircle.js +173 -173
  170. package/src/components/MFDirectionsRenderer.js +237 -237
  171. package/src/components/MFMapView.js +464 -464
  172. package/src/components/MFMarker.js +246 -246
  173. package/src/components/MFPOI.js +184 -184
  174. package/src/components/MFPolygon.js +186 -186
  175. package/src/components/MFPolyline.js +172 -172
  176. package/src/components/MFTileOverlay.js +45 -45
  177. package/src/components/Map4dMapView.tsx +26 -26
  178. package/src/components/extends/AreaFocusManager.js +196 -196
  179. package/src/components/extends/AreaFocuser.js +61 -61
  180. package/src/components/extends/BoundHelper.js +31 -31
  181. package/src/components/extends/area/AreaFocusAreas.js +164 -164
  182. package/src/components/extends/area/AreaFocusGeometryUtils.js +164 -164
  183. package/src/components/extends/area/AreaFocusSession.js +100 -100
  184. package/src/components/extends/area/AreaFocusTypes.js +36 -36
  185. package/src/components/internal/DefaultRoadmapStyle.js +3365 -3365
  186. package/src/components/internal/GeojsonStyleUtils.js +143 -143
  187. package/src/index.js +25 -25
  188. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  189. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  190. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  191. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  192. package/android/.gradle/8.9/gc.properties +0 -0
  193. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  194. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  195. package/android/.gradle/vcs-1/gc.properties +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 IOTLink
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 IOTLink
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,133 +1,133 @@
1
- # react-native-map4d-map-dtqg
2
-
3
- Map4dMap DTQG SDK for React Native
4
-
5
- ## Installation
6
-
7
- ```sh
8
- npm install react-native-map4d-map-dtqg
9
- ```
10
-
11
- ## Usage
12
-
13
- ```javascript
14
- import {MFMapView} from 'react-native-map4d-map-dtqg';
15
- import React from 'react';
16
- import {
17
- SafeAreaView,
18
- StyleSheet
19
- } from 'react-native';
20
-
21
- function App() {
22
- return (
23
- <>
24
- <SafeAreaView style={styles.safeView}>
25
- <MFMapView style={styles.container}/>
26
- </SafeAreaView>
27
- </>
28
- );
29
- };
30
-
31
- const styles = StyleSheet.create({
32
- safeView: {
33
- flex: 1,
34
- },
35
- container: {
36
- flex: 1,
37
- },
38
- });
39
-
40
- export default App;
41
- ```
42
-
43
- ## AreaFocus usage
44
-
45
- ```javascript
46
- import {MFMapView} from 'react-native-map4d-map-dtqg';
47
- import React, {useRef} from 'react';
48
- import {Button, SafeAreaView} from 'react-native';
49
-
50
- function App() {
51
- const mapRef = useRef(null);
52
-
53
- const onFocusProvinceByName = async () => {
54
- const mapView = mapRef.current;
55
- if (!mapView) return;
56
-
57
- await mapView.focusArea({
58
- type: 'province',
59
- name: 'Ha Noi',
60
- display: 'highlight',
61
- });
62
- };
63
-
64
- const onFocusProvinceById = async () => {
65
- const mapView = mapRef.current;
66
- if (!mapView) return;
67
-
68
- await mapView.focusArea({
69
- type: 'province',
70
- id: 30,
71
- display: 'normal',
72
- });
73
- };
74
-
75
- const onFocusIndustrial = async () => {
76
- const mapView = mapRef.current;
77
- if (!mapView) return;
78
-
79
- await mapView.focusArea({
80
- type: 'industrialZone',
81
- id: 2,
82
- display: 'normal',
83
- });
84
- };
85
-
86
- const onFocusEconomic = async () => {
87
- const mapView = mapRef.current;
88
- if (!mapView) return;
89
-
90
- await mapView.focusArea({
91
- type: 'economicZone',
92
- id: 2,
93
- display: 'highlight',
94
- });
95
- };
96
-
97
- const onClear = async () => {
98
- const mapView = mapRef.current;
99
- if (!mapView) return;
100
-
101
- mapView.clearFocusedArea();
102
- };
103
-
104
- return (
105
- <SafeAreaView style={{flex: 1}}>
106
- <Button title="Province (name) highlight" onPress={onFocusProvinceByName} />
107
- <Button title="Province (id)" onPress={onFocusProvinceById} />
108
- <Button title="Industrial" onPress={onFocusIndustrial} />
109
- <Button title="Economic highlight" onPress={onFocusEconomic} />
110
- <Button title="Clear" onPress={onClear} />
111
- <MFMapView style={{flex: 1}} ref={mapRef} />
112
- </SafeAreaView>
113
- );
114
- }
115
- ```
116
-
117
- `focusArea(focusOptions)` options:
118
- - `focusOptions.type`: required, accepts string or numeric type:
119
- - Province: `'province'`
120
- - Industrial/economic aliases: `'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel'`
121
- - `focusOptions.id`: optional for province, required for industrial/economic types
122
- - `focusOptions.name`: optional province name (used when province `id` is not provided)
123
- - `focusOptions.display`: `'normal' | 'highlight'` (default `'normal'`)
124
- - `focusOptions.padding`: optional camera padding `{left, right, top, bottom}`
125
-
126
- Examples:
127
- - `focusArea({ type: 'province', name: 'Ha Noi' })`
128
- - `focusArea({ type: 'province', id: 1, display: 'highlight' })`
129
- - `focusArea({ type: 'industrialZone', id: 2, display: 'normal', padding: { top: 80, right: 0, bottom: 0, left: 80 } })`
130
- - `focusArea({ type: 'economicZone', id: 2, display: 'highlight' })`
131
- - `focusArea({ type: 'freeTradeZone', id: 10 })`
132
- - `focusArea({ type: IndustrialEconomicType.NON_TARIFF_ZONE, id: 11 })`
133
- - `clearFocusedArea()` to clear current focus
1
+ # react-native-map4d-map-dtqg
2
+
3
+ Map4dMap DTQG SDK for React Native
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-map4d-map-dtqg
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ import {MFMapView} from 'react-native-map4d-map-dtqg';
15
+ import React from 'react';
16
+ import {
17
+ SafeAreaView,
18
+ StyleSheet
19
+ } from 'react-native';
20
+
21
+ function App() {
22
+ return (
23
+ <>
24
+ <SafeAreaView style={styles.safeView}>
25
+ <MFMapView style={styles.container}/>
26
+ </SafeAreaView>
27
+ </>
28
+ );
29
+ };
30
+
31
+ const styles = StyleSheet.create({
32
+ safeView: {
33
+ flex: 1,
34
+ },
35
+ container: {
36
+ flex: 1,
37
+ },
38
+ });
39
+
40
+ export default App;
41
+ ```
42
+
43
+ ## AreaFocus usage
44
+
45
+ ```javascript
46
+ import {MFMapView} from 'react-native-map4d-map-dtqg';
47
+ import React, {useRef} from 'react';
48
+ import {Button, SafeAreaView} from 'react-native';
49
+
50
+ function App() {
51
+ const mapRef = useRef(null);
52
+
53
+ const onFocusProvinceByName = async () => {
54
+ const mapView = mapRef.current;
55
+ if (!mapView) return;
56
+
57
+ await mapView.focusArea({
58
+ type: 'province',
59
+ name: 'Ha Noi',
60
+ display: 'highlight',
61
+ });
62
+ };
63
+
64
+ const onFocusProvinceById = async () => {
65
+ const mapView = mapRef.current;
66
+ if (!mapView) return;
67
+
68
+ await mapView.focusArea({
69
+ type: 'province',
70
+ id: 30,
71
+ display: 'normal',
72
+ });
73
+ };
74
+
75
+ const onFocusIndustrial = async () => {
76
+ const mapView = mapRef.current;
77
+ if (!mapView) return;
78
+
79
+ await mapView.focusArea({
80
+ type: 'industrialZone',
81
+ id: 2,
82
+ display: 'normal',
83
+ });
84
+ };
85
+
86
+ const onFocusEconomic = async () => {
87
+ const mapView = mapRef.current;
88
+ if (!mapView) return;
89
+
90
+ await mapView.focusArea({
91
+ type: 'economicZone',
92
+ id: 2,
93
+ display: 'highlight',
94
+ });
95
+ };
96
+
97
+ const onClear = async () => {
98
+ const mapView = mapRef.current;
99
+ if (!mapView) return;
100
+
101
+ mapView.clearFocusedArea();
102
+ };
103
+
104
+ return (
105
+ <SafeAreaView style={{flex: 1}}>
106
+ <Button title="Province (name) highlight" onPress={onFocusProvinceByName} />
107
+ <Button title="Province (id)" onPress={onFocusProvinceById} />
108
+ <Button title="Industrial" onPress={onFocusIndustrial} />
109
+ <Button title="Economic highlight" onPress={onFocusEconomic} />
110
+ <Button title="Clear" onPress={onClear} />
111
+ <MFMapView style={{flex: 1}} ref={mapRef} />
112
+ </SafeAreaView>
113
+ );
114
+ }
115
+ ```
116
+
117
+ `focusArea(focusOptions)` options:
118
+ - `focusOptions.type`: required, accepts string or numeric type:
119
+ - Province: `'province'`
120
+ - Industrial/economic aliases: `'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel'`
121
+ - `focusOptions.id`: optional for province, required for industrial/economic types
122
+ - `focusOptions.name`: optional province name (used when province `id` is not provided)
123
+ - `focusOptions.display`: `'normal' | 'highlight'` (default `'normal'`)
124
+ - `focusOptions.padding`: optional camera padding `{left, right, top, bottom}`
125
+
126
+ Examples:
127
+ - `focusArea({ type: 'province', name: 'Ha Noi' })`
128
+ - `focusArea({ type: 'province', id: 1, display: 'highlight' })`
129
+ - `focusArea({ type: 'industrialZone', id: 2, display: 'normal', padding: { top: 80, right: 0, bottom: 0, left: 80 } })`
130
+ - `focusArea({ type: 'economicZone', id: 2, display: 'highlight' })`
131
+ - `focusArea({ type: 'freeTradeZone', id: 10 })`
132
+ - `focusArea({ type: IndustrialEconomicType.NON_TARIFF_ZONE, id: 11 })`
133
+ - `clearFocusedArea()` to clear current focus
@@ -1,60 +1,60 @@
1
- buildscript {
2
- if (project == rootProject) {
3
- repositories {
4
- google()
5
- mavenCentral()
6
- }
7
-
8
- dependencies {
9
- classpath 'com.android.tools.build:gradle:3.5.3'
10
- }
11
- }
12
- }
13
-
14
- apply plugin: 'com.android.library'
15
-
16
- def safeExtGet(prop, fallback) {
17
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18
- }
19
-
20
- android {
21
- compileSdkVersion safeExtGet('Map4dMap_compileSdkVersion', 30)
22
- defaultConfig {
23
- minSdkVersion safeExtGet('Map4dMap_minSdkVersion', 21)
24
- targetSdkVersion safeExtGet('Map4dMap_targetSdkVersion', 30)
25
- versionCode 1
26
- versionName "1.0"
27
-
28
- }
29
-
30
- buildTypes {
31
- release {
32
- minifyEnabled false
33
- }
34
- }
35
- lintOptions {
36
- disable 'GradleCompatible'
37
- }
38
- compileOptions {
39
- sourceCompatibility JavaVersion.VERSION_1_8
40
- targetCompatibility JavaVersion.VERSION_1_8
41
- }
42
- }
43
-
44
- repositories {
45
- mavenLocal()
46
- maven {
47
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
48
- url("$rootDir/../node_modules/react-native/android")
49
- }
50
- google()
51
- mavenCentral()
52
- }
53
-
54
- dependencies {
55
- //noinspection GradleDynamicVersion
56
- implementation "com.facebook.react:react-native:+" // From node_modules
57
- implementation 'vn.map4d:Map4dTypes:1.1.+'
58
- implementation 'vn.map4d:Map4dMapDTQG:0.1.+'
59
- implementation 'vn.map4d:Map4dMapUtils:0.0.+'
60
- }
1
+ buildscript {
2
+ if (project == rootProject) {
3
+ repositories {
4
+ google()
5
+ mavenCentral()
6
+ }
7
+
8
+ dependencies {
9
+ classpath 'com.android.tools.build:gradle:3.5.3'
10
+ }
11
+ }
12
+ }
13
+
14
+ apply plugin: 'com.android.library'
15
+
16
+ def safeExtGet(prop, fallback) {
17
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18
+ }
19
+
20
+ android {
21
+ compileSdkVersion safeExtGet('Map4dMap_compileSdkVersion', 30)
22
+ defaultConfig {
23
+ minSdkVersion safeExtGet('Map4dMap_minSdkVersion', 21)
24
+ targetSdkVersion safeExtGet('Map4dMap_targetSdkVersion', 30)
25
+ versionCode 1
26
+ versionName "1.0"
27
+
28
+ }
29
+
30
+ buildTypes {
31
+ release {
32
+ minifyEnabled false
33
+ }
34
+ }
35
+ lintOptions {
36
+ disable 'GradleCompatible'
37
+ }
38
+ compileOptions {
39
+ sourceCompatibility JavaVersion.VERSION_1_8
40
+ targetCompatibility JavaVersion.VERSION_1_8
41
+ }
42
+ }
43
+
44
+ repositories {
45
+ mavenLocal()
46
+ maven {
47
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
48
+ url("$rootDir/../node_modules/react-native/android")
49
+ }
50
+ google()
51
+ mavenCentral()
52
+ }
53
+
54
+ dependencies {
55
+ //noinspection GradleDynamicVersion
56
+ implementation "com.facebook.react:react-native:+" // From node_modules
57
+ implementation 'vn.map4d:Map4dTypes:1.1.+'
58
+ implementation 'vn.map4d:Map4dMapDTQG:0.1.+'
59
+ implementation 'vn.map4d:Map4dMapUtils:0.0.+'
60
+ }
@@ -1,4 +1,4 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativemap4dmap">
3
-
4
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnativemap4dmap">
3
+
4
+ </manifest>
@@ -1,87 +1,87 @@
1
- package com.reactnativemap4dmap;
2
-
3
- import android.content.Context;
4
- import android.graphics.Bitmap;
5
- import android.graphics.Canvas;
6
- import android.graphics.drawable.BitmapDrawable;
7
- import android.graphics.drawable.Drawable;
8
- import android.graphics.drawable.VectorDrawable;
9
- import android.os.Build;
10
- import android.util.DisplayMetrics;
11
- import android.view.View;
12
- import android.view.WindowManager;
13
-
14
- import androidx.core.content.ContextCompat;
15
- import androidx.core.graphics.drawable.DrawableCompat;
16
-
17
- import vn.map4d.map.annotations.MFBitmapDescriptor;
18
- import vn.map4d.map.annotations.MFBitmapDescriptorFactory;
19
- import vn.map4d.map.annotations.RMFBitmapDescriptor;
20
- import vn.map4d.map.core.MapContext;
21
-
22
- class ImageUtils {
23
-
24
- private static DisplayMetrics metrics;
25
-
26
- static {
27
- final DisplayMetrics metrics = new DisplayMetrics();
28
- WindowManager wm = (WindowManager) MapContext.getContext().getSystemService(Context.WINDOW_SERVICE);
29
-
30
- wm.getDefaultDisplay().getMetrics(metrics);
31
- ImageUtils.metrics = metrics;
32
-
33
- DisplayMetrics realMetrics = null;
34
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
35
- realMetrics = new DisplayMetrics();
36
- wm.getDefaultDisplay().getRealMetrics(realMetrics);
37
- }
38
- if (realMetrics != null) {
39
- ImageUtils.metrics = realMetrics;
40
- }
41
- }
42
-
43
- static int getDrawableResourceByName(View view, String name) {
44
- return view.getResources().getIdentifier(
45
- name,
46
- "drawable",
47
- view.getContext().getPackageName());
48
- }
49
-
50
- static MFBitmapDescriptor getBitmapDescriptorByName(View view, String name) {
51
- return MFBitmapDescriptorFactory.fromResource(getDrawableResourceByName(view, name));
52
- }
53
-
54
- static MFBitmapDescriptor getBitmapByName(View view, String name) {
55
- return getBitmapByName(view, name, -1, -1);
56
- }
57
-
58
- static MFBitmapDescriptor getBitmapByName(View view, String name, int width, int height) {
59
- int resourceId = getDrawableResourceByName(view, name);
60
- Drawable drawable = ContextCompat.getDrawable(MapContext.getContext(), resourceId);
61
- if (drawable instanceof BitmapDrawable || drawable instanceof VectorDrawable) {
62
- Bitmap bitmap = createBitmapFromDrawable(drawable, width, height);
63
- return RMFBitmapDescriptor.create(bitmap, ImageUtils.metrics.densityDpi);
64
- }
65
- else {
66
- throw new IllegalArgumentException("The resource provided must be a Bitmap.");
67
- }
68
- }
69
-
70
- private static Bitmap createBitmapFromDrawable(Drawable drawable, int width, int height) {
71
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
72
- drawable = (DrawableCompat.wrap(drawable)).mutate();
73
- }
74
- int tWidth = width <= 0 ? drawable.getIntrinsicWidth(): width;
75
- int tHeight = height <= 0 ? drawable.getIntrinsicHeight(): height;
76
-
77
- Bitmap bitmap = Bitmap.createBitmap(
78
- tWidth,
79
- tHeight,
80
- Bitmap.Config.ARGB_8888);
81
- Canvas canvas = new Canvas(bitmap);
82
- drawable.setBounds(0, 0, tWidth, tHeight);
83
- drawable.draw(canvas);
84
-
85
- return bitmap;
86
- }
87
- }
1
+ package com.reactnativemap4dmap;
2
+
3
+ import android.content.Context;
4
+ import android.graphics.Bitmap;
5
+ import android.graphics.Canvas;
6
+ import android.graphics.drawable.BitmapDrawable;
7
+ import android.graphics.drawable.Drawable;
8
+ import android.graphics.drawable.VectorDrawable;
9
+ import android.os.Build;
10
+ import android.util.DisplayMetrics;
11
+ import android.view.View;
12
+ import android.view.WindowManager;
13
+
14
+ import androidx.core.content.ContextCompat;
15
+ import androidx.core.graphics.drawable.DrawableCompat;
16
+
17
+ import vn.map4d.map.annotations.MFBitmapDescriptor;
18
+ import vn.map4d.map.annotations.MFBitmapDescriptorFactory;
19
+ import vn.map4d.map.annotations.RMFBitmapDescriptor;
20
+ import vn.map4d.map.core.MapContext;
21
+
22
+ class ImageUtils {
23
+
24
+ private static DisplayMetrics metrics;
25
+
26
+ static {
27
+ final DisplayMetrics metrics = new DisplayMetrics();
28
+ WindowManager wm = (WindowManager) MapContext.getContext().getSystemService(Context.WINDOW_SERVICE);
29
+
30
+ wm.getDefaultDisplay().getMetrics(metrics);
31
+ ImageUtils.metrics = metrics;
32
+
33
+ DisplayMetrics realMetrics = null;
34
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
35
+ realMetrics = new DisplayMetrics();
36
+ wm.getDefaultDisplay().getRealMetrics(realMetrics);
37
+ }
38
+ if (realMetrics != null) {
39
+ ImageUtils.metrics = realMetrics;
40
+ }
41
+ }
42
+
43
+ static int getDrawableResourceByName(View view, String name) {
44
+ return view.getResources().getIdentifier(
45
+ name,
46
+ "drawable",
47
+ view.getContext().getPackageName());
48
+ }
49
+
50
+ static MFBitmapDescriptor getBitmapDescriptorByName(View view, String name) {
51
+ return MFBitmapDescriptorFactory.fromResource(getDrawableResourceByName(view, name));
52
+ }
53
+
54
+ static MFBitmapDescriptor getBitmapByName(View view, String name) {
55
+ return getBitmapByName(view, name, -1, -1);
56
+ }
57
+
58
+ static MFBitmapDescriptor getBitmapByName(View view, String name, int width, int height) {
59
+ int resourceId = getDrawableResourceByName(view, name);
60
+ Drawable drawable = ContextCompat.getDrawable(MapContext.getContext(), resourceId);
61
+ if (drawable instanceof BitmapDrawable || drawable instanceof VectorDrawable) {
62
+ Bitmap bitmap = createBitmapFromDrawable(drawable, width, height);
63
+ return RMFBitmapDescriptor.create(bitmap, ImageUtils.metrics.densityDpi);
64
+ }
65
+ else {
66
+ throw new IllegalArgumentException("The resource provided must be a Bitmap.");
67
+ }
68
+ }
69
+
70
+ private static Bitmap createBitmapFromDrawable(Drawable drawable, int width, int height) {
71
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
72
+ drawable = (DrawableCompat.wrap(drawable)).mutate();
73
+ }
74
+ int tWidth = width <= 0 ? drawable.getIntrinsicWidth(): width;
75
+ int tHeight = height <= 0 ? drawable.getIntrinsicHeight(): height;
76
+
77
+ Bitmap bitmap = Bitmap.createBitmap(
78
+ tWidth,
79
+ tHeight,
80
+ Bitmap.Config.ARGB_8888);
81
+ Canvas canvas = new Canvas(bitmap);
82
+ drawable.setBounds(0, 0, tWidth, tHeight);
83
+ drawable.draw(canvas);
84
+
85
+ return bitmap;
86
+ }
87
+ }