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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +88 -41
  3. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  7. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.9/gc.properties +0 -0
  10. package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
  11. package/android/.gradle/9.0-milestone-1/checksums/md5-checksums.bin +0 -0
  12. package/android/.gradle/9.0-milestone-1/checksums/sha1-checksums.bin +0 -0
  13. package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
  14. package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
  15. package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
  16. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  17. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  18. package/android/.gradle/config.properties +2 -0
  19. package/android/.gradle/vcs-1/gc.properties +0 -0
  20. package/android/.idea/AndroidProjectSystem.xml +6 -0
  21. package/android/.idea/caches/deviceStreaming.xml +1570 -0
  22. package/android/.idea/copilot.data.migration.ask2agent.xml +6 -0
  23. package/android/.idea/gradle.xml +12 -0
  24. package/android/.idea/migrations.xml +10 -0
  25. package/android/.idea/misc.xml +10 -0
  26. package/android/.idea/runConfigurations.xml +17 -0
  27. package/android/.idea/vcs.xml +6 -0
  28. package/android/build.gradle +60 -60
  29. package/android/local.properties +8 -0
  30. package/android/src/main/AndroidManifest.xml +4 -4
  31. package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -87
  32. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -298
  33. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -35
  34. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -31
  35. package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -167
  36. package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -121
  37. package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -105
  38. package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +121 -121
  39. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -502
  40. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -143
  41. package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +17 -17
  42. package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -1172
  43. package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +226 -226
  44. package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -412
  45. package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +211 -211
  46. package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -222
  47. package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -119
  48. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +172 -172
  49. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +147 -147
  50. package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -146
  51. package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +137 -137
  52. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -95
  53. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +64 -64
  54. package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -31
  55. package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -31
  56. package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -70
  57. package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -9
  58. package/ios/Map4dMap.h +7 -7
  59. package/ios/Map4dMap.m +14 -14
  60. package/ios/Map4dMapViewManager.m +34 -34
  61. package/ios/RCTConvert+Map4dMap.h +33 -33
  62. package/ios/RCTConvert+Map4dMap.m +112 -112
  63. package/ios/RMFCircle.h +37 -37
  64. package/ios/RMFCircle.m +100 -100
  65. package/ios/RMFCircleManager.h +18 -18
  66. package/ios/RMFCircleManager.m +155 -155
  67. package/ios/RMFCircleMap4d.h +23 -23
  68. package/ios/RMFCircleMap4d.m +13 -13
  69. package/ios/RMFCoordinate.h +22 -22
  70. package/ios/RMFCoordinate.m +13 -13
  71. package/ios/RMFDirectionsMarkerOptions.h +24 -24
  72. package/ios/RMFDirectionsMarkerOptions.m +23 -23
  73. package/ios/RMFDirectionsRenderer.h +47 -47
  74. package/ios/RMFDirectionsRenderer.m +182 -182
  75. package/ios/RMFDirectionsRendererManager.h +17 -17
  76. package/ios/RMFDirectionsRendererManager.m +84 -84
  77. package/ios/RMFDirectionsRendererMap4d.h +21 -21
  78. package/ios/RMFDirectionsRendererMap4d.m +12 -12
  79. package/ios/RMFDummyView.h +6 -6
  80. package/ios/RMFDummyView.m +12 -12
  81. package/ios/RMFEventResponse.h +39 -39
  82. package/ios/RMFEventResponse.m +98 -98
  83. package/ios/RMFIcon.h +24 -24
  84. package/ios/RMFIcon.m +35 -35
  85. package/ios/RMFMapView.h +84 -84
  86. package/ios/RMFMapView.m +376 -376
  87. package/ios/RMFMapViewManager.h +17 -17
  88. package/ios/RMFMapViewManager.m +493 -493
  89. package/ios/RMFMarker.h +57 -57
  90. package/ios/RMFMarker.m +267 -267
  91. package/ios/RMFMarkerManager.h +17 -17
  92. package/ios/RMFMarkerManager.m +156 -156
  93. package/ios/RMFMarkerMap4d.h +19 -19
  94. package/ios/RMFMarkerMap4d.m +13 -13
  95. package/ios/RMFPOI.h +38 -38
  96. package/ios/RMFPOI.m +123 -123
  97. package/ios/RMFPOIManager.h +18 -18
  98. package/ios/RMFPOIManager.m +168 -168
  99. package/ios/RMFPOIMap4d.h +22 -22
  100. package/ios/RMFPOIMap4d.m +12 -12
  101. package/ios/RMFPolygon.h +41 -41
  102. package/ios/RMFPolygon.m +106 -106
  103. package/ios/RMFPolygonManager.h +18 -18
  104. package/ios/RMFPolygonManager.m +141 -141
  105. package/ios/RMFPolygonMap4d.h +23 -23
  106. package/ios/RMFPolygonMap4d.m +15 -15
  107. package/ios/RMFPolyline.h +38 -38
  108. package/ios/RMFPolyline.m +101 -101
  109. package/ios/RMFPolylineManager.h +18 -18
  110. package/ios/RMFPolylineManager.m +139 -139
  111. package/ios/RMFPolylineMap4d.h +22 -22
  112. package/ios/RMFPolylineMap4d.m +15 -15
  113. package/ios/building/RMFBuilding.h +41 -41
  114. package/ios/building/RMFBuilding.m +104 -104
  115. package/ios/building/RMFBuildingManager.h +19 -19
  116. package/ios/building/RMFBuildingManager.m +133 -133
  117. package/ios/building/RMFBuildingMap4d.h +23 -23
  118. package/ios/building/RMFBuildingMap4d.m +15 -15
  119. package/ios/overlays/RMFTileOverlay.h +36 -36
  120. package/ios/overlays/RMFTileOverlay.m +64 -64
  121. package/ios/overlays/RMFTileOverlayManager.h +17 -17
  122. package/ios/overlays/RMFTileOverlayManager.m +27 -27
  123. package/lib/commonjs/components/MFBuilding.js +26 -26
  124. package/lib/commonjs/components/MFBuilding.js.map +1 -1
  125. package/lib/commonjs/components/MFCircle.js +20 -20
  126. package/lib/commonjs/components/MFCircle.js.map +1 -1
  127. package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
  128. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
  129. package/lib/commonjs/components/MFMapView.js +133 -71
  130. package/lib/commonjs/components/MFMapView.js.map +1 -1
  131. package/lib/commonjs/components/MFMarker.js +35 -35
  132. package/lib/commonjs/components/MFMarker.js.map +1 -1
  133. package/lib/commonjs/components/MFPOI.js +20 -20
  134. package/lib/commonjs/components/MFPOI.js.map +1 -1
  135. package/lib/commonjs/components/MFPolygon.js +22 -22
  136. package/lib/commonjs/components/MFPolygon.js.map +1 -1
  137. package/lib/commonjs/components/MFPolyline.js +18 -18
  138. package/lib/commonjs/components/MFPolyline.js.map +1 -1
  139. package/lib/commonjs/components/MFTileOverlay.js +9 -9
  140. package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
  141. package/lib/commonjs/components/Map4dMapView.js.map +1 -1
  142. package/lib/commonjs/components/extends/AreaFocuser.js +311 -0
  143. package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -0
  144. package/lib/commonjs/index.js +8 -0
  145. package/lib/commonjs/index.js.map +1 -1
  146. package/lib/module/components/MFBuilding.js +26 -26
  147. package/lib/module/components/MFBuilding.js.map +1 -1
  148. package/lib/module/components/MFCircle.js +20 -20
  149. package/lib/module/components/MFCircle.js.map +1 -1
  150. package/lib/module/components/MFDirectionsRenderer.js +32 -32
  151. package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
  152. package/lib/module/components/MFMapView.js +131 -71
  153. package/lib/module/components/MFMapView.js.map +1 -1
  154. package/lib/module/components/MFMarker.js +35 -35
  155. package/lib/module/components/MFMarker.js.map +1 -1
  156. package/lib/module/components/MFPOI.js +20 -20
  157. package/lib/module/components/MFPOI.js.map +1 -1
  158. package/lib/module/components/MFPolygon.js +22 -22
  159. package/lib/module/components/MFPolygon.js.map +1 -1
  160. package/lib/module/components/MFPolyline.js +18 -18
  161. package/lib/module/components/MFPolyline.js.map +1 -1
  162. package/lib/module/components/MFTileOverlay.js +9 -9
  163. package/lib/module/components/MFTileOverlay.js.map +1 -1
  164. package/lib/module/components/Map4dMapView.js.map +1 -1
  165. package/lib/module/components/extends/AreaFocuser.js +302 -0
  166. package/lib/module/components/extends/AreaFocuser.js.map +1 -0
  167. package/lib/module/index.js +2 -1
  168. package/lib/module/index.js.map +1 -1
  169. package/lib/typescript/components/Map4dMapView.d.ts +7 -7
  170. package/package.json +152 -152
  171. package/react-native-map4d-map.podspec +20 -20
  172. package/src/components/MFBuilding.js +187 -187
  173. package/src/components/MFCircle.js +173 -173
  174. package/src/components/MFDirectionsRenderer.js +237 -237
  175. package/src/components/MFMapView.js +447 -373
  176. package/src/components/MFMarker.js +246 -246
  177. package/src/components/MFPOI.js +184 -184
  178. package/src/components/MFPolygon.js +186 -186
  179. package/src/components/MFPolyline.js +172 -172
  180. package/src/components/MFTileOverlay.js +45 -45
  181. package/src/components/Map4dMapView.tsx +26 -26
  182. package/src/components/extends/AreaFocuser.js +339 -0
  183. package/src/index.js +23 -21
