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.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/android/build.gradle +60 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +122 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +18 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +226 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +212 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +173 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +148 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +138 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +65 -0
- package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -0
- package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -0
- package/ios/Map4dMap.h +7 -0
- package/ios/Map4dMap.m +14 -0
- package/ios/Map4dMap.xcodeproj/project.pbxproj +282 -0
- package/ios/Map4dMapViewManager.m +34 -0
- package/ios/RCTConvert+Map4dMap.h +33 -0
- package/ios/RCTConvert+Map4dMap.m +112 -0
- package/ios/RMFCircle.h +37 -0
- package/ios/RMFCircle.m +100 -0
- package/ios/RMFCircleManager.h +18 -0
- package/ios/RMFCircleManager.m +155 -0
- package/ios/RMFCircleMap4d.h +23 -0
- package/ios/RMFCircleMap4d.m +13 -0
- package/ios/RMFCoordinate.h +22 -0
- package/ios/RMFCoordinate.m +13 -0
- package/ios/RMFDirectionsMarkerOptions.h +24 -0
- package/ios/RMFDirectionsMarkerOptions.m +23 -0
- package/ios/RMFDirectionsRenderer.h +47 -0
- package/ios/RMFDirectionsRenderer.m +182 -0
- package/ios/RMFDirectionsRendererManager.h +17 -0
- package/ios/RMFDirectionsRendererManager.m +84 -0
- package/ios/RMFDirectionsRendererMap4d.h +21 -0
- package/ios/RMFDirectionsRendererMap4d.m +12 -0
- package/ios/RMFDummyView.h +7 -0
- package/ios/RMFDummyView.m +13 -0
- package/ios/RMFEventResponse.h +39 -0
- package/ios/RMFEventResponse.m +98 -0
- package/ios/RMFIcon.h +24 -0
- package/ios/RMFIcon.m +35 -0
- package/ios/RMFMapView.h +84 -0
- package/ios/RMFMapView.m +376 -0
- package/ios/RMFMapViewManager.h +17 -0
- package/ios/RMFMapViewManager.m +493 -0
- package/ios/RMFMarker.h +57 -0
- package/ios/RMFMarker.m +267 -0
- package/ios/RMFMarkerManager.h +17 -0
- package/ios/RMFMarkerManager.m +156 -0
- package/ios/RMFMarkerMap4d.h +19 -0
- package/ios/RMFMarkerMap4d.m +13 -0
- package/ios/RMFPOI.h +38 -0
- package/ios/RMFPOI.m +123 -0
- package/ios/RMFPOIManager.h +18 -0
- package/ios/RMFPOIManager.m +168 -0
- package/ios/RMFPOIMap4d.h +22 -0
- package/ios/RMFPOIMap4d.m +12 -0
- package/ios/RMFPolygon.h +41 -0
- package/ios/RMFPolygon.m +106 -0
- package/ios/RMFPolygonManager.h +18 -0
- package/ios/RMFPolygonManager.m +141 -0
- package/ios/RMFPolygonMap4d.h +23 -0
- package/ios/RMFPolygonMap4d.m +15 -0
- package/ios/RMFPolyline.h +38 -0
- package/ios/RMFPolyline.m +101 -0
- package/ios/RMFPolylineManager.h +18 -0
- package/ios/RMFPolylineManager.m +139 -0
- package/ios/RMFPolylineMap4d.h +22 -0
- package/ios/RMFPolylineMap4d.m +15 -0
- package/ios/building/RMFBuilding.h +41 -0
- package/ios/building/RMFBuilding.m +104 -0
- package/ios/building/RMFBuildingManager.h +19 -0
- package/ios/building/RMFBuildingManager.m +133 -0
- package/ios/building/RMFBuildingMap4d.h +23 -0
- package/ios/building/RMFBuildingMap4d.m +15 -0
- package/ios/overlays/RMFTileOverlay.h +36 -0
- package/ios/overlays/RMFTileOverlay.m +64 -0
- package/ios/overlays/RMFTileOverlayManager.h +17 -0
- package/ios/overlays/RMFTileOverlayManager.m +27 -0
- package/lib/commonjs/components/MFBuilding.js +192 -0
- package/lib/commonjs/components/MFBuilding.js.map +1 -0
- package/lib/commonjs/components/MFCircle.js +181 -0
- package/lib/commonjs/components/MFCircle.js.map +1 -0
- package/lib/commonjs/components/MFDirectionsRenderer.js +240 -0
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -0
- package/lib/commonjs/components/MFMapView.js +375 -0
- package/lib/commonjs/components/MFMapView.js.map +1 -0
- package/lib/commonjs/components/MFMarker.js +255 -0
- package/lib/commonjs/components/MFMarker.js.map +1 -0
- package/lib/commonjs/components/MFPOI.js +204 -0
- package/lib/commonjs/components/MFPOI.js.map +1 -0
- package/lib/commonjs/components/MFPolygon.js +183 -0
- package/lib/commonjs/components/MFPolygon.js.map +1 -0
- package/lib/commonjs/components/MFPolyline.js +173 -0
- package/lib/commonjs/components/MFPolyline.js.map +1 -0
- package/lib/commonjs/components/MFTileOverlay.js +51 -0
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -0
- package/lib/commonjs/components/Map4dMapView.js +19 -0
- package/lib/commonjs/components/Map4dMapView.js.map +1 -0
- package/lib/commonjs/index.js +78 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/components/MFBuilding.js +178 -0
- package/lib/module/components/MFBuilding.js.map +1 -0
- package/lib/module/components/MFCircle.js +167 -0
- package/lib/module/components/MFCircle.js.map +1 -0
- package/lib/module/components/MFDirectionsRenderer.js +226 -0
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -0
- package/lib/module/components/MFMapView.js +361 -0
- package/lib/module/components/MFMapView.js.map +1 -0
- package/lib/module/components/MFMarker.js +240 -0
- package/lib/module/components/MFMarker.js.map +1 -0
- package/lib/module/components/MFPOI.js +190 -0
- package/lib/module/components/MFPOI.js.map +1 -0
- package/lib/module/components/MFPolygon.js +169 -0
- package/lib/module/components/MFPolygon.js.map +1 -0
- package/lib/module/components/MFPolyline.js +159 -0
- package/lib/module/components/MFPolyline.js.map +1 -0
- package/lib/module/components/MFTileOverlay.js +38 -0
- package/lib/module/components/MFTileOverlay.js.map +1 -0
- package/lib/module/components/Map4dMapView.js +10 -0
- package/lib/module/components/Map4dMapView.js.map +1 -0
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/components/Map4dMapView.d.ts +7 -0
- package/package.json +152 -0
- package/react-native-map4d-map.podspec +20 -0
- package/src/components/MFBuilding.js +188 -0
- package/src/components/MFCircle.js +173 -0
- package/src/components/MFDirectionsRenderer.js +237 -0
- package/src/components/MFMapView.js +374 -0
- package/src/components/MFMarker.js +246 -0
- package/src/components/MFPOI.js +184 -0
- package/src/components/MFPolygon.js +186 -0
- package/src/components/MFPolyline.js +172 -0
- package/src/components/MFTileOverlay.js +45 -0
- package/src/components/Map4dMapView.tsx +27 -0
- package/src/index.js +21 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFPolylineManager.h
|
|
3
|
+
// Map4dMap
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 7/3/20.
|
|
6
|
+
// Copyright © 2020 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RMFPolylineManager_h
|
|
10
|
+
#define RMFPolylineManager_h
|
|
11
|
+
|
|
12
|
+
#import <React/RCTViewManager.h>
|
|
13
|
+
|
|
14
|
+
@interface RMFPolylineManager : RCTViewManager
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
#endif /* RMFPolylineManager_h */
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFPolylineManager.m
|
|
3
|
+
// Map4dMap
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 7/3/20.
|
|
6
|
+
// Copyright © 2020 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RMFPolylineManager.h"
|
|
10
|
+
#import "RMFPolyline.h"
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
#import "RCTConvert+Map4dMap.h"
|
|
13
|
+
#import <React/RCTBridge.h>
|
|
14
|
+
#import <React/RCTUIManager.h>
|
|
15
|
+
|
|
16
|
+
@implementation RMFPolylineManager
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
RCT_EXPORT_MODULE(RMFPolyline)
|
|
20
|
+
|
|
21
|
+
- (UIView *)view {
|
|
22
|
+
RMFPolyline * polyline = [[RMFPolyline alloc] init];
|
|
23
|
+
return polyline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(coordinates, RMFCoordinateArray)
|
|
27
|
+
RCT_EXPORT_VIEW_PROPERTY(width, CGFloat)
|
|
28
|
+
RCT_EXPORT_VIEW_PROPERTY(color, UIColor)
|
|
29
|
+
RCT_EXPORT_VIEW_PROPERTY(lineStyle, NSString)
|
|
30
|
+
RCT_EXPORT_VIEW_PROPERTY(userInteractionEnabled, BOOL)
|
|
31
|
+
RCT_EXPORT_VIEW_PROPERTY(zIndex, float)
|
|
32
|
+
RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(userData, NSDictionary)
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
36
|
+
|
|
37
|
+
RCT_EXPORT_METHOD(setCoordinates:(nonnull NSNumber *)reactTag
|
|
38
|
+
withCoordinates:(id)coordinates)
|
|
39
|
+
{
|
|
40
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
41
|
+
id view = viewRegistry[reactTag];
|
|
42
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
43
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
44
|
+
} else {
|
|
45
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
46
|
+
[polyline setCoordinates:[RCTConvert RMFCoordinateArray:coordinates]];
|
|
47
|
+
}
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
RCT_EXPORT_METHOD(setWidth:(nonnull NSNumber *)reactTag
|
|
52
|
+
width:(CGFloat)width)
|
|
53
|
+
{
|
|
54
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
55
|
+
id view = viewRegistry[reactTag];
|
|
56
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
57
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
58
|
+
} else {
|
|
59
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
60
|
+
[polyline setWidth:width];
|
|
61
|
+
}
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
RCT_EXPORT_METHOD(setColor:(nonnull NSNumber *)reactTag
|
|
66
|
+
color:(id)json)
|
|
67
|
+
{
|
|
68
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
69
|
+
id view = viewRegistry[reactTag];
|
|
70
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
71
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
72
|
+
} else {
|
|
73
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
74
|
+
UIColor* color = [RCTConvert UIColor:json];
|
|
75
|
+
if (color != nil) {
|
|
76
|
+
[polyline setColor:color];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
RCT_EXPORT_METHOD(setLineStyle:(nonnull NSNumber *)reactTag
|
|
83
|
+
style:(NSString*)style)
|
|
84
|
+
{
|
|
85
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
86
|
+
id view = viewRegistry[reactTag];
|
|
87
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
88
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
89
|
+
} else {
|
|
90
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
91
|
+
[polyline setLineStyle:style];
|
|
92
|
+
}
|
|
93
|
+
}];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
RCT_EXPORT_METHOD(setZIndex:(nonnull NSNumber *)reactTag
|
|
97
|
+
zIndex:(float)zIndex)
|
|
98
|
+
{
|
|
99
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
100
|
+
id view = viewRegistry[reactTag];
|
|
101
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
102
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
103
|
+
} else {
|
|
104
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
105
|
+
[polyline setZIndex:zIndex];
|
|
106
|
+
}
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
RCT_EXPORT_METHOD(setVisible:(nonnull NSNumber *)reactTag
|
|
111
|
+
visible:(BOOL)visible)
|
|
112
|
+
{
|
|
113
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
114
|
+
id view = viewRegistry[reactTag];
|
|
115
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
116
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
117
|
+
} else {
|
|
118
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
119
|
+
[polyline setVisible:visible];
|
|
120
|
+
}
|
|
121
|
+
}];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
RCT_EXPORT_METHOD(setUserData:(nonnull NSNumber *)reactTag
|
|
125
|
+
userData:(id)json)
|
|
126
|
+
{
|
|
127
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
128
|
+
id view = viewRegistry[reactTag];
|
|
129
|
+
if (![view isKindOfClass:[RMFPolyline class]]) {
|
|
130
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFCircle, got: %@", view);
|
|
131
|
+
} else {
|
|
132
|
+
RMFPolyline *polyline = (RMFPolyline *)view;
|
|
133
|
+
[polyline setUserData:[RCTConvert NSDictionary:json]];
|
|
134
|
+
}
|
|
135
|
+
}];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFPolylineMap4d.h
|
|
3
|
+
// Map4dMap
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 7/3/20.
|
|
6
|
+
// Copyright © 2020 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RMFPolylineMap4d_h
|
|
10
|
+
#define RMFPolylineMap4d_h
|
|
11
|
+
|
|
12
|
+
#import <Map4dMap/Map4dMap.h>
|
|
13
|
+
|
|
14
|
+
@class RMFPolyline;
|
|
15
|
+
|
|
16
|
+
@interface RMFPolylineMap4d : MFPolyline
|
|
17
|
+
|
|
18
|
+
@property (nonatomic, weak) RMFPolyline *reactPolyline;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
#endif /* RMFPolylineMap4d_h */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFBuilding.h
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 6/10/25.
|
|
6
|
+
// Copyright © 2025 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RMFBuilding_h
|
|
10
|
+
#define RMFBuilding_h
|
|
11
|
+
|
|
12
|
+
#import <React/UIView+React.h>
|
|
13
|
+
#import "RMFBuildingMap4d.h"
|
|
14
|
+
#import "RMFMapView.h"
|
|
15
|
+
|
|
16
|
+
@interface RMFBuilding : UIView
|
|
17
|
+
|
|
18
|
+
@property(nonatomic, strong, nonnull) RMFBuildingMap4d * map4dBuilding;
|
|
19
|
+
|
|
20
|
+
@property(nonatomic, copy) RCTBubblingEventBlock _Nullable onPress;
|
|
21
|
+
|
|
22
|
+
@property (nonatomic, copy, nullable) NSString *name;
|
|
23
|
+
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;//position
|
|
24
|
+
@property (nonatomic, copy, nullable) NSString *modelUrl;
|
|
25
|
+
@property (nonatomic, copy, nullable) NSString *textureUrl;
|
|
26
|
+
@property (nonatomic, assign) double scale;
|
|
27
|
+
@property (nonatomic, assign) CGFloat bearing;
|
|
28
|
+
@property (nonatomic, assign) double elevation;
|
|
29
|
+
@property (nonatomic, assign) BOOL selected;
|
|
30
|
+
@property (nonatomic, assign) BOOL touchable;
|
|
31
|
+
@property (nonatomic, assign) BOOL visible;
|
|
32
|
+
@property (nonatomic, copy, nullable) NSDictionary * userData;
|
|
33
|
+
|
|
34
|
+
- (void)setMapView:(RMFMapView* _Nullable)mapView;
|
|
35
|
+
|
|
36
|
+
- (void)didTapAtPixel:(CGPoint)pixel;
|
|
37
|
+
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
#endif /* RMFBuilding_h */
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFBuilding.m
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 6/10/25.
|
|
6
|
+
// Copyright © 2025 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RMFBuilding.h"
|
|
10
|
+
#import "RMFEventResponse.h"
|
|
11
|
+
|
|
12
|
+
@implementation RMFBuilding
|
|
13
|
+
|
|
14
|
+
- (instancetype)init {
|
|
15
|
+
self = [super init];
|
|
16
|
+
if (self) {
|
|
17
|
+
_map4dBuilding = [[RMFBuildingMap4d alloc] init];
|
|
18
|
+
_map4dBuilding.reactBuilding = self;
|
|
19
|
+
|
|
20
|
+
_name = _map4dBuilding.name;
|
|
21
|
+
_coordinate = _map4dBuilding.position;
|
|
22
|
+
_modelUrl = _map4dBuilding.model;
|
|
23
|
+
_textureUrl = _map4dBuilding.texture;
|
|
24
|
+
_scale = _map4dBuilding.scale;
|
|
25
|
+
_bearing = _map4dBuilding.bearing;
|
|
26
|
+
_elevation = _map4dBuilding.elevation;
|
|
27
|
+
_selected = _map4dBuilding.selected;
|
|
28
|
+
_touchable = _map4dBuilding.userInteractionEnabled;
|
|
29
|
+
_visible = !_map4dBuilding.isHidden;
|
|
30
|
+
_userData = nil;
|
|
31
|
+
}
|
|
32
|
+
return self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)setMapView:(RMFMapView *)mapView {
|
|
36
|
+
_map4dBuilding.map = mapView;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void)didTapAtPixel:(CGPoint)pixel {
|
|
40
|
+
if (self.onPress) {
|
|
41
|
+
CLLocationCoordinate2D tapLocation = [_map4dBuilding.map.projection coordinateForPoint:pixel];
|
|
42
|
+
NSMutableDictionary* response = [NSMutableDictionary dictionaryWithDictionary:[RMFEventResponse fromCoordinate:tapLocation
|
|
43
|
+
pixel:pixel]];
|
|
44
|
+
response[@"building"] = @{
|
|
45
|
+
kRMFLatLngCoordinateResponseKey: [RMFEventResponse fromCoordinate:_map4dBuilding.position],
|
|
46
|
+
@"userData": _userData != nil ? _userData : @{}
|
|
47
|
+
};
|
|
48
|
+
response[@"action"] = @"building-press";
|
|
49
|
+
|
|
50
|
+
self.onPress(response);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (void)setName:(NSString *)name {
|
|
55
|
+
_name = name;
|
|
56
|
+
_map4dBuilding.name = name;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (void)setCoordinate:(CLLocationCoordinate2D)coordinate {
|
|
60
|
+
_coordinate = coordinate;
|
|
61
|
+
_map4dBuilding.position = coordinate;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void)setModelUrl:(NSString *)modelUrl {
|
|
65
|
+
_modelUrl = modelUrl;
|
|
66
|
+
_map4dBuilding.model = modelUrl;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)setTextureUrl:(NSString *)textureUrl {
|
|
70
|
+
_textureUrl = textureUrl;
|
|
71
|
+
_map4dBuilding.texture = textureUrl;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)setScale:(double)scale {
|
|
75
|
+
_scale = scale;
|
|
76
|
+
_map4dBuilding.scale = scale;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
- (void)setBearing:(CGFloat)bearing {
|
|
80
|
+
_bearing = bearing;
|
|
81
|
+
_map4dBuilding.bearing = bearing;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)setElevation:(double)elevation {
|
|
85
|
+
_elevation = elevation;
|
|
86
|
+
_map4dBuilding.elevation = elevation;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (void)setSelected:(BOOL)selected {
|
|
90
|
+
_selected = selected;
|
|
91
|
+
_map4dBuilding.selected = selected;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
- (void)setTouchable:(BOOL)touchable {
|
|
95
|
+
_touchable = touchable;
|
|
96
|
+
_map4dBuilding.userInteractionEnabled = touchable;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
- (void)setVisible:(BOOL)visible {
|
|
100
|
+
_visible = visible;
|
|
101
|
+
_map4dBuilding.isHidden = !visible;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFBuildingManager.h
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 6/10/25.
|
|
6
|
+
// Copyright © 2025 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RMFBuildingManager_h
|
|
10
|
+
#define RMFBuildingManager_h
|
|
11
|
+
|
|
12
|
+
#import <React/RCTViewManager.h>
|
|
13
|
+
|
|
14
|
+
@interface RMFBuildingManager : RCTViewManager
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#endif /* RMFBuildingManager_h */
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFBuildingManager.m
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 6/10/25.
|
|
6
|
+
// Copyright © 2025 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RMFBuildingManager.h"
|
|
10
|
+
#import "RMFBuilding.h"
|
|
11
|
+
#import <React/RCTConvert+CoreLocation.h>
|
|
12
|
+
#import <React/RCTBridge.h>
|
|
13
|
+
#import <React/RCTUIManager.h>
|
|
14
|
+
|
|
15
|
+
@implementation RMFBuildingManager
|
|
16
|
+
|
|
17
|
+
RCT_EXPORT_MODULE(RMFBuilding)
|
|
18
|
+
|
|
19
|
+
- (UIView *)view {
|
|
20
|
+
RMFBuilding *building = [[RMFBuilding alloc] init];
|
|
21
|
+
return building;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(name, NSString)
|
|
25
|
+
RCT_EXPORT_VIEW_PROPERTY(coordinate, CLLocationCoordinate2D)
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(modelUrl, NSString)
|
|
27
|
+
RCT_EXPORT_VIEW_PROPERTY(textureUrl, NSString)
|
|
28
|
+
RCT_EXPORT_VIEW_PROPERTY(scale, double)
|
|
29
|
+
RCT_EXPORT_VIEW_PROPERTY(bearing, CGFloat)
|
|
30
|
+
RCT_EXPORT_VIEW_PROPERTY(elevation, double)
|
|
31
|
+
RCT_EXPORT_VIEW_PROPERTY(selected, BOOL)
|
|
32
|
+
RCT_EXPORT_VIEW_PROPERTY(touchable, BOOL)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
|
|
34
|
+
RCT_EXPORT_VIEW_PROPERTY(userData, NSDictionary)
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
36
|
+
|
|
37
|
+
RCT_EXPORT_METHOD(setName:(nonnull NSNumber *)reactTag name:(NSString *)name) {
|
|
38
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
39
|
+
id view = viewRegistry[reactTag];
|
|
40
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
41
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
42
|
+
} else {
|
|
43
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
44
|
+
[building setName:name];
|
|
45
|
+
}
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
RCT_EXPORT_METHOD(setScale:(nonnull NSNumber *)reactTag scale:(double)scale) {
|
|
50
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
51
|
+
id view = viewRegistry[reactTag];
|
|
52
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
53
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
54
|
+
} else {
|
|
55
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
56
|
+
[building setScale:scale];
|
|
57
|
+
}
|
|
58
|
+
}];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
RCT_EXPORT_METHOD(setBearing:(nonnull NSNumber *)reactTag bearing:(CGFloat)bearing) {
|
|
62
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
63
|
+
id view = viewRegistry[reactTag];
|
|
64
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
65
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
66
|
+
} else {
|
|
67
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
68
|
+
[building setBearing:bearing];
|
|
69
|
+
}
|
|
70
|
+
}];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
RCT_EXPORT_METHOD(setElevation:(nonnull NSNumber *)reactTag elevation:(double)elevation) {
|
|
74
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
75
|
+
id view = viewRegistry[reactTag];
|
|
76
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
77
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
78
|
+
} else {
|
|
79
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
80
|
+
[building setElevation:elevation];
|
|
81
|
+
}
|
|
82
|
+
}];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
RCT_EXPORT_METHOD(setSelected:(nonnull NSNumber *)reactTag selected:(BOOL)selected) {
|
|
86
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
87
|
+
id view = viewRegistry[reactTag];
|
|
88
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
89
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
90
|
+
} else {
|
|
91
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
92
|
+
[building setSelected:selected];
|
|
93
|
+
}
|
|
94
|
+
}];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
RCT_EXPORT_METHOD(setTouchable:(nonnull NSNumber *)reactTag touchable:(BOOL)touchable) {
|
|
98
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
99
|
+
id view = viewRegistry[reactTag];
|
|
100
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
101
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
102
|
+
} else {
|
|
103
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
104
|
+
[building setTouchable:touchable];
|
|
105
|
+
}
|
|
106
|
+
}];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
RCT_EXPORT_METHOD(setVisible:(nonnull NSNumber *)reactTag visible:(BOOL)visible) {
|
|
110
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
111
|
+
id view = viewRegistry[reactTag];
|
|
112
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
113
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
114
|
+
} else {
|
|
115
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
116
|
+
[building setVisible:visible];
|
|
117
|
+
}
|
|
118
|
+
}];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
RCT_EXPORT_METHOD(setUserData:(nonnull NSNumber *)reactTag userData:(id)json) {
|
|
122
|
+
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
123
|
+
id view = viewRegistry[reactTag];
|
|
124
|
+
if (![view isKindOfClass:[RMFBuilding class]]) {
|
|
125
|
+
RCTLogError(@"Invalid view returned from registry, expecting RMFBuilding, got: %@", view);
|
|
126
|
+
} else {
|
|
127
|
+
RMFBuilding *building = (RMFBuilding *)view;
|
|
128
|
+
[building setUserData:[RCTConvert NSDictionary:json]];
|
|
129
|
+
}
|
|
130
|
+
}];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFBuildingMap4d.h
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 6/10/25.
|
|
6
|
+
// Copyright © 2025 IOTLink. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef RMFBuildingMap4d_h
|
|
10
|
+
#define RMFBuildingMap4d_h
|
|
11
|
+
|
|
12
|
+
#import <Map4dMap/Map4dMap.h>
|
|
13
|
+
|
|
14
|
+
@class RMFBuilding;
|
|
15
|
+
|
|
16
|
+
@interface RMFBuildingMap4d : MFBuilding
|
|
17
|
+
|
|
18
|
+
@property (nonatomic, weak) RMFBuilding *reactBuilding;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#endif /* RMFBuildingMap4d_h */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFTileOverlay.h
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 12/15/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef RMFTileOverlay_h
|
|
9
|
+
#define RMFTileOverlay_h
|
|
10
|
+
|
|
11
|
+
#import <React/UIView+React.h>
|
|
12
|
+
#import <Map4dMap/Map4dMap.h>
|
|
13
|
+
#import "RMFMapView.h"
|
|
14
|
+
|
|
15
|
+
@class RMFTileOverlay;
|
|
16
|
+
|
|
17
|
+
@interface RMFTileURLConstructor : NSObject<MFTileURLConstructor>
|
|
18
|
+
@property(nonatomic, weak, nullable) RMFTileOverlay *reactTileOverlay;
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
#pragma mark - RMFTileOverlay
|
|
22
|
+
|
|
23
|
+
@interface RMFTileOverlay : UIView
|
|
24
|
+
|
|
25
|
+
@property(nonatomic, strong, nullable) MFURLTileLayer* urlTileLayer;
|
|
26
|
+
|
|
27
|
+
@property(nonatomic, strong, nullable) NSString *urlTemplate;
|
|
28
|
+
@property(nonatomic, assign) float zIndex;
|
|
29
|
+
@property(nonatomic, assign) BOOL visible;
|
|
30
|
+
|
|
31
|
+
- (void)setMapView:(RMFMapView* _Nullable)mapView;
|
|
32
|
+
|
|
33
|
+
@end
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#endif /* RMFTileOverlay_h */
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFTileOverlay.m
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 12/15/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "RMFTileOverlay.h"
|
|
9
|
+
|
|
10
|
+
@implementation RMFTileURLConstructor
|
|
11
|
+
|
|
12
|
+
- (NSURL * _Nullable)getTileUrlWithX:(NSUInteger)x y:(NSUInteger)y zoom:(NSUInteger)zoom {
|
|
13
|
+
if (_reactTileOverlay.urlTemplate == nil) {
|
|
14
|
+
return nil;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
NSString* url = _reactTileOverlay.urlTemplate;
|
|
18
|
+
if ([url containsString:@"{z}"]) {
|
|
19
|
+
url = [url stringByReplacingOccurrencesOfString:@"{z}" withString:[@(zoom) stringValue]];
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
url = [url stringByReplacingOccurrencesOfString:@"{zoom}" withString:[@(zoom) stringValue]];
|
|
23
|
+
}
|
|
24
|
+
url = [url stringByReplacingOccurrencesOfString:@"{x}" withString:[@(x) stringValue]];
|
|
25
|
+
url = [url stringByReplacingOccurrencesOfString:@"{y}" withString:[@(y) stringValue]];
|
|
26
|
+
return [NSURL URLWithString:url];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@implementation RMFTileOverlay
|
|
32
|
+
|
|
33
|
+
- (instancetype)init {
|
|
34
|
+
if (self = [super init]) {
|
|
35
|
+
RMFTileURLConstructor* constructor = [[RMFTileURLConstructor alloc] init];
|
|
36
|
+
constructor.reactTileOverlay = self;
|
|
37
|
+
|
|
38
|
+
_urlTileLayer = [MFURLTileLayer tileLayerWithURLConstructor:constructor];
|
|
39
|
+
}
|
|
40
|
+
return self;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)setMapView:(RMFMapView *)mapView {
|
|
44
|
+
_urlTileLayer.map = mapView;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
- (void)setUrlTemplate:(NSString *)urlTemplate {
|
|
48
|
+
_urlTemplate = urlTemplate;
|
|
49
|
+
if (_urlTileLayer.map != nil) {
|
|
50
|
+
[_urlTileLayer clearTileCache];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (void)setVisible:(BOOL)visible {
|
|
55
|
+
_visible = visible;
|
|
56
|
+
_urlTileLayer.isHidden = !visible;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (void)setZIndex:(float)zIndex {
|
|
60
|
+
_zIndex = zIndex;
|
|
61
|
+
_urlTileLayer.zIndex = zIndex;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFTileOverlayManager.h
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 12/15/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef RMFTileOverlayManager_h
|
|
9
|
+
#define RMFTileOverlayManager_h
|
|
10
|
+
|
|
11
|
+
#import <React/RCTViewManager.h>
|
|
12
|
+
|
|
13
|
+
@interface RMFTileOverlayManager : RCTViewManager
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
#endif /* RMFTileOverlayManager_h */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RMFTileOverlayManager.m
|
|
3
|
+
// react-native-map4d-map
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 12/15/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "RMFTileOverlayManager.h"
|
|
9
|
+
#import "RMFTileOverlay.h"
|
|
10
|
+
#import <React/RCTConvert+CoreLocation.h>
|
|
11
|
+
#import <React/RCTBridge.h>
|
|
12
|
+
#import <React/RCTUIManager.h>
|
|
13
|
+
|
|
14
|
+
@implementation RMFTileOverlayManager
|
|
15
|
+
|
|
16
|
+
RCT_EXPORT_MODULE(RMFTileOverlay)
|
|
17
|
+
|
|
18
|
+
- (UIView *)view {
|
|
19
|
+
RMFTileOverlay * overlay = [[RMFTileOverlay alloc] init];
|
|
20
|
+
return overlay;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(urlTemplate, NSString)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(zIndex, float)
|
|
25
|
+
RCT_EXPORT_VIEW_PROPERTY(visible, BOOL)
|
|
26
|
+
|
|
27
|
+
@end
|