@evnydd0sf/react-native-amap3d-fix 3.2.4-fix.1 → 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,142 +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
- 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
- }
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
+ }
153
153
  }
package/license CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 7c00 <i@7c00.cc>
3
+ Copyright (c) 2025 evnydd0sf <me@evnydd0sf.club>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evnydd0sf/react-native-amap3d-fix",
3
- "version": "3.2.4-fix.1",
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",