@@ -1,34 +1,34 @@
1
- #import <React/RCTViewManager.h>
2
-
3
- @interface Map4dMapViewManager : RCTViewManager
4
- @end
5
-
6
- @implementation Map4dMapViewManager
7
-
8
- RCT_EXPORT_MODULE(Map4dMapView)
9
-
10
- - (UIView *)view
11
- {
12
- return [[UIView alloc] init];
13
- }
14
-
15
- RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView)
16
- {
17
- [view setBackgroundColor:[self hexStringToColor:json]];
18
- }
19
-
20
- - hexStringToColor:(NSString *)stringToConvert
21
- {
22
- NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
23
- NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
24
-
25
- unsigned hex;
26
- if (![stringScanner scanHexInt:&hex]) return nil;
27
- int r = (hex >> 16) & 0xFF;
28
- int g = (hex >> 8) & 0xFF;
29
- int b = (hex) & 0xFF;
30
-
31
- return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
32
- }
33
-
34
- @end
1
+ #import <React/RCTViewManager.h>
2
+
3
+ @interface Map4dMapViewManager : RCTViewManager
4
+ @end
5
+
6
+ @implementation Map4dMapViewManager
7
+
8
+ RCT_EXPORT_MODULE(Map4dMapView)
9
+
10
+ - (UIView *)view
11
+ {
12
+ return [[UIView alloc] init];
13
+ }
14
+
15
+ RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView)
16
+ {
17
+ [view setBackgroundColor:[self hexStringToColor:json]];
18
+ }
19
+
20
+ - hexStringToColor:(NSString *)stringToConvert
21
+ {
22
+ NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
23
+ NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
24
+
25
+ unsigned hex;
26
+ if (![stringScanner scanHexInt:&hex]) return nil;
27
+ int r = (hex >> 16) & 0xFF;
28
+ int g = (hex >> 8) & 0xFF;
29
+ int b = (hex) & 0xFF;
30
+
31
+ return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
32
+ }
33
+
34
+ @end
@@ -1,33 +1,33 @@
1
- //
2
- // RCTConvert+Map4dMap.h
3
- // Map4dMap
4
- //
5
- // Created by Huy Dang on 7/3/20.
6
- // Copyright © 2020 IOTLink. All rights reserved.
7
- //
8
-
9
- #ifndef RCTConvert_Map4dMap_h
10
- #define RCTConvert_Map4dMap_h
11
-
12
- #import <React/RCTConvert.h>
13
-
14
- @class RMFCoordinate;
15
- @class MFCameraPosition;
16
- @class RMFIcon;
17
- @class MFCoordinateBounds;
18
- @class RMFDirectionsMarkerOptions;
19
-
20
- @interface RCTConvert(Map4dMap)
21
-
22
- + (RMFCoordinate *)RMFCoordinate:(id)json;
23
- + (NSArray<RMFCoordinate *> *)RMFCoordinateArray:(id)json;
24
- + (NSArray<NSArray<RMFCoordinate *> *> *)RMFCoordinateArrayArray:(id)json;
25
- + (MFCameraPosition *)MFCameraPosition:(id)json;
26
- + (MFCameraPosition *)MFCameraPosition:(id)json withDefaultCamera:(MFCameraPosition*)camera;
27
- + (RMFIcon *)RMFIcon:(id)json;
28
- + (MFCoordinateBounds *)MFCoordinateBounds:(id)json;
29
- + (RMFDirectionsMarkerOptions *)RMFDirectionsMarkerOptions:(id)json;
30
-
31
- @end
32
-
33
- #endif /* RCTConvert_Map4dMap_h */
1
+ //
2
+ // RCTConvert+Map4dMap.h
3
+ // Map4dMap
4
+ //
5
+ // Created by Huy Dang on 7/3/20.
6
+ // Copyright © 2020 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #ifndef RCTConvert_Map4dMap_h
10
+ #define RCTConvert_Map4dMap_h
11
+
12
+ #import <React/RCTConvert.h>
13
+
14
+ @class RMFCoordinate;
15
+ @class MFCameraPosition;
16
+ @class RMFIcon;
17
+ @class MFCoordinateBounds;
18
+ @class RMFDirectionsMarkerOptions;
19
+
20
+ @interface RCTConvert(Map4dMap)
21
+
22
+ + (RMFCoordinate *)RMFCoordinate:(id)json;
23
+ + (NSArray<RMFCoordinate *> *)RMFCoordinateArray:(id)json;
24
+ + (NSArray<NSArray<RMFCoordinate *> *> *)RMFCoordinateArrayArray:(id)json;
25
+ + (MFCameraPosition *)MFCameraPosition:(id)json;
26
+ + (MFCameraPosition *)MFCameraPosition:(id)json withDefaultCamera:(MFCameraPosition*)camera;
27
+ + (RMFIcon *)RMFIcon:(id)json;
28
+ + (MFCoordinateBounds *)MFCoordinateBounds:(id)json;
29
+ + (RMFDirectionsMarkerOptions *)RMFDirectionsMarkerOptions:(id)json;
30
+
31
+ @end
32
+
33
+ #endif /* RCTConvert_Map4dMap_h */
@@ -1,112 +1,112 @@
1
- //
2
- // RCTConvert+Map4dMap.m
3
- // Map4dMap
4
- //
5
- // Created by Huy Dang on 7/3/20.
6
- // Copyright © 2020 IOTLink. All rights reserved.
7
- //
8
-
9
- #import "RCTConvert+Map4dMap.h"
10
- #import <React/RCTConvert+CoreLocation.h>
11
- #import <Map4dMap/Map4dMap.h>
12
- #import "RMFCoordinate.h"
13
- #import "RMFIcon.h"
14
- #import "RMFDirectionsMarkerOptions.h"
15
-
16
- @implementation RCTConvert(Map4dMap)
17
-
18
- + (RMFCoordinate *)RMFCoordinate:(id)json {
19
- RMFCoordinate *coord = [RMFCoordinate new];
20
- coord.coordinate = [self CLLocationCoordinate2D:json];
21
- return coord;
22
- }
23
-
24
- RCT_ARRAY_CONVERTER(RMFCoordinate)
25
-
26
- + (NSArray<NSArray<RMFCoordinate *> *> *)RMFCoordinateArrayArray:(id)json {
27
- return RCTConvertArrayValue(@selector(RMFCoordinateArray:), json);
28
- }
29
-
30
- + (MFCameraPosition *)MFCameraPosition:(id)json withDefaultCamera:(MFCameraPosition*)camera {
31
- double zoom = 0;
32
- double tilt = 0;
33
- double bearing = 0;
34
- CLLocationCoordinate2D target = CLLocationCoordinate2DMake(0, 0);
35
- if (camera != nil) {
36
- target = camera.target;
37
- zoom = camera.zoom;
38
- tilt = camera.tilt;
39
- bearing = camera.bearing;
40
- }
41
-
42
- json = [self NSDictionary:json];
43
- if (json[@"center"]) {
44
- target = [self CLLocationCoordinate2D:json[@"center"]];
45
- }
46
-
47
- if (json[@"zoom"]) {
48
- zoom = [self double:json[@"zoom"]];
49
- }
50
-
51
- if (json[@"tilt"]) {
52
- tilt = [self double:json[@"tilt"]];
53
- }
54
-
55
- if (json[@"bearing"]) {
56
- bearing = [self double:json[@"bearing"]];
57
- }
58
-
59
- return [[MFCameraPosition alloc] initWithTarget:target zoom:zoom tilt:tilt bearing:bearing];
60
- }
61
-
62
- + (MFCameraPosition *)MFCameraPosition:(id)json {
63
- return [self MFCameraPosition:json withDefaultCamera:nil];
64
- }
65
-
66
- + (RMFIcon *)RMFIcon:(id)json {
67
- json = [self NSDictionary:json];
68
- if (json[@"uri"]) {
69
- RMFIcon * icon = [[RMFIcon alloc] init];
70
- icon.uri = [self NSString:json[@"uri"]];
71
- if (json[@"width"]) {
72
- icon.width = [self NSNumber:json[@"width"]];
73
- }
74
- if (json[@"height"]) {
75
- icon.height = [self NSNumber:json[@"height"]];
76
- }
77
- return icon;
78
- }
79
- return nil;
80
- }
81
-
82
- + (MFCoordinateBounds *)MFCoordinateBounds:(id)json {
83
- json = [self NSDictionary:json];
84
- CLLocationCoordinate2D northEast = [self CLLocationCoordinate2D:json[@"northEast"]];
85
- CLLocationCoordinate2D southWest = [self CLLocationCoordinate2D:json[@"southWest"]];
86
- return [[MFCoordinateBounds alloc] initWithCoordinate:northEast coordinate:southWest];
87
- }
88
-
89
- + (RMFDirectionsMarkerOptions *)RMFDirectionsMarkerOptions:(id)json {
90
- json = [self NSDictionary:json];
91
- RMFDirectionsMarkerOptions* options = [[RMFDirectionsMarkerOptions alloc] init];
92
-
93
- if (json[@"coordinate"]) {
94
- options.coordinate = [self CLLocationCoordinate2D:json[@"coordinate"]];
95
- }
96
- if (json[@"icon"]) {
97
- options.icon = [self RMFIcon:json[@"icon"]];
98
- }
99
- if (json[@"title"]) {
100
- options.title = [self NSString:json[@"title"]];
101
- }
102
- if (json[@"titleColor"]) {
103
- options.titleColor = [self UIColor:json[@"titleColor"]];
104
- }
105
- if (json[@"visible"]) {
106
- options.visible = [self BOOL:json[@"visible"]];
107
- }
108
-
109
- return options;
110
- }
111
-
112
- @end
1
+ //
2
+ // RCTConvert+Map4dMap.m
3
+ // Map4dMap
4
+ //
5
+ // Created by Huy Dang on 7/3/20.
6
+ // Copyright © 2020 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #import "RCTConvert+Map4dMap.h"
10
+ #import <React/RCTConvert+CoreLocation.h>
11
+ #import <Map4dMap/Map4dMap.h>
12
+ #import "RMFCoordinate.h"
13
+ #import "RMFIcon.h"
14
+ #import "RMFDirectionsMarkerOptions.h"
15
+
16
+ @implementation RCTConvert(Map4dMap)
17
+
18
+ + (RMFCoordinate *)RMFCoordinate:(id)json {
19
+ RMFCoordinate *coord = [RMFCoordinate new];
20
+ coord.coordinate = [self CLLocationCoordinate2D:json];
21
+ return coord;
22
+ }
23
+
24
+ RCT_ARRAY_CONVERTER(RMFCoordinate)
25
+
26
+ + (NSArray<NSArray<RMFCoordinate *> *> *)RMFCoordinateArrayArray:(id)json {
27
+ return RCTConvertArrayValue(@selector(RMFCoordinateArray:), json);
28
+ }
29
+
30
+ + (MFCameraPosition *)MFCameraPosition:(id)json withDefaultCamera:(MFCameraPosition*)camera {
31
+ double zoom = 0;
32
+ double tilt = 0;
33
+ double bearing = 0;
34
+ CLLocationCoordinate2D target = CLLocationCoordinate2DMake(0, 0);
35
+ if (camera != nil) {
36
+ target = camera.target;
37
+ zoom = camera.zoom;
38
+ tilt = camera.tilt;
39
+ bearing = camera.bearing;
40
+ }
41
+
42
+ json = [self NSDictionary:json];
43
+ if (json[@"center"]) {
44
+ target = [self CLLocationCoordinate2D:json[@"center"]];
45
+ }
46
+
47
+ if (json[@"zoom"]) {
48
+ zoom = [self double:json[@"zoom"]];
49
+ }
50
+
51
+ if (json[@"tilt"]) {
52
+ tilt = [self double:json[@"tilt"]];
53
+ }
54
+
55
+ if (json[@"bearing"]) {
56
+ bearing = [self double:json[@"bearing"]];
57
+ }
58
+
59
+ return [[MFCameraPosition alloc] initWithTarget:target zoom:zoom tilt:tilt bearing:bearing];
60
+ }
61
+
62
+ + (MFCameraPosition *)MFCameraPosition:(id)json {
63
+ return [self MFCameraPosition:json withDefaultCamera:nil];
64
+ }
65
+
66
+ + (RMFIcon *)RMFIcon:(id)json {
67
+ json = [self NSDictionary:json];
68
+ if (json[@"uri"]) {
69
+ RMFIcon * icon = [[RMFIcon alloc] init];
70
+ icon.uri = [self NSString:json[@"uri"]];
71
+ if (json[@"width"]) {
72
+ icon.width = [self NSNumber:json[@"width"]];
73
+ }
74
+ if (json[@"height"]) {
75
+ icon.height = [self NSNumber:json[@"height"]];
76
+ }
77
+ return icon;
78
+ }
79
+ return nil;
80
+ }
81
+
82
+ + (MFCoordinateBounds *)MFCoordinateBounds:(id)json {
83
+ json = [self NSDictionary:json];
84
+ CLLocationCoordinate2D northEast = [self CLLocationCoordinate2D:json[@"northEast"]];
85
+ CLLocationCoordinate2D southWest = [self CLLocationCoordinate2D:json[@"southWest"]];
86
+ return [[MFCoordinateBounds alloc] initWithCoordinate:northEast coordinate:southWest];
87
+ }
88
+
89
+ + (RMFDirectionsMarkerOptions *)RMFDirectionsMarkerOptions:(id)json {
90
+ json = [self NSDictionary:json];
91
+ RMFDirectionsMarkerOptions* options = [[RMFDirectionsMarkerOptions alloc] init];
92
+
93
+ if (json[@"coordinate"]) {
94
+ options.coordinate = [self CLLocationCoordinate2D:json[@"coordinate"]];
95
+ }
96
+ if (json[@"icon"]) {
97
+ options.icon = [self RMFIcon:json[@"icon"]];
98
+ }
99
+ if (json[@"title"]) {
100
+ options.title = [self NSString:json[@"title"]];
101
+ }
102
+ if (json[@"titleColor"]) {
103
+ options.titleColor = [self UIColor:json[@"titleColor"]];
104
+ }
105
+ if (json[@"visible"]) {
106
+ options.visible = [self BOOL:json[@"visible"]];
107
+ }
108
+
109
+ return options;
110
+ }
111
+
112
+ @end
package/ios/RMFCircle.h CHANGED
@@ -1,37 +1,37 @@
1
- //
2
- // RMFCircle.h
3
- // Map4dMap
4
- //
5
- // Created by Huy Dang on 7/3/20.
6
- // Copyright © 2020 IOTLink. All rights reserved.
7
- //
8
-
9
- #ifndef RMFCircle_h
10
- #define RMFCircle_h
11
-
12
- #import <React/UIView+React.h>
13
- #import "RMFCircleMap4d.h"
14
- #import "RMFMapView.h"
15
-
16
- @interface RMFCircle : UIView
17
-
18
- @property(nonatomic, strong) RMFCircleMap4d * map4dCircle;
19
-
20
- @property(nonatomic, copy) RCTBubblingEventBlock _Nullable onPress;
21
-
22
- @property(nonatomic, assign) CLLocationCoordinate2D centerCoordinate;
23
- @property(nonatomic, assign) UIColor* fillColor;
24
- @property(nonatomic, assign) UIColor* strokeColor;
25
- @property(nonatomic, assign) double strokeWidth;
26
- @property(nonatomic, assign) double radius;
27
- @property(nonatomic, assign) float zIndex;
28
- @property(nonatomic, assign) BOOL visible;
29
- @property(nonatomic, copy, nullable) NSDictionary * userData;
30
-
31
- - (void)didTapAtPixel:(CGPoint)pixel;
32
- - (void)setMapView:(RMFMapView* _Nullable)mapView;
33
-
34
- @end
35
-
36
-
37
- #endif /* RMFCircle_h */
1
+ //
2
+ // RMFCircle.h
3
+ // Map4dMap
4
+ //
5
+ // Created by Huy Dang on 7/3/20.
6
+ // Copyright © 2020 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #ifndef RMFCircle_h
10
+ #define RMFCircle_h
11
+
12
+ #import <React/UIView+React.h>
13
+ #import "RMFCircleMap4d.h"
14
+ #import "RMFMapView.h"
15
+
16
+ @interface RMFCircle : UIView
17
+
18
+ @property(nonatomic, strong) RMFCircleMap4d * map4dCircle;
19
+
20
+ @property(nonatomic, copy) RCTBubblingEventBlock _Nullable onPress;
21
+
22
+ @property(nonatomic, assign) CLLocationCoordinate2D centerCoordinate;
23
+ @property(nonatomic, assign) UIColor* fillColor;
24
+ @property(nonatomic, assign) UIColor* strokeColor;
25
+ @property(nonatomic, assign) double strokeWidth;
26
+ @property(nonatomic, assign) double radius;
27
+ @property(nonatomic, assign) float zIndex;
28
+ @property(nonatomic, assign) BOOL visible;
29
+ @property(nonatomic, copy, nullable) NSDictionary * userData;
30
+
31
+ - (void)didTapAtPixel:(CGPoint)pixel;
32
+ - (void)setMapView:(RMFMapView* _Nullable)mapView;
33
+
34
+ @end
35
+
36
+
37
+ #endif /* RMFCircle_h */
package/ios/RMFCircle.m CHANGED
@@ -1,100 +1,100 @@
1
- //
2
- // RMFCircle.m
3
- // Map4dMap
4
- //
5
- // Created by Huy Dang on 7/3/20.
6
- // Copyright © 2020 IOTLink. All rights reserved.
7
- //
8
-
9
- #import "RMFCircle.h"
10
- #import <Foundation/Foundation.h>
11
- #import "RMFEventResponse.h"
12
-
13
- @implementation RMFCircle
14
-
15
- - (instancetype)init {
16
- if ((self = [super init])) {
17
- _map4dCircle = [[RMFCircleMap4d alloc] init];
18
- _map4dCircle.reactCircle = self;
19
-
20
- _radius = _map4dCircle.radius;
21
- _fillColor = _map4dCircle.fillColor;
22
- _strokeWidth = _map4dCircle.strokeWidth;
23
- _strokeColor = _map4dCircle.strokeColor;
24
- _centerCoordinate = _map4dCircle.position;
25
- _zIndex = _map4dCircle.zIndex;
26
- _visible = true;//!_map4dCircle.isHidden;
27
- _userData = nil;
28
- }
29
- return self;
30
- }
31
-
32
- - (void)setMapView:(RMFMapView *)mapView {
33
- _map4dCircle.map = mapView;
34
- }
35
-
36
- /** Property */
37
- - (void)setCenterCoordinate:(CLLocationCoordinate2D)center {
38
- _centerCoordinate = center;
39
- _map4dCircle.position = center;
40
- }
41
-
42
- - (void)setRadius:(double)radius {
43
- _radius = radius;
44
- _map4dCircle.radius = radius;
45
- }
46
-
47
- - (void)setFillColor:(UIColor *)fillColor {
48
- _fillColor = fillColor;
49
- _map4dCircle.fillColor = fillColor;
50
- }
51
-
52
- - (void)setStrokeColor:(UIColor *)strokeColor {
53
- _strokeColor = strokeColor;
54
- _map4dCircle.strokeColor = strokeColor;
55
- }
56
-
57
- - (void)setStrokeWidth:(double)strokeWidth {
58
- _strokeWidth = strokeWidth;
59
- _map4dCircle.strokeWidth = strokeWidth;
60
- }
61
-
62
- - (void)setUserInteractionEnabled:(BOOL)enabled {
63
- [super setUserInteractionEnabled:enabled];
64
- _map4dCircle.userInteractionEnabled = enabled;
65
- }
66
-
67
- - (void)setZIndex:(float)zIndex {
68
- _zIndex = zIndex;
69
- _map4dCircle.zIndex = zIndex;
70
- }
71
-
72
- - (void)setVisible:(BOOL)visible {
73
- _visible = visible;
74
- _map4dCircle.isHidden = !visible;
75
- }
76
-
77
- - (void)setUserData:(NSDictionary *)userData {
78
- _userData = userData;
79
- }
80
-
81
- /** Event */
82
- - (void)didTapAtPixel:(CGPoint)pixel {
83
- if(!self.onPress) {
84
- return;
85
- }
86
-
87
- CLLocationCoordinate2D tapLocation = [_map4dCircle.map.projection coordinateForPoint:pixel];
88
- NSMutableDictionary* response = [NSMutableDictionary dictionaryWithDictionary:[RMFEventResponse fromCoordinate:tapLocation
89
- pixel:pixel]];
90
- response[@"circle"] = @{
91
- @"center": [RMFEventResponse fromCoordinate:_centerCoordinate],
92
- @"radius": @(_radius),
93
- @"userData": _userData != nil ? _userData : @{}
94
- };
95
- response[@"action"] = @"circle-press";
96
-
97
- self.onPress(response);
98
- }
99
-
100
- @end
1
+ //
2
+ // RMFCircle.m
3
+ // Map4dMap
4
+ //
5
+ // Created by Huy Dang on 7/3/20.
6
+ // Copyright © 2020 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #import "RMFCircle.h"
10
+ #import <Foundation/Foundation.h>
11
+ #import "RMFEventResponse.h"
12
+
13
+ @implementation RMFCircle
14
+
15
+ - (instancetype)init {
16
+ if ((self = [super init])) {
17
+ _map4dCircle = [[RMFCircleMap4d alloc] init];
18
+ _map4dCircle.reactCircle = self;
19
+
20
+ _radius = _map4dCircle.radius;
21
+ _fillColor = _map4dCircle.fillColor;
22
+ _strokeWidth = _map4dCircle.strokeWidth;
23
+ _strokeColor = _map4dCircle.strokeColor;
24
+ _centerCoordinate = _map4dCircle.position;
25
+ _zIndex = _map4dCircle.zIndex;
26
+ _visible = true;//!_map4dCircle.isHidden;
27
+ _userData = nil;
28
+ }
29
+ return self;
30
+ }
31
+
32
+ - (void)setMapView:(RMFMapView *)mapView {
33
+ _map4dCircle.map = mapView;
34
+ }
35
+
36
+ /** Property */
37
+ - (void)setCenterCoordinate:(CLLocationCoordinate2D)center {
38
+ _centerCoordinate = center;
39
+ _map4dCircle.position = center;
40
+ }
41
+
42
+ - (void)setRadius:(double)radius {
43
+ _radius = radius;
44
+ _map4dCircle.radius = radius;
45
+ }
46
+
47
+ - (void)setFillColor:(UIColor *)fillColor {
48
+ _fillColor = fillColor;
49
+ _map4dCircle.fillColor = fillColor;
50
+ }
51
+
52
+ - (void)setStrokeColor:(UIColor *)strokeColor {
53
+ _strokeColor = strokeColor;
54
+ _map4dCircle.strokeColor = strokeColor;
55
+ }
56
+
57
+ - (void)setStrokeWidth:(double)strokeWidth {
58
+ _strokeWidth = strokeWidth;
59
+ _map4dCircle.strokeWidth = strokeWidth;
60
+ }
61
+
62
+ - (void)setUserInteractionEnabled:(BOOL)enabled {
63
+ [super setUserInteractionEnabled:enabled];
64
+ _map4dCircle.userInteractionEnabled = enabled;
65
+ }
66
+
67
+ - (void)setZIndex:(float)zIndex {
68
+ _zIndex = zIndex;
69
+ _map4dCircle.zIndex = zIndex;
70
+ }
71
+
72
+ - (void)setVisible:(BOOL)visible {
73
+ _visible = visible;
74
+ _map4dCircle.isHidden = !visible;
75
+ }
76
+
77
+ - (void)setUserData:(NSDictionary *)userData {
78
+ _userData = userData;
79
+ }
80
+
81
+ /** Event */
82
+ - (void)didTapAtPixel:(CGPoint)pixel {
83
+ if(!self.onPress) {
84
+ return;
85
+ }
86
+
87
+ CLLocationCoordinate2D tapLocation = [_map4dCircle.map.projection coordinateForPoint:pixel];
88
+ NSMutableDictionary* response = [NSMutableDictionary dictionaryWithDictionary:[RMFEventResponse fromCoordinate:tapLocation
89
+ pixel:pixel]];
90
+ response[@"circle"] = @{
91
+ @"center": [RMFEventResponse fromCoordinate:_centerCoordinate],
92
+ @"radius": @(_radius),
93
+ @"userData": _userData != nil ? _userData : @{}
94
+ };
95
+ response[@"action"] = @"circle-press";
96
+
97
+ self.onPress(response);
98
+ }
99
+
100
+ @end
@@ -1,18 +1,18 @@
1
- //
2
- // RMFCircleManager.h
3
- // Map4dMap
4
- //
5
- // Created by Huy Dang on 7/3/20.
6
- // Copyright © 2020 IOTLink. All rights reserved.
7
- //
8
-
9
- #ifndef RMFCircleManager_h
10
- #define RMFCircleManager_h
11
-
12
- #import <React/RCTViewManager.h>
13
-
14
- @interface RMFCircleManager : RCTViewManager
15
-
16
- @end
17
-
18
- #endif /* RMFCircleManager_h */
1
+ //
2
+ // RMFCircleManager.h
3
+ // Map4dMap
4
+ //
5
+ // Created by Huy Dang on 7/3/20.
6
+ // Copyright © 2020 IOTLink. All rights reserved.
7
+ //
8
+
9
+ #ifndef RMFCircleManager_h
10
+ #define RMFCircleManager_h
11
+
12
+ #import <React/RCTViewManager.h>
13
+
14
+ @interface RMFCircleManager : RCTViewManager
15
+
16
+ @end
17
+
18
+ #endif /* RMFCircleManager_h */