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.
- package/LICENSE +21 -21
- package/README.md +88 -41
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +1570 -0
- package/android/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +60 -60
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -87
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -298
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -35
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -167
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -121
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -105
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +121 -121
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -502
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -143
- package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +17 -17
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -1172
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +226 -226
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -412
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +211 -211
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -222
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -119
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +172 -172
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +147 -147
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -146
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +137 -137
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -95
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +64 -64
- package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -70
- package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -9
- package/ios/Map4dMap.h +7 -7
- package/ios/Map4dMap.m +14 -14
- package/ios/Map4dMapViewManager.m +34 -34
- package/ios/RCTConvert+Map4dMap.h +33 -33
- package/ios/RCTConvert+Map4dMap.m +112 -112
- package/ios/RMFCircle.h +37 -37
- package/ios/RMFCircle.m +100 -100
- package/ios/RMFCircleManager.h +18 -18
- package/ios/RMFCircleManager.m +155 -155
- package/ios/RMFCircleMap4d.h +23 -23
- package/ios/RMFCircleMap4d.m +13 -13
- package/ios/RMFCoordinate.h +22 -22
- package/ios/RMFCoordinate.m +13 -13
- package/ios/RMFDirectionsMarkerOptions.h +24 -24
- package/ios/RMFDirectionsMarkerOptions.m +23 -23
- package/ios/RMFDirectionsRenderer.h +47 -47
- package/ios/RMFDirectionsRenderer.m +182 -182
- package/ios/RMFDirectionsRendererManager.h +17 -17
- package/ios/RMFDirectionsRendererManager.m +84 -84
- package/ios/RMFDirectionsRendererMap4d.h +21 -21
- package/ios/RMFDirectionsRendererMap4d.m +12 -12
- package/ios/RMFDummyView.h +6 -6
- package/ios/RMFDummyView.m +12 -12
- package/ios/RMFEventResponse.h +39 -39
- package/ios/RMFEventResponse.m +98 -98
- package/ios/RMFIcon.h +24 -24
- package/ios/RMFIcon.m +35 -35
- package/ios/RMFMapView.h +84 -84
- package/ios/RMFMapView.m +376 -376
- package/ios/RMFMapViewManager.h +17 -17
- package/ios/RMFMapViewManager.m +493 -493
- package/ios/RMFMarker.h +57 -57
- package/ios/RMFMarker.m +267 -267
- package/ios/RMFMarkerManager.h +17 -17
- package/ios/RMFMarkerManager.m +156 -156
- package/ios/RMFMarkerMap4d.h +19 -19
- package/ios/RMFMarkerMap4d.m +13 -13
- package/ios/RMFPOI.h +38 -38
- package/ios/RMFPOI.m +123 -123
- package/ios/RMFPOIManager.h +18 -18
- package/ios/RMFPOIManager.m +168 -168
- package/ios/RMFPOIMap4d.h +22 -22
- package/ios/RMFPOIMap4d.m +12 -12
- package/ios/RMFPolygon.h +41 -41
- package/ios/RMFPolygon.m +106 -106
- package/ios/RMFPolygonManager.h +18 -18
- package/ios/RMFPolygonManager.m +141 -141
- package/ios/RMFPolygonMap4d.h +23 -23
- package/ios/RMFPolygonMap4d.m +15 -15
- package/ios/RMFPolyline.h +38 -38
- package/ios/RMFPolyline.m +101 -101
- package/ios/RMFPolylineManager.h +18 -18
- package/ios/RMFPolylineManager.m +139 -139
- package/ios/RMFPolylineMap4d.h +22 -22
- package/ios/RMFPolylineMap4d.m +15 -15
- package/ios/building/RMFBuilding.h +41 -41
- package/ios/building/RMFBuilding.m +104 -104
- package/ios/building/RMFBuildingManager.h +19 -19
- package/ios/building/RMFBuildingManager.m +133 -133
- package/ios/building/RMFBuildingMap4d.h +23 -23
- package/ios/building/RMFBuildingMap4d.m +15 -15
- package/ios/overlays/RMFTileOverlay.h +36 -36
- package/ios/overlays/RMFTileOverlay.m +64 -64
- package/ios/overlays/RMFTileOverlayManager.h +17 -17
- package/ios/overlays/RMFTileOverlayManager.m +27 -27
- package/lib/commonjs/components/MFBuilding.js +26 -26
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +20 -20
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +133 -71
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +35 -35
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +20 -20
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +22 -22
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +18 -18
- package/lib/commonjs/components/MFPolyline.js.map +1 -1
- package/lib/commonjs/components/MFTileOverlay.js +9 -9
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
- package/lib/commonjs/components/Map4dMapView.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocuser.js +311 -0
- package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/MFBuilding.js +26 -26
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +20 -20
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +32 -32
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +131 -71
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +35 -35
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +20 -20
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +22 -22
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +18 -18
- package/lib/module/components/MFPolyline.js.map +1 -1
- package/lib/module/components/MFTileOverlay.js +9 -9
- package/lib/module/components/MFTileOverlay.js.map +1 -1
- package/lib/module/components/Map4dMapView.js.map +1 -1
- package/lib/module/components/extends/AreaFocuser.js +302 -0
- package/lib/module/components/extends/AreaFocuser.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Map4dMapView.d.ts +7 -7
- package/package.json +152 -152
- package/react-native-map4d-map.podspec +20 -20
- package/src/components/MFBuilding.js +187 -187
- package/src/components/MFCircle.js +173 -173
- package/src/components/MFDirectionsRenderer.js +237 -237
- package/src/components/MFMapView.js +447 -373
- package/src/components/MFMarker.js +246 -246
- package/src/components/MFPOI.js +184 -184
- package/src/components/MFPolygon.js +186 -186
- package/src/components/MFPolyline.js +172 -172
- package/src/components/MFTileOverlay.js +45 -45
- package/src/components/Map4dMapView.tsx +26 -26
- package/src/components/extends/AreaFocuser.js +339 -0
- package/src/index.js +23 -21
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
package com.reactnativemap4dmap;
|
|
2
|
-
|
|
3
|
-
import android.graphics.Color;
|
|
4
|
-
import android.view.View;
|
|
5
|
-
|
|
6
|
-
import androidx.annotation.NonNull;
|
|
7
|
-
|
|
8
|
-
import com.facebook.react.uimanager.SimpleViewManager;
|
|
9
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
11
|
-
|
|
12
|
-
public class Map4dMapViewManager extends SimpleViewManager<View> {
|
|
13
|
-
public static final String REACT_CLASS = "Map4dMapView";
|
|
14
|
-
|
|
15
|
-
@Override
|
|
16
|
-
@NonNull
|
|
17
|
-
public String getName() {
|
|
18
|
-
return REACT_CLASS;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@Override
|
|
22
|
-
@NonNull
|
|
23
|
-
public View createViewInstance(ThemedReactContext reactContext) {
|
|
24
|
-
return new View(reactContext);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@ReactProp(name = "color")
|
|
28
|
-
public void setColor(View view, String color) {
|
|
29
|
-
view.setBackgroundColor(Color.parseColor(color));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
package com.reactnativemap4dmap;
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color;
|
|
4
|
+
import android.view.View;
|
|
5
|
+
|
|
6
|
+
import androidx.annotation.NonNull;
|
|
7
|
+
|
|
8
|
+
import com.facebook.react.uimanager.SimpleViewManager;
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
11
|
+
|
|
12
|
+
public class Map4dMapViewManager extends SimpleViewManager<View> {
|
|
13
|
+
public static final String REACT_CLASS = "Map4dMapView";
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
@NonNull
|
|
17
|
+
public String getName() {
|
|
18
|
+
return REACT_CLASS;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
@NonNull
|
|
23
|
+
public View createViewInstance(ThemedReactContext reactContext) {
|
|
24
|
+
return new View(reactContext);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@ReactProp(name = "color")
|
|
28
|
+
public void setColor(View view, String color) {
|
|
29
|
+
view.setBackgroundColor(Color.parseColor(color));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
package com.reactnativemap4dmap;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
6
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
|
|
8
|
-
import java.util.ArrayList;
|
|
9
|
-
import java.util.List;
|
|
10
|
-
|
|
11
|
-
import vn.map4d.map.annotations.MFBuilding;
|
|
12
|
-
import vn.map4d.map.annotations.MFBuildingOptions;
|
|
13
|
-
import vn.map4d.map.core.Map4D;
|
|
14
|
-
import vn.map4d.types.MFLocationCoordinate;
|
|
15
|
-
|
|
16
|
-
public class RMFBuilding extends RMFFeature {
|
|
17
|
-
|
|
18
|
-
private MFBuilding building;
|
|
19
|
-
|
|
20
|
-
private String name;
|
|
21
|
-
|
|
22
|
-
private MFLocationCoordinate coordinate;
|
|
23
|
-
|
|
24
|
-
private String model;
|
|
25
|
-
|
|
26
|
-
private String texture;
|
|
27
|
-
|
|
28
|
-
private double scale;
|
|
29
|
-
|
|
30
|
-
private double bearing;
|
|
31
|
-
|
|
32
|
-
private float elevation;
|
|
33
|
-
|
|
34
|
-
private boolean selected;
|
|
35
|
-
|
|
36
|
-
private boolean visible;
|
|
37
|
-
|
|
38
|
-
private boolean touchable;
|
|
39
|
-
|
|
40
|
-
private String userData;
|
|
41
|
-
|
|
42
|
-
public RMFBuilding(Context context) {
|
|
43
|
-
super(context);
|
|
44
|
-
name = "";
|
|
45
|
-
model = "";
|
|
46
|
-
texture = "";
|
|
47
|
-
coordinate = new MFLocationCoordinate(0, 0);
|
|
48
|
-
scale = 1.0;
|
|
49
|
-
bearing = 0.0;
|
|
50
|
-
elevation = 0.f;
|
|
51
|
-
selected = false;
|
|
52
|
-
visible = true;
|
|
53
|
-
touchable = true;
|
|
54
|
-
userData = null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public void setName(String name) {
|
|
58
|
-
this.name = name;
|
|
59
|
-
if (building != null) {
|
|
60
|
-
building.setName(this.name);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public void setCoordinate(ReadableMap data) {
|
|
65
|
-
this.coordinate = new MFLocationCoordinate(data.getDouble("latitude"), data.getDouble("longitude"));
|
|
66
|
-
if (building != null) {
|
|
67
|
-
building.setLocation(this.coordinate);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public void setModelUrl(String url) {
|
|
72
|
-
this.model = url;
|
|
73
|
-
if (building != null) {
|
|
74
|
-
building.setModel(this.model);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public void setTextureUrl(String url) {
|
|
79
|
-
this.texture = url;
|
|
80
|
-
if (building != null) {
|
|
81
|
-
building.setTexture(this.texture);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public void setScale(double scale) {
|
|
86
|
-
this.scale = scale;
|
|
87
|
-
if (building != null) {
|
|
88
|
-
building.setScale(this.scale);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public void setBearing(double bearing) {
|
|
93
|
-
this.bearing = bearing;
|
|
94
|
-
if (building != null) {
|
|
95
|
-
building.setBearing(this.bearing);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public void setElevation(float elevation) {
|
|
100
|
-
this.elevation = elevation;
|
|
101
|
-
if (building != null) {
|
|
102
|
-
building.setElevation(this.elevation);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public void setSelected(boolean selected) {
|
|
107
|
-
this.selected = selected;
|
|
108
|
-
if (building != null) {
|
|
109
|
-
building.setSelected(this.selected);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public void setVisible(boolean visible) {
|
|
114
|
-
this.visible = visible;
|
|
115
|
-
if (building != null) {
|
|
116
|
-
building.setVisible(this.visible);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
public void setTouchable(boolean touchable) {
|
|
121
|
-
this.touchable = touchable;
|
|
122
|
-
if (building != null) {
|
|
123
|
-
building.setTouchable(this.touchable);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public void setUserData(ReadableMap userData) {
|
|
128
|
-
this.userData = userData.toString();
|
|
129
|
-
if (building != null) {
|
|
130
|
-
building.setUserData(this.userData);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@Override
|
|
135
|
-
public void addToMap(Map4D map) {
|
|
136
|
-
this.building = map.addBuilding(getOptions());
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@Override
|
|
140
|
-
public void removeFromMap(Map4D map) {
|
|
141
|
-
if (building == null) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
building.remove();
|
|
145
|
-
building = null;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
@Override
|
|
149
|
-
public Object getFeature() {
|
|
150
|
-
return building;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
public MFBuildingOptions getOptions() {
|
|
154
|
-
MFBuildingOptions options = new MFBuildingOptions();
|
|
155
|
-
options.name(name);
|
|
156
|
-
options.location(coordinate);
|
|
157
|
-
options.model(model);
|
|
158
|
-
options.texture(texture);
|
|
159
|
-
options.scale(scale);
|
|
160
|
-
options.bearing(bearing);
|
|
161
|
-
options.elevation(elevation);
|
|
162
|
-
options.visible(visible);
|
|
163
|
-
options.touchable(touchable);
|
|
164
|
-
options.userData(userData);
|
|
165
|
-
return options;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
1
|
+
package com.reactnativemap4dmap;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
|
|
8
|
+
import java.util.ArrayList;
|
|
9
|
+
import java.util.List;
|
|
10
|
+
|
|
11
|
+
import vn.map4d.map.annotations.MFBuilding;
|
|
12
|
+
import vn.map4d.map.annotations.MFBuildingOptions;
|
|
13
|
+
import vn.map4d.map.core.Map4D;
|
|
14
|
+
import vn.map4d.types.MFLocationCoordinate;
|
|
15
|
+
|
|
16
|
+
public class RMFBuilding extends RMFFeature {
|
|
17
|
+
|
|
18
|
+
private MFBuilding building;
|
|
19
|
+
|
|
20
|
+
private String name;
|
|
21
|
+
|
|
22
|
+
private MFLocationCoordinate coordinate;
|
|
23
|
+
|
|
24
|
+
private String model;
|
|
25
|
+
|
|
26
|
+
private String texture;
|
|
27
|
+
|
|
28
|
+
private double scale;
|
|
29
|
+
|
|
30
|
+
private double bearing;
|
|
31
|
+
|
|
32
|
+
private float elevation;
|
|
33
|
+
|
|
34
|
+
private boolean selected;
|
|
35
|
+
|
|
36
|
+
private boolean visible;
|
|
37
|
+
|
|
38
|
+
private boolean touchable;
|
|
39
|
+
|
|
40
|
+
private String userData;
|
|
41
|
+
|
|
42
|
+
public RMFBuilding(Context context) {
|
|
43
|
+
super(context);
|
|
44
|
+
name = "";
|
|
45
|
+
model = "";
|
|
46
|
+
texture = "";
|
|
47
|
+
coordinate = new MFLocationCoordinate(0, 0);
|
|
48
|
+
scale = 1.0;
|
|
49
|
+
bearing = 0.0;
|
|
50
|
+
elevation = 0.f;
|
|
51
|
+
selected = false;
|
|
52
|
+
visible = true;
|
|
53
|
+
touchable = true;
|
|
54
|
+
userData = null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public void setName(String name) {
|
|
58
|
+
this.name = name;
|
|
59
|
+
if (building != null) {
|
|
60
|
+
building.setName(this.name);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public void setCoordinate(ReadableMap data) {
|
|
65
|
+
this.coordinate = new MFLocationCoordinate(data.getDouble("latitude"), data.getDouble("longitude"));
|
|
66
|
+
if (building != null) {
|
|
67
|
+
building.setLocation(this.coordinate);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public void setModelUrl(String url) {
|
|
72
|
+
this.model = url;
|
|
73
|
+
if (building != null) {
|
|
74
|
+
building.setModel(this.model);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public void setTextureUrl(String url) {
|
|
79
|
+
this.texture = url;
|
|
80
|
+
if (building != null) {
|
|
81
|
+
building.setTexture(this.texture);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void setScale(double scale) {
|
|
86
|
+
this.scale = scale;
|
|
87
|
+
if (building != null) {
|
|
88
|
+
building.setScale(this.scale);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public void setBearing(double bearing) {
|
|
93
|
+
this.bearing = bearing;
|
|
94
|
+
if (building != null) {
|
|
95
|
+
building.setBearing(this.bearing);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public void setElevation(float elevation) {
|
|
100
|
+
this.elevation = elevation;
|
|
101
|
+
if (building != null) {
|
|
102
|
+
building.setElevation(this.elevation);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public void setSelected(boolean selected) {
|
|
107
|
+
this.selected = selected;
|
|
108
|
+
if (building != null) {
|
|
109
|
+
building.setSelected(this.selected);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public void setVisible(boolean visible) {
|
|
114
|
+
this.visible = visible;
|
|
115
|
+
if (building != null) {
|
|
116
|
+
building.setVisible(this.visible);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public void setTouchable(boolean touchable) {
|
|
121
|
+
this.touchable = touchable;
|
|
122
|
+
if (building != null) {
|
|
123
|
+
building.setTouchable(this.touchable);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public void setUserData(ReadableMap userData) {
|
|
128
|
+
this.userData = userData.toString();
|
|
129
|
+
if (building != null) {
|
|
130
|
+
building.setUserData(this.userData);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@Override
|
|
135
|
+
public void addToMap(Map4D map) {
|
|
136
|
+
this.building = map.addBuilding(getOptions());
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@Override
|
|
140
|
+
public void removeFromMap(Map4D map) {
|
|
141
|
+
if (building == null) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
building.remove();
|
|
145
|
+
building = null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@Override
|
|
149
|
+
public Object getFeature() {
|
|
150
|
+
return building;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public MFBuildingOptions getOptions() {
|
|
154
|
+
MFBuildingOptions options = new MFBuildingOptions();
|
|
155
|
+
options.name(name);
|
|
156
|
+
options.location(coordinate);
|
|
157
|
+
options.model(model);
|
|
158
|
+
options.texture(texture);
|
|
159
|
+
options.scale(scale);
|
|
160
|
+
options.bearing(bearing);
|
|
161
|
+
options.elevation(elevation);
|
|
162
|
+
options.visible(visible);
|
|
163
|
+
options.touchable(touchable);
|
|
164
|
+
options.userData(userData);
|
|
165
|
+
return options;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
package com.reactnativemap4dmap;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
import androidx.annotation.Nullable;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
8
|
-
import com.facebook.react.common.MapBuilder;
|
|
9
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
-
import com.facebook.react.uimanager.ViewGroupManager;
|
|
11
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
12
|
-
|
|
13
|
-
import java.util.Map;
|
|
14
|
-
|
|
15
|
-
public class RMFBuildingManager extends ViewGroupManager<RMFBuilding> {
|
|
16
|
-
|
|
17
|
-
@NonNull
|
|
18
|
-
@Override
|
|
19
|
-
public String getName() {
|
|
20
|
-
return "RMFBuilding";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@NonNull
|
|
24
|
-
@Override
|
|
25
|
-
protected RMFBuilding createViewInstance(@NonNull ThemedReactContext reactContext) {
|
|
26
|
-
return new RMFBuilding(reactContext);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@Override
|
|
30
|
-
public void receiveCommand(@NonNull RMFBuilding view, String commandId, @Nullable ReadableArray args) {
|
|
31
|
-
ReadableMap data;
|
|
32
|
-
switch (commandId) {
|
|
33
|
-
case "setName":
|
|
34
|
-
view.setName(args.getString(0));
|
|
35
|
-
break;
|
|
36
|
-
case "setScale":
|
|
37
|
-
view.setScale(args.getDouble(0));
|
|
38
|
-
break;
|
|
39
|
-
case "setBearing":
|
|
40
|
-
view.setBearing(args.getDouble(0));
|
|
41
|
-
break;
|
|
42
|
-
case "setElevation":
|
|
43
|
-
view.setElevation((float) args.getDouble(0));
|
|
44
|
-
break;
|
|
45
|
-
case "setSelected":
|
|
46
|
-
view.setSelected(args.getBoolean(0));
|
|
47
|
-
break;
|
|
48
|
-
case "setVisible":
|
|
49
|
-
view.setVisible(args.getBoolean(0));
|
|
50
|
-
break;
|
|
51
|
-
case "setTouchable":
|
|
52
|
-
view.setTouchable(args.getBoolean(0));
|
|
53
|
-
break;
|
|
54
|
-
case "setUserData":
|
|
55
|
-
data = args.getMap(0);
|
|
56
|
-
view.setUserData(data);
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@Override
|
|
62
|
-
public Map getExportedCustomDirectEventTypeConstants() {
|
|
63
|
-
final Map<String, Map<String, String>> map = MapBuilder.of("onPress", MapBuilder.of("registrationName", "onPress"));
|
|
64
|
-
return map;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@ReactProp(name = "name")
|
|
68
|
-
public void setName(final RMFBuilding view, final String name) {
|
|
69
|
-
view.setName(name);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@ReactProp(name = "coordinate")
|
|
73
|
-
public void setCoordinate(final RMFBuilding view, final ReadableMap map) {
|
|
74
|
-
view.setCoordinate(map);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@ReactProp(name = "modelUrl")
|
|
78
|
-
public void setModelUrl(final RMFBuilding view, final String url) {
|
|
79
|
-
view.setModelUrl(url);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@ReactProp(name = "textureUrl")
|
|
83
|
-
public void setTextureUrl(final RMFBuilding view, final String url) {
|
|
84
|
-
view.setTextureUrl(url);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@ReactProp(name = "scale")
|
|
88
|
-
public void setScale(final RMFBuilding view, final double scale) {
|
|
89
|
-
view.setScale(scale);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@ReactProp(name = "bearing")
|
|
93
|
-
public void setBearing(final RMFBuilding view, final double bearing) {
|
|
94
|
-
view.setBearing(bearing);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@ReactProp(name = "elevation")
|
|
98
|
-
public void setElevation(final RMFBuilding view, final float elevation) {
|
|
99
|
-
view.setElevation(elevation);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@ReactProp(name = "selected")
|
|
103
|
-
public void setSelected(final RMFBuilding view, final boolean selected) {
|
|
104
|
-
view.setSelected(selected);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@ReactProp(name = "visible")
|
|
108
|
-
public void setVisible(final RMFBuilding view, final boolean visible) {
|
|
109
|
-
view.setVisible(visible);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@ReactProp(name = "touchable")
|
|
113
|
-
public void setTouchable(final RMFBuilding view, final boolean touchable) {
|
|
114
|
-
view.setTouchable(touchable);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@ReactProp(name = "userData")
|
|
118
|
-
public void setUserData(final RMFBuilding view, final ReadableMap userData) {
|
|
119
|
-
view.setUserData(userData);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
1
|
+
package com.reactnativemap4dmap;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
8
|
+
import com.facebook.react.common.MapBuilder;
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
+
import com.facebook.react.uimanager.ViewGroupManager;
|
|
11
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
12
|
+
|
|
13
|
+
import java.util.Map;
|
|
14
|
+
|
|
15
|
+
public class RMFBuildingManager extends ViewGroupManager<RMFBuilding> {
|
|
16
|
+
|
|
17
|
+
@NonNull
|
|
18
|
+
@Override
|
|
19
|
+
public String getName() {
|
|
20
|
+
return "RMFBuilding";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@NonNull
|
|
24
|
+
@Override
|
|
25
|
+
protected RMFBuilding createViewInstance(@NonNull ThemedReactContext reactContext) {
|
|
26
|
+
return new RMFBuilding(reactContext);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void receiveCommand(@NonNull RMFBuilding view, String commandId, @Nullable ReadableArray args) {
|
|
31
|
+
ReadableMap data;
|
|
32
|
+
switch (commandId) {
|
|
33
|
+
case "setName":
|
|
34
|
+
view.setName(args.getString(0));
|
|
35
|
+
break;
|
|
36
|
+
case "setScale":
|
|
37
|
+
view.setScale(args.getDouble(0));
|
|
38
|
+
break;
|
|
39
|
+
case "setBearing":
|
|
40
|
+
view.setBearing(args.getDouble(0));
|
|
41
|
+
break;
|
|
42
|
+
case "setElevation":
|
|
43
|
+
view.setElevation((float) args.getDouble(0));
|
|
44
|
+
break;
|
|
45
|
+
case "setSelected":
|
|
46
|
+
view.setSelected(args.getBoolean(0));
|
|
47
|
+
break;
|
|
48
|
+
case "setVisible":
|
|
49
|
+
view.setVisible(args.getBoolean(0));
|
|
50
|
+
break;
|
|
51
|
+
case "setTouchable":
|
|
52
|
+
view.setTouchable(args.getBoolean(0));
|
|
53
|
+
break;
|
|
54
|
+
case "setUserData":
|
|
55
|
+
data = args.getMap(0);
|
|
56
|
+
view.setUserData(data);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Override
|
|
62
|
+
public Map getExportedCustomDirectEventTypeConstants() {
|
|
63
|
+
final Map<String, Map<String, String>> map = MapBuilder.of("onPress", MapBuilder.of("registrationName", "onPress"));
|
|
64
|
+
return map;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@ReactProp(name = "name")
|
|
68
|
+
public void setName(final RMFBuilding view, final String name) {
|
|
69
|
+
view.setName(name);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@ReactProp(name = "coordinate")
|
|
73
|
+
public void setCoordinate(final RMFBuilding view, final ReadableMap map) {
|
|
74
|
+
view.setCoordinate(map);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@ReactProp(name = "modelUrl")
|
|
78
|
+
public void setModelUrl(final RMFBuilding view, final String url) {
|
|
79
|
+
view.setModelUrl(url);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@ReactProp(name = "textureUrl")
|
|
83
|
+
public void setTextureUrl(final RMFBuilding view, final String url) {
|
|
84
|
+
view.setTextureUrl(url);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@ReactProp(name = "scale")
|
|
88
|
+
public void setScale(final RMFBuilding view, final double scale) {
|
|
89
|
+
view.setScale(scale);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@ReactProp(name = "bearing")
|
|
93
|
+
public void setBearing(final RMFBuilding view, final double bearing) {
|
|
94
|
+
view.setBearing(bearing);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@ReactProp(name = "elevation")
|
|
98
|
+
public void setElevation(final RMFBuilding view, final float elevation) {
|
|
99
|
+
view.setElevation(elevation);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@ReactProp(name = "selected")
|
|
103
|
+
public void setSelected(final RMFBuilding view, final boolean selected) {
|
|
104
|
+
view.setSelected(selected);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@ReactProp(name = "visible")
|
|
108
|
+
public void setVisible(final RMFBuilding view, final boolean visible) {
|
|
109
|
+
view.setVisible(visible);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@ReactProp(name = "touchable")
|
|
113
|
+
public void setTouchable(final RMFBuilding view, final boolean touchable) {
|
|
114
|
+
view.setTouchable(touchable);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@ReactProp(name = "userData")
|
|
118
|
+
public void setUserData(final RMFBuilding view, final ReadableMap userData) {
|
|
119
|
+
view.setUserData(userData);
|
|
120
|
+
}
|
|
121
|
+
}
|