@evnydd0sf/react-native-amap3d-fix 3.2.4-fix.2 → 3.2.4-fix.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,5 +30,5 @@ android {
30
30
  dependencies {
31
31
  compileOnly 'com.facebook.react:react-native:+'
32
32
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
33
- implementation 'com.amap.api:3dmap:9.6.0'
33
+ implementation 'com.amap.api:3dmap:10.0.600'
34
34
  }
@@ -12,143 +12,142 @@ import qiuxiang.amap3d.toLatLng
12
12
 
13
13
  @Suppress("unused")
14
14
  internal class MapViewManager : ViewGroupManager<MapView>() {
15
- private val commands = mapOf(
16
- "moveCamera" to { view: MapView, args: ReadableArray? -> view.moveCamera(args) },
17
- "call" to { view: MapView, args: ReadableArray? -> view.call(args) },
18
- )
19
-
20
- override fun getName(): String {
21
- return "AMapView"
22
- }
23
-
24
- override fun createViewInstance(reactContext: ThemedReactContext): MapView {
25
- return MapView(reactContext)
26
- }
27
-
28
- override fun onDropViewInstance(view: MapView) {
29
- super.onDropViewInstance(view)
30
- // Fix Unmount View Crash
31
- // view.onDestroy()
32
- }
33
-
34
- override fun getCommandsMap(): Map<String, Int> {
35
- return commands.keys.mapIndexed { index, key -> key to index }.toMap()
36
- }
37
-
38
- override fun receiveCommand(view: MapView, command: Int, args: ReadableArray?) {
39
- commands.values.toList()[command](view, args)
40
- }
41
-
42
- override fun addView(mapView: MapView, child: View, index: Int) {
43
- mapView.add(child)
44
- super.addView(mapView, child, index)
45
- }
46
-
47
- override fun removeViewAt(parent: MapView, index: Int) {
48
- parent.remove(parent.getChildAt(index))
49
- super.removeViewAt(parent, index)
50
- }
51
-
52
- override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
53
- return getEventTypeConstants(
54
- "onLoad",
55
- "onPress",
56
- "onPressPoi",
57
- "onLongPress",
58
- "onCameraMove",
59
- "onCameraIdle",
60
- "onLocation",
61
- "onCallback",
62
- )
63
- }
64
-
65
- @ReactProp(name = "initialCameraPosition")
66
- fun setInitialCameraPosition(view: MapView, position: ReadableMap) {
67
- view.setInitialCameraPosition(position)
68
- }
69
-
70
- @ReactProp(name = "myLocationEnabled")
71
- fun setMyLocationEnabled(view: MapView, enabled: Boolean) {
72
- view.map.isMyLocationEnabled = enabled
73
- }
74
-
75
- @ReactProp(name = "indoorViewEnabled")
76
- fun setIndoorViewEnabled(view: MapView, enabled: Boolean) {
77
- view.map.showIndoorMap(enabled)
78
- }
79
-
80
- @ReactProp(name = "buildingsEnabled")
81
- fun setBuildingsEnabled(view: MapView, enabled: Boolean) {
82
- view.map.showBuildings(enabled)
83
- }
84
-
85
- @ReactProp(name = "compassEnabled")
86
- fun setCompassEnabled(view: MapView, show: Boolean) {
87
- view.map.uiSettings.isCompassEnabled = show
88
- }
89
-
90
- @ReactProp(name = "zoomControlsEnabled")
91
- fun setZoomControlsEnabled(view: MapView, enabled: Boolean) {
92
- view.map.uiSettings.isZoomControlsEnabled = enabled
93
- }
94
-
95
- @ReactProp(name = "scaleControlsEnabled")
96
- fun setScaleControlsEnabled(view: MapView, enabled: Boolean) {
97
- view.map.uiSettings.isScaleControlsEnabled = enabled
98
- }
99
-
100
- @ReactProp(name = "language")
101
- fun setLanguage(view: MapView, language: String) {
102
- view.map.setMapLanguage(language)
103
- }
104
-
105
- @ReactProp(name = "myLocationButtonEnabled")
106
- fun setMyLocationButtonEnabled(view: MapView, enabled: Boolean) {
107
- view.map.uiSettings.isMyLocationButtonEnabled = enabled
108
- }
109
-
110
- @ReactProp(name = "trafficEnabled")
111
- fun setTrafficEnabled(view: MapView, enabled: Boolean) {
112
- view.map.isTrafficEnabled = enabled
113
- }
114
-
115
- @ReactProp(name = "maxZoom")
116
- fun setMaxZoom(view: MapView, zoomLevel: Float) {
117
- view.map.maxZoomLevel = zoomLevel
118
- }
119
-
120
- @ReactProp(name = "minZoom")
121
- fun setMinZoom(view: MapView, zoomLevel: Float) {
122
- view.map.minZoomLevel = zoomLevel
123
- }
124
-
125
- @ReactProp(name = "mapType")
126
- fun setMapType(view: MapView, mapType: Int) {
127
- view.map.mapType = mapType + 1
128
- }
129
-
130
- @ReactProp(name = "zoomGesturesEnabled")
131
- fun setZoomGesturesEnabled(view: MapView, enabled: Boolean) {
132
- view.map.uiSettings.isZoomGesturesEnabled = enabled
133
- }
134
-
135
- @ReactProp(name = "scrollGesturesEnabled")
136
- fun setScrollGesturesEnabled(view: MapView, enabled: Boolean) {
137
- view.map.uiSettings.isScrollGesturesEnabled = enabled
138
- }
139
-
140
- @ReactProp(name = "rotateGesturesEnabled")
141
- fun setRotateGesturesEnabled(view: MapView, enabled: Boolean) {
142
- view.map.uiSettings.isRotateGesturesEnabled = enabled
143
- }
144
-
145
- @ReactProp(name = "tiltGesturesEnabled")
146
- fun setTiltGesturesEnabled(view: MapView, enabled: Boolean) {
147
- view.map.uiSettings.isTiltGesturesEnabled = enabled
148
- }
149
-
150
- @ReactProp(name = "cameraPosition")
151
- fun setCameraPosition(view: MapView, center: ReadableMap) {
152
- view.map.moveCamera(CameraUpdateFactory.changeLatLng(center.toLatLng()))
153
- }
15
+ private val commands = mapOf(
16
+ "moveCamera" to { view: MapView, args: ReadableArray? -> view.moveCamera(args) },
17
+ "call" to { view: MapView, args: ReadableArray? -> view.call(args) },
18
+ )
19
+
20
+ override fun getName(): String {
21
+ return "AMapView"
22
+ }
23
+
24
+ override fun createViewInstance(reactContext: ThemedReactContext): MapView {
25
+ return MapView(reactContext)
26
+ }
27
+
28
+ override fun onDropViewInstance(view: MapView) {
29
+ super.onDropViewInstance(view)
30
+ view.onDestroy()
31
+ }
32
+
33
+ override fun getCommandsMap(): Map<String, Int> {
34
+ return commands.keys.mapIndexed { index, key -> key to index }.toMap()
35
+ }
36
+
37
+ override fun receiveCommand(view: MapView, command: Int, args: ReadableArray?) {
38
+ commands.values.toList()[command](view, args)
39
+ }
40
+
41
+ override fun addView(mapView: MapView, child: View, index: Int) {
42
+ mapView.add(child)
43
+ super.addView(mapView, child, index)
44
+ }
45
+
46
+ override fun removeViewAt(parent: MapView, index: Int) {
47
+ parent.remove(parent.getChildAt(index))
48
+ super.removeViewAt(parent, index)
49
+ }
50
+
51
+ override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
52
+ return getEventTypeConstants(
53
+ "onLoad",
54
+ "onPress",
55
+ "onPressPoi",
56
+ "onLongPress",
57
+ "onCameraMove",
58
+ "onCameraIdle",
59
+ "onLocation",
60
+ "onCallback",
61
+ )
62
+ }
63
+
64
+ @ReactProp(name = "initialCameraPosition")
65
+ fun setInitialCameraPosition(view: MapView, position: ReadableMap) {
66
+ view.setInitialCameraPosition(position)
67
+ }
68
+
69
+ @ReactProp(name = "myLocationEnabled")
70
+ fun setMyLocationEnabled(view: MapView, enabled: Boolean) {
71
+ view.map.isMyLocationEnabled = enabled
72
+ }
73
+
74
+ @ReactProp(name = "indoorViewEnabled")
75
+ fun setIndoorViewEnabled(view: MapView, enabled: Boolean) {
76
+ view.map.showIndoorMap(enabled)
77
+ }
78
+
79
+ @ReactProp(name = "buildingsEnabled")
80
+ fun setBuildingsEnabled(view: MapView, enabled: Boolean) {
81
+ view.map.showBuildings(enabled)
82
+ }
83
+
84
+ @ReactProp(name = "compassEnabled")
85
+ fun setCompassEnabled(view: MapView, show: Boolean) {
86
+ view.map.uiSettings.isCompassEnabled = show
87
+ }
88
+
89
+ @ReactProp(name = "zoomControlsEnabled")
90
+ fun setZoomControlsEnabled(view: MapView, enabled: Boolean) {
91
+ view.map.uiSettings.isZoomControlsEnabled = enabled
92
+ }
93
+
94
+ @ReactProp(name = "scaleControlsEnabled")
95
+ fun setScaleControlsEnabled(view: MapView, enabled: Boolean) {
96
+ view.map.uiSettings.isScaleControlsEnabled = enabled
97
+ }
98
+
99
+ @ReactProp(name = "language")
100
+ fun setLanguage(view: MapView, language: String) {
101
+ view.map.setMapLanguage(language)
102
+ }
103
+
104
+ @ReactProp(name = "myLocationButtonEnabled")
105
+ fun setMyLocationButtonEnabled(view: MapView, enabled: Boolean) {
106
+ view.map.uiSettings.isMyLocationButtonEnabled = enabled
107
+ }
108
+
109
+ @ReactProp(name = "trafficEnabled")
110
+ fun setTrafficEnabled(view: MapView, enabled: Boolean) {
111
+ view.map.isTrafficEnabled = enabled
112
+ }
113
+
114
+ @ReactProp(name = "maxZoom")
115
+ fun setMaxZoom(view: MapView, zoomLevel: Float) {
116
+ view.map.maxZoomLevel = zoomLevel
117
+ }
118
+
119
+ @ReactProp(name = "minZoom")
120
+ fun setMinZoom(view: MapView, zoomLevel: Float) {
121
+ view.map.minZoomLevel = zoomLevel
122
+ }
123
+
124
+ @ReactProp(name = "mapType")
125
+ fun setMapType(view: MapView, mapType: Int) {
126
+ view.map.mapType = mapType + 1
127
+ }
128
+
129
+ @ReactProp(name = "zoomGesturesEnabled")
130
+ fun setZoomGesturesEnabled(view: MapView, enabled: Boolean) {
131
+ view.map.uiSettings.isZoomGesturesEnabled = enabled
132
+ }
133
+
134
+ @ReactProp(name = "scrollGesturesEnabled")
135
+ fun setScrollGesturesEnabled(view: MapView, enabled: Boolean) {
136
+ view.map.uiSettings.isScrollGesturesEnabled = enabled
137
+ }
138
+
139
+ @ReactProp(name = "rotateGesturesEnabled")
140
+ fun setRotateGesturesEnabled(view: MapView, enabled: Boolean) {
141
+ view.map.uiSettings.isRotateGesturesEnabled = enabled
142
+ }
143
+
144
+ @ReactProp(name = "tiltGesturesEnabled")
145
+ fun setTiltGesturesEnabled(view: MapView, enabled: Boolean) {
146
+ view.map.uiSettings.isTiltGesturesEnabled = enabled
147
+ }
148
+
149
+ @ReactProp(name = "cameraPosition")
150
+ fun setCameraPosition(view: MapView, center: ReadableMap) {
151
+ view.map.moveCamera(CameraUpdateFactory.changeLatLng(center.toLatLng()))
152
+ }
154
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evnydd0sf/react-native-amap3d-fix",
3
- "version": "3.2.4-fix.2",
3
+ "version": "3.2.4-fix.3",
4
4
  "description": "react-native 高德地图组件,支持 Android + iOS (Fork with compilation fix)",
5
5
  "author": "evnydd0sf <me@evnydd0sf.club>",
6
6
  "license": "MIT",