react-native-map4d-map-dtqg 0.1.0

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/android/build.gradle +60 -0
  4. package/android/src/main/AndroidManifest.xml +4 -0
  5. package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -0
  6. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -0
  7. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -0
  8. package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -0
  9. package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -0
  10. package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -0
  11. package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -0
  12. package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +122 -0
  13. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -0
  14. package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -0
  15. package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +18 -0
  16. package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -0
  17. package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +226 -0
  18. package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -0
  19. package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +212 -0
  20. package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -0
  21. package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -0
  22. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +173 -0
  23. package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +148 -0
  24. package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -0
  25. package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +138 -0
  26. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -0
  27. package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +65 -0
  28. package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -0
  29. package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -0
  30. package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -0
  31. package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -0
  32. package/ios/Map4dMap.h +7 -0
  33. package/ios/Map4dMap.m +14 -0
  34. package/ios/Map4dMap.xcodeproj/project.pbxproj +282 -0
  35. package/ios/Map4dMapViewManager.m +34 -0
  36. package/ios/RCTConvert+Map4dMap.h +33 -0
  37. package/ios/RCTConvert+Map4dMap.m +112 -0
  38. package/ios/RMFCircle.h +37 -0
  39. package/ios/RMFCircle.m +100 -0
  40. package/ios/RMFCircleManager.h +18 -0
  41. package/ios/RMFCircleManager.m +155 -0
  42. package/ios/RMFCircleMap4d.h +23 -0
  43. package/ios/RMFCircleMap4d.m +13 -0
  44. package/ios/RMFCoordinate.h +22 -0
  45. package/ios/RMFCoordinate.m +13 -0
  46. package/ios/RMFDirectionsMarkerOptions.h +24 -0
  47. package/ios/RMFDirectionsMarkerOptions.m +23 -0
  48. package/ios/RMFDirectionsRenderer.h +47 -0
  49. package/ios/RMFDirectionsRenderer.m +182 -0
  50. package/ios/RMFDirectionsRendererManager.h +17 -0
  51. package/ios/RMFDirectionsRendererManager.m +84 -0
  52. package/ios/RMFDirectionsRendererMap4d.h +21 -0
  53. package/ios/RMFDirectionsRendererMap4d.m +12 -0
  54. package/ios/RMFDummyView.h +7 -0
  55. package/ios/RMFDummyView.m +13 -0
  56. package/ios/RMFEventResponse.h +39 -0
  57. package/ios/RMFEventResponse.m +98 -0
  58. package/ios/RMFIcon.h +24 -0
  59. package/ios/RMFIcon.m +35 -0
  60. package/ios/RMFMapView.h +84 -0
  61. package/ios/RMFMapView.m +376 -0
  62. package/ios/RMFMapViewManager.h +17 -0
  63. package/ios/RMFMapViewManager.m +493 -0
  64. package/ios/RMFMarker.h +57 -0
  65. package/ios/RMFMarker.m +267 -0
  66. package/ios/RMFMarkerManager.h +17 -0
  67. package/ios/RMFMarkerManager.m +156 -0
  68. package/ios/RMFMarkerMap4d.h +19 -0
  69. package/ios/RMFMarkerMap4d.m +13 -0
  70. package/ios/RMFPOI.h +38 -0
  71. package/ios/RMFPOI.m +123 -0
  72. package/ios/RMFPOIManager.h +18 -0
  73. package/ios/RMFPOIManager.m +168 -0
  74. package/ios/RMFPOIMap4d.h +22 -0
  75. package/ios/RMFPOIMap4d.m +12 -0
  76. package/ios/RMFPolygon.h +41 -0
  77. package/ios/RMFPolygon.m +106 -0
  78. package/ios/RMFPolygonManager.h +18 -0
  79. package/ios/RMFPolygonManager.m +141 -0
  80. package/ios/RMFPolygonMap4d.h +23 -0
  81. package/ios/RMFPolygonMap4d.m +15 -0
  82. package/ios/RMFPolyline.h +38 -0
  83. package/ios/RMFPolyline.m +101 -0
  84. package/ios/RMFPolylineManager.h +18 -0
  85. package/ios/RMFPolylineManager.m +139 -0
  86. package/ios/RMFPolylineMap4d.h +22 -0
  87. package/ios/RMFPolylineMap4d.m +15 -0
  88. package/ios/building/RMFBuilding.h +41 -0
  89. package/ios/building/RMFBuilding.m +104 -0
  90. package/ios/building/RMFBuildingManager.h +19 -0
  91. package/ios/building/RMFBuildingManager.m +133 -0
  92. package/ios/building/RMFBuildingMap4d.h +23 -0
  93. package/ios/building/RMFBuildingMap4d.m +15 -0
  94. package/ios/overlays/RMFTileOverlay.h +36 -0
  95. package/ios/overlays/RMFTileOverlay.m +64 -0
  96. package/ios/overlays/RMFTileOverlayManager.h +17 -0
  97. package/ios/overlays/RMFTileOverlayManager.m +27 -0
  98. package/lib/commonjs/components/MFBuilding.js +192 -0
  99. package/lib/commonjs/components/MFBuilding.js.map +1 -0
  100. package/lib/commonjs/components/MFCircle.js +181 -0
  101. package/lib/commonjs/components/MFCircle.js.map +1 -0
  102. package/lib/commonjs/components/MFDirectionsRenderer.js +240 -0
  103. package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -0
  104. package/lib/commonjs/components/MFMapView.js +375 -0
  105. package/lib/commonjs/components/MFMapView.js.map +1 -0
  106. package/lib/commonjs/components/MFMarker.js +255 -0
  107. package/lib/commonjs/components/MFMarker.js.map +1 -0
  108. package/lib/commonjs/components/MFPOI.js +204 -0
  109. package/lib/commonjs/components/MFPOI.js.map +1 -0
  110. package/lib/commonjs/components/MFPolygon.js +183 -0
  111. package/lib/commonjs/components/MFPolygon.js.map +1 -0
  112. package/lib/commonjs/components/MFPolyline.js +173 -0
  113. package/lib/commonjs/components/MFPolyline.js.map +1 -0
  114. package/lib/commonjs/components/MFTileOverlay.js +51 -0
  115. package/lib/commonjs/components/MFTileOverlay.js.map +1 -0
  116. package/lib/commonjs/components/Map4dMapView.js +19 -0
  117. package/lib/commonjs/components/Map4dMapView.js.map +1 -0
  118. package/lib/commonjs/index.js +78 -0
  119. package/lib/commonjs/index.js.map +1 -0
  120. package/lib/module/components/MFBuilding.js +178 -0
  121. package/lib/module/components/MFBuilding.js.map +1 -0
  122. package/lib/module/components/MFCircle.js +167 -0
  123. package/lib/module/components/MFCircle.js.map +1 -0
  124. package/lib/module/components/MFDirectionsRenderer.js +226 -0
  125. package/lib/module/components/MFDirectionsRenderer.js.map +1 -0
  126. package/lib/module/components/MFMapView.js +361 -0
  127. package/lib/module/components/MFMapView.js.map +1 -0
  128. package/lib/module/components/MFMarker.js +240 -0
  129. package/lib/module/components/MFMarker.js.map +1 -0
  130. package/lib/module/components/MFPOI.js +190 -0
  131. package/lib/module/components/MFPOI.js.map +1 -0
  132. package/lib/module/components/MFPolygon.js +169 -0
  133. package/lib/module/components/MFPolygon.js.map +1 -0
  134. package/lib/module/components/MFPolyline.js +159 -0
  135. package/lib/module/components/MFPolyline.js.map +1 -0
  136. package/lib/module/components/MFTileOverlay.js +38 -0
  137. package/lib/module/components/MFTileOverlay.js.map +1 -0
  138. package/lib/module/components/Map4dMapView.js +10 -0
  139. package/lib/module/components/Map4dMapView.js.map +1 -0
  140. package/lib/module/index.js +11 -0
  141. package/lib/module/index.js.map +1 -0
  142. package/lib/typescript/components/Map4dMapView.d.ts +7 -0
  143. package/package.json +152 -0
  144. package/react-native-map4d-map.podspec +20 -0
  145. package/src/components/MFBuilding.js +188 -0
  146. package/src/components/MFCircle.js +173 -0
  147. package/src/components/MFDirectionsRenderer.js +237 -0
  148. package/src/components/MFMapView.js +374 -0
  149. package/src/components/MFMarker.js +246 -0
  150. package/src/components/MFPOI.js +184 -0
  151. package/src/components/MFPolygon.js +186 -0
  152. package/src/components/MFPolyline.js +172 -0
  153. package/src/components/MFTileOverlay.js +45 -0
  154. package/src/components/Map4dMapView.tsx +27 -0
  155. package/src/index.js +21 -0
@@ -0,0 +1,65 @@
1
+ package com.reactnativemap4dmap;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReadableArray;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.uimanager.ThemedReactContext;
8
+ import com.facebook.react.uimanager.ViewGroupManager;
9
+ import com.facebook.react.uimanager.annotations.ReactProp;
10
+
11
+ import java.util.HashMap;
12
+ import java.util.Map;
13
+
14
+ public class RMFTileOverlayManager extends ViewGroupManager<RMFTileOverlay> {
15
+ private static final int k_setVisible = 1;
16
+ private static final int k_setZIndex = k_setVisible + 1;
17
+
18
+ @Override
19
+ public String getName() {
20
+ return "RMFTileOverlay";
21
+ }
22
+
23
+ @Override
24
+ protected RMFTileOverlay createViewInstance(final ThemedReactContext reactContext) {
25
+ return new RMFTileOverlay(reactContext);
26
+ }
27
+
28
+ @Override
29
+ public void receiveCommand(final RMFTileOverlay view, final int commandId, @Nullable final ReadableArray args) {
30
+ ReadableMap data;
31
+ switch (commandId) {
32
+ case k_setVisible:
33
+ view.setVisible(args.getBoolean(0));
34
+ break;
35
+ case k_setZIndex:
36
+ view.setZIndex(args.getDouble(0));
37
+ break;
38
+ }
39
+ }
40
+
41
+ @Nullable
42
+ @Override
43
+ public Map<String, Integer> getCommandsMap() {
44
+ final HashMap<String, Integer> map = new HashMap();
45
+ map.put("setVisible", k_setVisible);
46
+ map.put("setZIndex", k_setZIndex);
47
+ return map;
48
+ }
49
+
50
+ @ReactProp(name = "urlTemplate")
51
+ public void setTemplateUrl(final RMFTileOverlay view, final String url) {
52
+ view.setTemplateUrl(url);
53
+ }
54
+
55
+ @ReactProp(name = "visible")
56
+ public void setVisible(final RMFTileOverlay view, final boolean visible) {
57
+ view.setVisible(visible);
58
+ }
59
+
60
+ @ReactProp(name = "zIndex")
61
+ public void setZIndex(final RMFTileOverlay view, final double zIndex) {
62
+ view.setZIndex(zIndex);
63
+ }
64
+
65
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ * This source code is licensed under the BSD-style license found in the
5
+ * LICENSE file in the root directory of this source tree. An additional grant
6
+ * of patent rights can be found in the PATENTS file in the same directory.
7
+ */
8
+
9
+ package com.reactnativemap4dmap;
10
+
11
+ import com.facebook.react.uimanager.LayoutShadowNode;
12
+ import com.facebook.react.uimanager.UIViewOperationQueue;
13
+
14
+ import java.util.HashMap;
15
+ import java.util.Map;
16
+
17
+ // Custom LayoutShadowNode implementation used in conjunction with the AirMapManager
18
+ // which sends the width/height of the view after layout occurs.
19
+ public class SizeReportingShadowNode extends LayoutShadowNode {
20
+
21
+ @Override
22
+ public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
23
+ super.onCollectExtraUpdates(uiViewOperationQueue);
24
+
25
+ Map<String, Float> data = new HashMap<>();
26
+ data.put("width", getLayoutWidth());
27
+ data.put("height", getLayoutHeight());
28
+
29
+ uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), data);
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ package com.reactnativemap4dmap;
2
+
3
+ import android.content.Context;
4
+ import android.graphics.Canvas;
5
+ import android.graphics.Rect;
6
+ import android.os.Build;
7
+
8
+ import com.facebook.react.uimanager.ViewProps;
9
+ import com.facebook.react.views.view.ReactViewGroup;
10
+
11
+ public class ViewAttacherGroup extends ReactViewGroup {
12
+
13
+ public ViewAttacherGroup(Context context) {
14
+ super(context);
15
+
16
+ this.setWillNotDraw(true);
17
+ this.setVisibility(VISIBLE);
18
+ this.setAlpha(0.0f);
19
+ this.setRemoveClippedSubviews(false);
20
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
21
+ this.setClipBounds(new Rect(0, 0, 0, 0));
22
+ }
23
+ this.setOverflow("hidden"); // Change to ViewProps.HIDDEN until RN 0.57 is base
24
+ }
25
+
26
+ // This should make it more performant, avoid trying to hard to overlap layers with opacity.
27
+ @Override
28
+ public boolean hasOverlappingRendering() {
29
+ return false;
30
+ }
31
+ }
@@ -0,0 +1,70 @@
1
+ package com.reactnativemap4dmap;
2
+
3
+ import android.os.Handler;
4
+ import android.os.Looper;
5
+
6
+ import java.util.LinkedList;
7
+
8
+ public class ViewChangesTracker {
9
+
10
+ private static ViewChangesTracker instance;
11
+ private Handler handler;
12
+ private LinkedList<RMFMarker> markers = new LinkedList<>();
13
+ private boolean hasScheduledFrame = false;
14
+ private Runnable updateRunnable;
15
+ private final long fps = 40;
16
+
17
+ private ViewChangesTracker() {
18
+ handler = new Handler(Looper.myLooper());
19
+ updateRunnable = new Runnable() {
20
+ @Override
21
+ public void run() {
22
+ hasScheduledFrame = false;
23
+ update();
24
+
25
+ if (markers.size() > 0) {
26
+ handler.postDelayed(updateRunnable, fps);
27
+ }
28
+ }
29
+ };
30
+ }
31
+
32
+ static ViewChangesTracker getInstance() {
33
+ if (instance == null) {
34
+ synchronized (ViewChangesTracker.class) {
35
+ instance = new ViewChangesTracker();
36
+ }
37
+ }
38
+
39
+ return instance;
40
+ }
41
+
42
+ public void addMarker(RMFMarker marker) {
43
+ markers.add(marker);
44
+
45
+ if (!hasScheduledFrame) {
46
+ hasScheduledFrame = true;
47
+ handler.postDelayed(updateRunnable, fps);
48
+ }
49
+ }
50
+
51
+ public void removeMarker(RMFMarker marker) {
52
+ markers.remove(marker);
53
+ }
54
+
55
+ private LinkedList<RMFMarker> markersToRemove = new LinkedList<>();
56
+
57
+ public void update() {
58
+ for (RMFMarker marker : markers) {
59
+ if (!marker.updateCustomForTracking()) {
60
+ markersToRemove.add(marker);
61
+ }
62
+ }
63
+
64
+ // Remove markers that are not active anymore
65
+ if (markersToRemove.size() > 0) {
66
+ markers.removeAll(markersToRemove);
67
+ markersToRemove.clear();
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,9 @@
1
+ package vn.map4d.map.annotations;
2
+
3
+ import android.graphics.Bitmap;
4
+
5
+ public class RMFBitmapDescriptor {
6
+ public static MFBitmapDescriptor create(Bitmap bitmap, int densityDpi) {
7
+ return new MFBitmapDescriptor(bitmap, densityDpi);
8
+ }
9
+ }
package/ios/Map4dMap.h ADDED
@@ -0,0 +1,7 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import "RMFMapViewManager.h"
3
+ #import "RMFMarkerManager.h"
4
+
5
+ @interface Map4dMap : NSObject <RCTBridgeModule>
6
+
7
+ @end
package/ios/Map4dMap.m ADDED
@@ -0,0 +1,14 @@
1
+ #import "Map4dMap.h"
2
+
3
+
4
+ @implementation Map4dMap
5
+
6
+ RCT_EXPORT_MODULE()
7
+
8
+ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
9
+ {
10
+ // TODO: Implement some actually useful functionality
11
+ callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]);
12
+ }
13
+
14
+ @end
@@ -0,0 +1,282 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+
11
+ 5E555C0D2413F4C50049A1A2 /* Map4dMap.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* Map4dMap.m */; };
12
+
13
+ /* End PBXBuildFile section */
14
+
15
+ /* Begin PBXCopyFilesBuildPhase section */
16
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
17
+ isa = PBXCopyFilesBuildPhase;
18
+ buildActionMask = 2147483647;
19
+ dstPath = "include/$(PRODUCT_NAME)";
20
+ dstSubfolderSpec = 16;
21
+ files = (
22
+ );
23
+ runOnlyForDeploymentPostprocessing = 0;
24
+ };
25
+ /* End PBXCopyFilesBuildPhase section */
26
+
27
+ /* Begin PBXFileReference section */
28
+ 134814201AA4EA6300B7C361 /* libMap4dMap.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMap4dMap.a; sourceTree = BUILT_PRODUCTS_DIR; };
29
+
30
+ B3E7B5881CC2AC0600A0062D /* Map4dMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Map4dMap.h; sourceTree = "<group>"; };
31
+ B3E7B5891CC2AC0600A0062D /* Map4dMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Map4dMap.m; sourceTree = "<group>"; };
32
+
33
+ /* End PBXFileReference section */
34
+
35
+ /* Begin PBXFrameworksBuildPhase section */
36
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
37
+ isa = PBXFrameworksBuildPhase;
38
+ buildActionMask = 2147483647;
39
+ files = (
40
+ );
41
+ runOnlyForDeploymentPostprocessing = 0;
42
+ };
43
+ /* End PBXFrameworksBuildPhase section */
44
+
45
+ /* Begin PBXGroup section */
46
+ 134814211AA4EA7D00B7C361 /* Products */ = {
47
+ isa = PBXGroup;
48
+ children = (
49
+ 134814201AA4EA6300B7C361 /* libMap4dMap.a */,
50
+ );
51
+ name = Products;
52
+ sourceTree = "<group>";
53
+ };
54
+ 58B511D21A9E6C8500147676 = {
55
+ isa = PBXGroup;
56
+ children = (
57
+
58
+ B3E7B5881CC2AC0600A0062D /* Map4dMap.h */,
59
+ B3E7B5891CC2AC0600A0062D /* Map4dMap.m */,
60
+
61
+ 134814211AA4EA7D00B7C361 /* Products */,
62
+ );
63
+ sourceTree = "<group>";
64
+ };
65
+ /* End PBXGroup section */
66
+
67
+ /* Begin PBXNativeTarget section */
68
+ 58B511DA1A9E6C8500147676 /* Map4dMap */ = {
69
+ isa = PBXNativeTarget;
70
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Map4dMap" */;
71
+ buildPhases = (
72
+ 58B511D71A9E6C8500147676 /* Sources */,
73
+ 58B511D81A9E6C8500147676 /* Frameworks */,
74
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
75
+ );
76
+ buildRules = (
77
+ );
78
+ dependencies = (
79
+ );
80
+ name = Map4dMap;
81
+ productName = RCTDataManager;
82
+ productReference = 134814201AA4EA6300B7C361 /* libMap4dMap.a */;
83
+ productType = "com.apple.product-type.library.static";
84
+ };
85
+ /* End PBXNativeTarget section */
86
+
87
+ /* Begin PBXProject section */
88
+ 58B511D31A9E6C8500147676 /* Project object */ = {
89
+ isa = PBXProject;
90
+ attributes = {
91
+ LastUpgradeCheck = 0920;
92
+ ORGANIZATIONNAME = Facebook;
93
+ TargetAttributes = {
94
+ 58B511DA1A9E6C8500147676 = {
95
+ CreatedOnToolsVersion = 6.1.1;
96
+ };
97
+ };
98
+ };
99
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Map4dMap" */;
100
+ compatibilityVersion = "Xcode 3.2";
101
+ developmentRegion = English;
102
+ hasScannedForEncodings = 0;
103
+ knownRegions = (
104
+ English,
105
+ en,
106
+ );
107
+ mainGroup = 58B511D21A9E6C8500147676;
108
+ productRefGroup = 58B511D21A9E6C8500147676;
109
+ projectDirPath = "";
110
+ projectRoot = "";
111
+ targets = (
112
+ 58B511DA1A9E6C8500147676 /* Map4dMap */,
113
+ );
114
+ };
115
+ /* End PBXProject section */
116
+
117
+ /* Begin PBXSourcesBuildPhase section */
118
+ 58B511D71A9E6C8500147676 /* Sources */ = {
119
+ isa = PBXSourcesBuildPhase;
120
+ buildActionMask = 2147483647;
121
+ files = (
122
+
123
+ B3E7B58A1CC2AC0600A0062D /* Map4dMap.m in Sources */,
124
+
125
+ );
126
+ runOnlyForDeploymentPostprocessing = 0;
127
+ };
128
+ /* End PBXSourcesBuildPhase section */
129
+
130
+ /* Begin XCBuildConfiguration section */
131
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
132
+ isa = XCBuildConfiguration;
133
+ buildSettings = {
134
+ ALWAYS_SEARCH_USER_PATHS = NO;
135
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
136
+ CLANG_CXX_LIBRARY = "libc++";
137
+ CLANG_ENABLE_MODULES = YES;
138
+ CLANG_ENABLE_OBJC_ARC = YES;
139
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
140
+ CLANG_WARN_BOOL_CONVERSION = YES;
141
+ CLANG_WARN_COMMA = YES;
142
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
143
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
144
+ CLANG_WARN_EMPTY_BODY = YES;
145
+ CLANG_WARN_ENUM_CONVERSION = YES;
146
+ CLANG_WARN_INFINITE_RECURSION = YES;
147
+ CLANG_WARN_INT_CONVERSION = YES;
148
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
149
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
150
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
151
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
152
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
153
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
154
+ CLANG_WARN_UNREACHABLE_CODE = YES;
155
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
156
+ COPY_PHASE_STRIP = NO;
157
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
158
+ ENABLE_TESTABILITY = YES;
159
+ GCC_C_LANGUAGE_STANDARD = gnu99;
160
+ GCC_DYNAMIC_NO_PIC = NO;
161
+ GCC_NO_COMMON_BLOCKS = YES;
162
+ GCC_OPTIMIZATION_LEVEL = 0;
163
+ GCC_PREPROCESSOR_DEFINITIONS = (
164
+ "DEBUG=1",
165
+ "$(inherited)",
166
+ );
167
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
168
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
169
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
170
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
171
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
172
+ GCC_WARN_UNUSED_FUNCTION = YES;
173
+ GCC_WARN_UNUSED_VARIABLE = YES;
174
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
175
+ MTL_ENABLE_DEBUG_INFO = YES;
176
+ ONLY_ACTIVE_ARCH = YES;
177
+ SDKROOT = iphoneos;
178
+ };
179
+ name = Debug;
180
+ };
181
+ 58B511EE1A9E6C8500147676 /* Release */ = {
182
+ isa = XCBuildConfiguration;
183
+ buildSettings = {
184
+ ALWAYS_SEARCH_USER_PATHS = NO;
185
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
186
+ CLANG_CXX_LIBRARY = "libc++";
187
+ CLANG_ENABLE_MODULES = YES;
188
+ CLANG_ENABLE_OBJC_ARC = YES;
189
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
190
+ CLANG_WARN_BOOL_CONVERSION = YES;
191
+ CLANG_WARN_COMMA = YES;
192
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
193
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
194
+ CLANG_WARN_EMPTY_BODY = YES;
195
+ CLANG_WARN_ENUM_CONVERSION = YES;
196
+ CLANG_WARN_INFINITE_RECURSION = YES;
197
+ CLANG_WARN_INT_CONVERSION = YES;
198
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
199
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
200
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
201
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
202
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
203
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
204
+ CLANG_WARN_UNREACHABLE_CODE = YES;
205
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
206
+ COPY_PHASE_STRIP = YES;
207
+ ENABLE_NS_ASSERTIONS = NO;
208
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
209
+ GCC_C_LANGUAGE_STANDARD = gnu99;
210
+ GCC_NO_COMMON_BLOCKS = YES;
211
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
212
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
213
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
214
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
215
+ GCC_WARN_UNUSED_FUNCTION = YES;
216
+ GCC_WARN_UNUSED_VARIABLE = YES;
217
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
218
+ MTL_ENABLE_DEBUG_INFO = NO;
219
+ SDKROOT = iphoneos;
220
+ VALIDATE_PRODUCT = YES;
221
+ };
222
+ name = Release;
223
+ };
224
+ 58B511F01A9E6C8500147676 /* Debug */ = {
225
+ isa = XCBuildConfiguration;
226
+ buildSettings = {
227
+ HEADER_SEARCH_PATHS = (
228
+ "$(inherited)",
229
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
230
+ "$(SRCROOT)/../../../React/**",
231
+ "$(SRCROOT)/../../react-native/React/**",
232
+ );
233
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
234
+ OTHER_LDFLAGS = "-ObjC";
235
+ PRODUCT_NAME = Map4dMap;
236
+ SKIP_INSTALL = YES;
237
+
238
+ };
239
+ name = Debug;
240
+ };
241
+ 58B511F11A9E6C8500147676 /* Release */ = {
242
+ isa = XCBuildConfiguration;
243
+ buildSettings = {
244
+ HEADER_SEARCH_PATHS = (
245
+ "$(inherited)",
246
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
247
+ "$(SRCROOT)/../../../React/**",
248
+ "$(SRCROOT)/../../react-native/React/**",
249
+ );
250
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
251
+ OTHER_LDFLAGS = "-ObjC";
252
+ PRODUCT_NAME = Map4dMap;
253
+ SKIP_INSTALL = YES;
254
+
255
+ };
256
+ name = Release;
257
+ };
258
+ /* End XCBuildConfiguration section */
259
+
260
+ /* Begin XCConfigurationList section */
261
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Map4dMap" */ = {
262
+ isa = XCConfigurationList;
263
+ buildConfigurations = (
264
+ 58B511ED1A9E6C8500147676 /* Debug */,
265
+ 58B511EE1A9E6C8500147676 /* Release */,
266
+ );
267
+ defaultConfigurationIsVisible = 0;
268
+ defaultConfigurationName = Release;
269
+ };
270
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Map4dMap" */ = {
271
+ isa = XCConfigurationList;
272
+ buildConfigurations = (
273
+ 58B511F01A9E6C8500147676 /* Debug */,
274
+ 58B511F11A9E6C8500147676 /* Release */,
275
+ );
276
+ defaultConfigurationIsVisible = 0;
277
+ defaultConfigurationName = Release;
278
+ };
279
+ /* End XCConfigurationList section */
280
+ };
281
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
282
+ }
@@ -0,0 +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
@@ -0,0 +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 */
@@ -0,0 +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