expo-maps 0.7.1 → 0.7.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.
- package/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/maps/CustomLocationSource.kt +21 -0
- package/android/src/main/java/expo/modules/maps/GoogleMapsModule.kt +19 -0
- package/android/src/main/java/expo/modules/maps/GoogleMapsView.kt +88 -16
- package/android/src/main/java/expo/modules/maps/MapsModule.kt +10 -3
- package/android/src/main/java/expo/modules/maps/Records.kt +24 -0
- package/build/ExpoMaps.d.ts +4 -0
- package/build/ExpoMaps.d.ts.map +1 -0
- package/build/ExpoMaps.js +3 -0
- package/build/ExpoMaps.js.map +1 -0
- package/build/apple/AppleMaps.types.d.ts +14 -0
- package/build/apple/AppleMaps.types.d.ts.map +1 -1
- package/build/apple/AppleMaps.types.js.map +1 -1
- package/build/apple/AppleMapsView.d.ts +5 -2
- package/build/apple/AppleMapsView.d.ts.map +1 -1
- package/build/apple/AppleMapsView.js +13 -3
- package/build/apple/AppleMapsView.js.map +1 -1
- package/build/google/GoogleMaps.types.d.ts +30 -0
- package/build/google/GoogleMaps.types.d.ts.map +1 -1
- package/build/google/GoogleMaps.types.js.map +1 -1
- package/build/google/GoogleMapsView.d.ts +2 -2
- package/build/google/GoogleMapsView.d.ts.map +1 -1
- package/build/google/GoogleMapsView.js +9 -3
- package/build/google/GoogleMapsView.js.map +1 -1
- package/build/index.d.ts +16 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +19 -2
- package/build/index.js.map +1 -1
- package/build/shared.types.d.ts +13 -0
- package/build/shared.types.d.ts.map +1 -1
- package/build/shared.types.js.map +1 -1
- package/expo-module.config.json +6 -2
- package/ios/AppleMapsModule.swift +22 -0
- package/ios/AppleMapsView.swift +47 -9
- package/ios/AppleMapsViewState.swift +11 -0
- package/ios/MapPermissionRequester.swift +81 -0
- package/ios/MapsModule.swift +26 -6
- package/package.json +3 -3
- package/plugin/build/withMapsLocation.d.ts +6 -0
- package/plugin/build/withMapsLocation.js +21 -0
- package/plugin/src/withMapsLocation.ts +28 -0
- package/plugin/tsconfig.json +9 -0
- package/src/ExpoMaps.ts +5 -0
- package/src/apple/AppleMaps.types.ts +15 -0
- package/src/apple/AppleMapsView.tsx +38 -29
- package/src/google/GoogleMaps.types.ts +35 -0
- package/src/google/GoogleMapsView.tsx +54 -41
- package/src/index.ts +26 -2
- package/src/shared.types.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.7.3 — 2025-02-14
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- [iOS] Implement setCameraPosition ([#34886](https://github.com/expo/expo/pull/34886) by [@jakex7](https://github.com/jakex7))
|
|
18
|
+
|
|
19
|
+
## 0.7.2 — 2025-02-10
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
13
23
|
## 0.7.1 — 2025-02-06
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -37,13 +37,13 @@ if (KOTLIN_MAJOR_VERSION >= 2) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
group = 'host.exp.exponent'
|
|
40
|
-
version = '0.7.
|
|
40
|
+
version = '0.7.3'
|
|
41
41
|
|
|
42
42
|
android {
|
|
43
43
|
namespace "expo.modules.maps"
|
|
44
44
|
defaultConfig {
|
|
45
45
|
versionCode 1
|
|
46
|
-
versionName "0.7.
|
|
46
|
+
versionName "0.7.3"
|
|
47
47
|
}
|
|
48
48
|
buildFeatures {
|
|
49
49
|
compose true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package expo.modules.maps
|
|
2
|
+
|
|
3
|
+
import android.location.Location
|
|
4
|
+
import com.google.android.gms.maps.LocationSource
|
|
5
|
+
import com.google.android.gms.maps.LocationSource.OnLocationChangedListener
|
|
6
|
+
|
|
7
|
+
class CustomLocationSource : LocationSource {
|
|
8
|
+
private var listener: OnLocationChangedListener? = null
|
|
9
|
+
|
|
10
|
+
override fun activate(listener: OnLocationChangedListener) {
|
|
11
|
+
this.listener = listener
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
override fun deactivate() {
|
|
15
|
+
listener = null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
fun onLocationChanged(location: Location) {
|
|
19
|
+
listener?.onLocationChanged(location)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package expo.modules.maps
|
|
2
|
+
|
|
3
|
+
import expo.modules.kotlin.functions.Coroutine
|
|
4
|
+
import expo.modules.kotlin.modules.Module
|
|
5
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
6
|
+
|
|
7
|
+
class GoogleMapsModule : Module() {
|
|
8
|
+
override fun definition() = ModuleDefinition {
|
|
9
|
+
Name("ExpoGoogleMaps")
|
|
10
|
+
|
|
11
|
+
View(GoogleMapsView::class) {
|
|
12
|
+
Events("onMapLoaded", "onMapClick", "onMapLongClick", "onPOIClick", "onMarkerClick", "onCameraMove")
|
|
13
|
+
|
|
14
|
+
AsyncFunction("setCameraPosition") Coroutine { view: GoogleMapsView, config: SetCameraPositionConfig? ->
|
|
15
|
+
view.setCameraPosition(config)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
package expo.modules.maps
|
|
4
4
|
|
|
5
|
+
import android.annotation.SuppressLint
|
|
5
6
|
import android.content.Context
|
|
6
7
|
import android.graphics.Bitmap
|
|
7
8
|
import android.graphics.drawable.BitmapDrawable
|
|
@@ -10,14 +11,17 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|
|
10
11
|
import androidx.compose.runtime.Composable
|
|
11
12
|
import androidx.compose.runtime.LaunchedEffect
|
|
12
13
|
import androidx.compose.runtime.MutableState
|
|
13
|
-
import androidx.compose.runtime.State
|
|
14
14
|
import androidx.compose.runtime.derivedStateOf
|
|
15
15
|
import androidx.compose.runtime.mutableStateOf
|
|
16
16
|
import androidx.compose.runtime.remember
|
|
17
17
|
import androidx.compose.ui.Modifier
|
|
18
|
+
import com.google.android.gms.maps.CameraUpdateFactory
|
|
19
|
+
import com.google.android.gms.maps.LocationSource
|
|
18
20
|
import com.google.android.gms.maps.model.BitmapDescriptor
|
|
19
21
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory
|
|
20
22
|
import com.google.android.gms.maps.model.CameraPosition
|
|
23
|
+
import com.google.android.gms.maps.model.LatLng
|
|
24
|
+
import com.google.maps.android.compose.CameraMoveStartedReason
|
|
21
25
|
import com.google.maps.android.compose.CameraPositionState
|
|
22
26
|
import com.google.maps.android.compose.GoogleMap
|
|
23
27
|
import com.google.maps.android.compose.Marker
|
|
@@ -29,8 +33,10 @@ import expo.modules.kotlin.types.toKClass
|
|
|
29
33
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
30
34
|
import expo.modules.kotlin.views.ComposeProps
|
|
31
35
|
import expo.modules.kotlin.views.ExpoComposeView
|
|
36
|
+
import kotlinx.coroutines.launch
|
|
32
37
|
|
|
33
38
|
data class GoogleMapsViewProps(
|
|
39
|
+
val userLocation: MutableState<UserLocationRecord> = mutableStateOf(UserLocationRecord()),
|
|
34
40
|
val cameraPosition: MutableState<CameraPositionRecord> = mutableStateOf(CameraPositionRecord()),
|
|
35
41
|
val markers: MutableState<List<MarkerRecord>> = mutableStateOf(listOf()),
|
|
36
42
|
val uiSettings: MutableState<MapUiSettingsRecord> = mutableStateOf(MapUiSettingsRecord()),
|
|
@@ -38,6 +44,7 @@ data class GoogleMapsViewProps(
|
|
|
38
44
|
val colorScheme: MutableState<MapColorSchemeEnum> = mutableStateOf(MapColorSchemeEnum.FOLLOW_SYSTEM)
|
|
39
45
|
) : ComposeProps
|
|
40
46
|
|
|
47
|
+
@SuppressLint("ViewConstructor")
|
|
41
48
|
class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView<GoogleMapsViewProps>(context, appContext) {
|
|
42
49
|
override val props = GoogleMapsViewProps()
|
|
43
50
|
|
|
@@ -50,16 +57,20 @@ class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView
|
|
|
50
57
|
|
|
51
58
|
private val onCameraMove by EventDispatcher<CameraMoveEvent>()
|
|
52
59
|
|
|
53
|
-
private var wasLoaded = mutableStateOf
|
|
60
|
+
private var wasLoaded = mutableStateOf(false)
|
|
61
|
+
|
|
62
|
+
private lateinit var cameraState: CameraPositionState
|
|
63
|
+
private var manualCameraControl = false
|
|
54
64
|
|
|
55
65
|
init {
|
|
56
66
|
setContent {
|
|
57
|
-
|
|
67
|
+
cameraState = updateCameraState()
|
|
58
68
|
val markerState = markerStateFromProps()
|
|
69
|
+
val locationSource = locationSourceFromProps()
|
|
59
70
|
|
|
60
71
|
GoogleMap(
|
|
61
72
|
modifier = Modifier.fillMaxSize(),
|
|
62
|
-
cameraPositionState = cameraState
|
|
73
|
+
cameraPositionState = cameraState,
|
|
63
74
|
uiSettings = props.uiSettings.value.toMapUiSettings(),
|
|
64
75
|
properties = props.properties.value.toMapProperties(),
|
|
65
76
|
onMapLoaded = {
|
|
@@ -84,7 +95,18 @@ class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView
|
|
|
84
95
|
)
|
|
85
96
|
)
|
|
86
97
|
},
|
|
87
|
-
|
|
98
|
+
onMyLocationButtonClick = props.userLocation.value.coordinates?.let { coordinates ->
|
|
99
|
+
{
|
|
100
|
+
// Override onMyLocationButtonClick with default behavior to update manualCameraControl
|
|
101
|
+
appContext.mainQueue.launch {
|
|
102
|
+
cameraState.animate(CameraUpdateFactory.newLatLng(coordinates.toLatLng()))
|
|
103
|
+
manualCameraControl = false
|
|
104
|
+
}
|
|
105
|
+
true
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
mapColorScheme = props.colorScheme.value.toComposeMapColorScheme(),
|
|
109
|
+
locationSource = locationSource
|
|
88
110
|
) {
|
|
89
111
|
for ((marker, state) in markerState.value) {
|
|
90
112
|
val icon = getIconDescriptor(marker)
|
|
@@ -114,25 +136,31 @@ class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView
|
|
|
114
136
|
}
|
|
115
137
|
|
|
116
138
|
@Composable
|
|
117
|
-
private fun
|
|
118
|
-
val
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
)
|
|
139
|
+
private fun updateCameraState(): CameraPositionState {
|
|
140
|
+
val cameraPosition = props.cameraPosition.value
|
|
141
|
+
cameraState = remember {
|
|
142
|
+
CameraPositionState(
|
|
143
|
+
position = CameraPosition.fromLatLngZoom(
|
|
144
|
+
cameraPosition.coordinates.toLatLng(),
|
|
145
|
+
cameraPosition.zoom
|
|
125
146
|
)
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
LaunchedEffect(cameraState.cameraMoveStartedReason) {
|
|
151
|
+
// We should stop following the user's location when camera is moved manually.
|
|
152
|
+
if (cameraState.cameraMoveStartedReason == CameraMoveStartedReason.GESTURE || cameraState.cameraMoveStartedReason == CameraMoveStartedReason.API_ANIMATION) {
|
|
153
|
+
manualCameraControl = true
|
|
126
154
|
}
|
|
127
155
|
}
|
|
128
156
|
|
|
129
|
-
LaunchedEffect(cameraState.
|
|
157
|
+
LaunchedEffect(cameraState.position) {
|
|
130
158
|
// We don't want to send the event when the map is not loaded yet
|
|
131
159
|
if (!wasLoaded.value) {
|
|
132
160
|
return@LaunchedEffect
|
|
133
161
|
}
|
|
134
162
|
|
|
135
|
-
val position = cameraState.
|
|
163
|
+
val position = cameraState.position
|
|
136
164
|
onCameraMove(
|
|
137
165
|
CameraMoveEvent(
|
|
138
166
|
Coordinates(position.target.latitude, position.target.longitude),
|
|
@@ -142,10 +170,34 @@ class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView
|
|
|
142
170
|
)
|
|
143
171
|
)
|
|
144
172
|
}
|
|
145
|
-
|
|
146
173
|
return cameraState
|
|
147
174
|
}
|
|
148
175
|
|
|
176
|
+
@Composable
|
|
177
|
+
private fun locationSourceFromProps(): LocationSource? {
|
|
178
|
+
val coordinates = props.userLocation.value.coordinates
|
|
179
|
+
val followUserLocation = props.userLocation.value.followUserLocation
|
|
180
|
+
|
|
181
|
+
val locationSource = remember(coordinates) {
|
|
182
|
+
CustomLocationSource()
|
|
183
|
+
}
|
|
184
|
+
LaunchedEffect(coordinates) {
|
|
185
|
+
if (coordinates == null) {
|
|
186
|
+
return@LaunchedEffect
|
|
187
|
+
}
|
|
188
|
+
locationSource.onLocationChanged(coordinates.toLocation())
|
|
189
|
+
if (followUserLocation && !manualCameraControl) {
|
|
190
|
+
// Update camera position when location changes and manualCameraControl is disabled.
|
|
191
|
+
cameraState.animate(CameraUpdateFactory.newLatLng(coordinates.toLatLng()))
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return coordinates?.let {
|
|
195
|
+
locationSource.apply {
|
|
196
|
+
onLocationChanged(coordinates.toLocation())
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
149
201
|
@Composable
|
|
150
202
|
private fun markerStateFromProps() =
|
|
151
203
|
remember {
|
|
@@ -156,6 +208,26 @@ class GoogleMapsView(context: Context, appContext: AppContext) : ExpoComposeView
|
|
|
156
208
|
}
|
|
157
209
|
}
|
|
158
210
|
|
|
211
|
+
suspend fun setCameraPosition(config: SetCameraPositionConfig?) {
|
|
212
|
+
// Stop updating the camera position based on user location.
|
|
213
|
+
manualCameraControl = true
|
|
214
|
+
// If no coordinates are provided, the camera will be centered on the user's location.
|
|
215
|
+
val coordinates: LatLng = config?.coordinates?.toLatLng()
|
|
216
|
+
?: props.userLocation.value.coordinates?.toLatLng()
|
|
217
|
+
?: return
|
|
218
|
+
|
|
219
|
+
val cameraUpdate = config?.zoom?.let { CameraUpdateFactory.newLatLngZoom(coordinates, it) }
|
|
220
|
+
?: CameraUpdateFactory.newLatLng(coordinates)
|
|
221
|
+
|
|
222
|
+
// When Int.MAX_VALUE is provided as durationMs, the default animation duration will be used.
|
|
223
|
+
cameraState.animate(cameraUpdate, config?.duration ?: Int.MAX_VALUE)
|
|
224
|
+
|
|
225
|
+
// If centering on the user's location, stop manual camera control.
|
|
226
|
+
if (config?.coordinates == null) {
|
|
227
|
+
manualCameraControl = false
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
159
231
|
private fun getIconDescriptor(marker: MarkerRecord): BitmapDescriptor? {
|
|
160
232
|
return marker.icon?.let { icon ->
|
|
161
233
|
val bitmap = if (icon.`is`(toKClass<SharedRef<Drawable>>())) {
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
package expo.modules.maps
|
|
2
2
|
|
|
3
|
+
import android.Manifest
|
|
4
|
+
import expo.modules.interfaces.permissions.Permissions
|
|
5
|
+
import expo.modules.kotlin.Promise
|
|
3
6
|
import expo.modules.kotlin.modules.Module
|
|
4
7
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
8
|
|
|
6
9
|
class MapsModule : Module() {
|
|
7
10
|
override fun definition() = ModuleDefinition {
|
|
8
|
-
Name("
|
|
11
|
+
Name("ExpoMaps")
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
AsyncFunction("requestPermissionsAsync") { promise: Promise ->
|
|
14
|
+
Permissions.askForPermissionsWithPermissionsManager(appContext.permissions, promise, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
AsyncFunction("getPermissionsAsync") { promise: Promise ->
|
|
18
|
+
Permissions.getPermissionsWithPermissionsManager(appContext.permissions, promise, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
|
|
12
19
|
}
|
|
13
20
|
}
|
|
14
21
|
}
|
|
@@ -4,6 +4,7 @@ package expo.modules.maps
|
|
|
4
4
|
|
|
5
5
|
import android.graphics.Bitmap
|
|
6
6
|
import android.graphics.drawable.Drawable
|
|
7
|
+
import android.location.Location
|
|
7
8
|
import com.google.android.gms.maps.model.LatLng
|
|
8
9
|
import com.google.maps.android.compose.ComposeMapColorScheme
|
|
9
10
|
import com.google.maps.android.compose.MapProperties
|
|
@@ -16,6 +17,17 @@ import expo.modules.kotlin.sharedobjects.SharedRef
|
|
|
16
17
|
import expo.modules.kotlin.types.Either
|
|
17
18
|
import expo.modules.kotlin.types.Enumerable
|
|
18
19
|
|
|
20
|
+
data class SetCameraPositionConfig(
|
|
21
|
+
@Field
|
|
22
|
+
val coordinates: Coordinates?,
|
|
23
|
+
|
|
24
|
+
@Field
|
|
25
|
+
val zoom: Float?,
|
|
26
|
+
|
|
27
|
+
@Field
|
|
28
|
+
val duration: Int?
|
|
29
|
+
) : Record
|
|
30
|
+
|
|
19
31
|
data class Coordinates(
|
|
20
32
|
@Field
|
|
21
33
|
val latitude: Double = 0.0,
|
|
@@ -26,6 +38,10 @@ data class Coordinates(
|
|
|
26
38
|
fun toLatLng(): LatLng {
|
|
27
39
|
return LatLng(latitude, longitude)
|
|
28
40
|
}
|
|
41
|
+
fun toLocation() = Location("CustomLocation").apply {
|
|
42
|
+
latitude = this@Coordinates.latitude
|
|
43
|
+
longitude = this@Coordinates.longitude
|
|
44
|
+
}
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
data class MarkerRecord(
|
|
@@ -56,6 +72,14 @@ data class CameraPositionRecord(
|
|
|
56
72
|
val zoom: Float = 10f
|
|
57
73
|
) : Record
|
|
58
74
|
|
|
75
|
+
data class UserLocationRecord(
|
|
76
|
+
@Field
|
|
77
|
+
val coordinates: Coordinates? = null,
|
|
78
|
+
|
|
79
|
+
@Field
|
|
80
|
+
val followUserLocation: Boolean = false
|
|
81
|
+
) : Record
|
|
82
|
+
|
|
59
83
|
data class MapUiSettingsRecord(
|
|
60
84
|
@Field
|
|
61
85
|
val compassEnabled: Boolean = true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMaps.d.ts","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;;AAE5C,wBAA2D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMaps.js","sourceRoot":"","sources":["../src/ExpoMaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAI3C,eAAe,mBAAmB,CAAa,UAAU,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo';\n\nimport { MapsModule } from './shared.types';\n\nexport default requireNativeModule<MapsModule>('ExpoMaps');\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SharedRef as SharedRefType } from 'expo/types';
|
|
2
|
+
import type { Ref } from 'react';
|
|
2
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { Coordinates } from '../shared.types';
|
|
4
5
|
export type Marker = {
|
|
@@ -99,6 +100,7 @@ export type Annotation = {
|
|
|
99
100
|
icon?: SharedRefType<'image'>;
|
|
100
101
|
} & Marker;
|
|
101
102
|
export type MapProps = {
|
|
103
|
+
ref?: Ref<AppleMapsViewType>;
|
|
102
104
|
style?: StyleProp<ViewStyle>;
|
|
103
105
|
/**
|
|
104
106
|
* The initial camera position of the map.
|
|
@@ -141,4 +143,16 @@ export type MapProps = {
|
|
|
141
143
|
bearing: number;
|
|
142
144
|
}) => void;
|
|
143
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* @platform ios
|
|
148
|
+
*/
|
|
149
|
+
export type AppleMapsViewType = {
|
|
150
|
+
/**
|
|
151
|
+
* Update camera position.
|
|
152
|
+
* Animation duration is not supported on iOS.
|
|
153
|
+
*
|
|
154
|
+
* @param config New camera postion.
|
|
155
|
+
*/
|
|
156
|
+
setCameraPosition: (config?: CameraPosition) => void;
|
|
157
|
+
};
|
|
144
158
|
//# sourceMappingURL=AppleMaps.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppleMaps.types.d.ts","sourceRoot":"","sources":["../../src/apple/AppleMaps.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,oBAAY,OAAO;IACjB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,OAAO,YAAY;CACpB;AAED,M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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppleMaps.types.js","sourceRoot":"","sources":["../../src/apple/AppleMaps.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppleMaps.types.js","sourceRoot":"","sources":["../../src/apple/AppleMaps.types.ts"],"names":[],"mappings":"AAgEA;;GAEG;AACH,MAAM,CAAN,IAAY,OAaX;AAbD,WAAY,OAAO;IACjB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,gCAAqB,CAAA;IACrB;;OAEG;IACH,8BAAmB,CAAA;AACrB,CAAC,EAbW,OAAO,KAAP,OAAO,QAalB","sourcesContent":["import type { SharedRef as SharedRefType } from 'expo/types';\nimport type { Ref } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Coordinates } from '../shared.types';\n\nexport type Marker = {\n /**\n * The SF symbol to display for the marker.\n */\n systemImage?: string;\n\n /**\n * The coordinates of the marker.\n */\n coordinates?: Coordinates;\n\n /**\n * The title of the marker, displayed in the callout when the marker is clicked.\n */\n title?: string;\n\n /**\n * The tint color of the marker.\n */\n tintColor?: string;\n};\n\nexport type CameraPosition = {\n /**\n * The middle point of the camera.\n */\n coordinates?: Coordinates;\n\n /**\n * The zoom level of the camera.\n * For some view sizez, lower zoom levels might not be available.\n */\n zoom?: number;\n};\n\nexport type MapUiSettings = {\n /**\n * Whether the compass is enabled on the map.\n * If enabled, the compass is only visible when the map is rotated.\n */\n compassEnabled?: boolean;\n\n /**\n * Whether the my location button is visible.\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * Whether the scale bar is displayed when zooming.\n */\n scaleBarEnabled?: boolean;\n\n /**\n * Whether the user is allowed to change the pitch type.\n */\n togglePitchEnabled?: boolean;\n};\n\n/**\n * The type of map to display.\n */\nexport enum MapType {\n /**\n * Satellite imagery with roads and points of interest overlayed.\n */\n HYBRID = 'HYBRID',\n /**\n * Standard road map.\n */\n STANDARD = 'STANDARD',\n /**\n * Satellite imagery.\n */\n IMAGERY = 'IMAGERY',\n}\n\nexport type MapProperties = {\n /**\n * Whether the traffic layer is enabled on the map.\n */\n isTrafficEnabled?: boolean;\n\n /**\n * Defines which map type should be used.\n */\n mapType?: MapType;\n\n /**\n * If true, the user can select a location on the map to get more information.\n */\n selectionEnabled?: boolean;\n};\n\nexport type Annotation = {\n /**\n * The background color of the annotation.\n */\n backgroundColor?: string;\n /**\n * The text to display in the annotation.\n */\n text?: string;\n /**\n * The text color of the annotation.\n */\n textColor?: string;\n /**\n * The custom icon to display in the annotation.\n */\n icon?: SharedRefType<'image'>;\n} & Marker;\n\nexport type MapProps = {\n ref?: Ref<AppleMapsViewType>;\n style?: StyleProp<ViewStyle>;\n\n /**\n * The initial camera position of the map.\n */\n cameraPosition?: CameraPosition;\n\n /**\n * The array of markers to display on the map.\n */\n markers?: Marker[];\n\n /**\n * The array of annotations to display on the map.\n */\n annotations?: Annotation[];\n\n /**\n * The `MapUiSettings` to be used for UI-specific settings on the map.\n */\n uiSettings?: MapUiSettings;\n\n /**\n * The properties for the map.\n */\n properties?: MapProperties;\n\n /**\n * Lambda invoked when the user clicks on the map.\n * It won't be invoked if the user clicks on POI or a marker.\n */\n onMapClick?: (event: { coordinates: Coordinates }) => void;\n\n /**\n * Lambda invoked when the marker is clicked\n */\n onMarkerClick?: (event: Marker) => void;\n\n /**\n * Lambda invoked when the map was moved by the user.\n */\n onCameraMove?: (event: {\n coordinates: Coordinates;\n zoom: number;\n tilt: number;\n bearing: number;\n }) => void;\n};\n\n/**\n * @platform ios\n */\nexport type AppleMapsViewType = {\n /**\n * Update camera position.\n * Animation duration is not supported on iOS.\n *\n * @param config New camera postion.\n */\n setCameraPosition: (config?: CameraPosition) => void;\n};\n"]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MapProps } from './AppleMaps.types';
|
|
3
|
-
|
|
2
|
+
import type { AppleMapsViewType, MapProps } from './AppleMaps.types';
|
|
3
|
+
/**
|
|
4
|
+
* @platform ios
|
|
5
|
+
*/
|
|
6
|
+
export declare const AppleMapsView: React.ForwardRefExoticComponent<Omit<MapProps, "ref"> & React.RefAttributes<AppleMapsViewType>>;
|
|
4
7
|
//# sourceMappingURL=AppleMapsView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppleMapsView.d.ts","sourceRoot":"","sources":["../../src/apple/AppleMapsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AppleMapsView.d.ts","sourceRoot":"","sources":["../../src/apple/AppleMapsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,iBAAiB,EAAkB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAiBrF;;GAEG;AACH,eAAO,MAAM,aAAa,iGAkCzB,CAAC"}
|
|
@@ -10,8 +10,18 @@ function useNativeEvent(userHandler) {
|
|
|
10
10
|
userHandler?.(event.nativeEvent);
|
|
11
11
|
}, [userHandler]);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @platform ios
|
|
15
|
+
*/
|
|
16
|
+
export const AppleMapsView = React.forwardRef(({ onMapClick, onMarkerClick, onCameraMove, annotations, ...props }, ref) => {
|
|
17
|
+
const nativeRef = React.useRef(null);
|
|
18
|
+
React.useImperativeHandle(ref, () => ({
|
|
19
|
+
setCameraPosition(config) {
|
|
20
|
+
nativeRef.current?.setCameraPosition(config);
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
14
23
|
const onNativeMapClick = useNativeEvent(onMapClick);
|
|
24
|
+
const onNativeMarkerClick = useNativeEvent(onMarkerClick);
|
|
15
25
|
const onNativeCameraMove = useNativeEvent(onCameraMove);
|
|
16
26
|
const parsedAnnotations = annotations?.map((annotation) => ({
|
|
17
27
|
...annotation,
|
|
@@ -21,6 +31,6 @@ export function MapView({ onMapClick, onMarkerClick, onCameraMove, annotations,
|
|
|
21
31
|
if (!NativeView) {
|
|
22
32
|
return null;
|
|
23
33
|
}
|
|
24
|
-
return (<NativeView {...props} annotations={parsedAnnotations} onMapClick={onNativeMapClick} onCameraMove={onNativeCameraMove}/>);
|
|
25
|
-
}
|
|
34
|
+
return (<NativeView {...props} ref={nativeRef} annotations={parsedAnnotations} onMapClick={onNativeMapClick} onMarkerClick={onNativeMarkerClick} onCameraMove={onNativeCameraMove}/>);
|
|
35
|
+
});
|
|
26
36
|
//# sourceMappingURL=AppleMapsView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppleMapsView.js","sourceRoot":"","sources":["../../src/apple/AppleMapsView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,IAAI,UAAgD,CAAC;AAErD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;IACzB,UAAU,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;CACjD;AAED,SAAS,cAAc,CAAI,WAA+B;IACxD,OAAO,KAAK,CAAC,WAAW,CACtB,CAAC,KAAK,EAAE,EAAE;QACR,WAAW,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"AppleMapsView.js","sourceRoot":"","sources":["../../src/apple/AppleMapsView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,E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L,CAAC,UAAU,CACT,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,WAAW,CAAC,CAAC,iBAAiB,CAAC,CAC/B,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAC7B,aAAa,CAAC,CAAC,mBAAmB,CAAC,CACnC,YAAY,CAAC,CAAC,kBAAkB,CAAC,EACjC,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { AppleMapsViewType, CameraPosition, MapProps } from './AppleMaps.types';\n\nlet NativeView: React.ComponentType<MapProps> | null;\n\nif (Platform.OS === 'ios') {\n NativeView = requireNativeView('ExpoAppleMaps');\n}\n\nfunction useNativeEvent<T>(userHandler?: (data: T) => void) {\n return React.useCallback(\n (event) => {\n userHandler?.(event.nativeEvent);\n },\n [userHandler]\n );\n}\n\n/**\n * @platform ios\n */\nexport const AppleMapsView = React.forwardRef<AppleMapsViewType, MapProps>(\n ({ onMapClick, onMarkerClick, onCameraMove, annotations, ...props }, ref) => {\n const nativeRef = React.useRef<AppleMapsViewType>(null);\n React.useImperativeHandle(ref, () => ({\n setCameraPosition(config?: CameraPosition) {\n nativeRef.current?.setCameraPosition(config);\n },\n }));\n\n const onNativeMapClick = useNativeEvent(onMapClick);\n const onNativeMarkerClick = useNativeEvent(onMarkerClick);\n const onNativeCameraMove = useNativeEvent(onCameraMove);\n\n const parsedAnnotations = annotations?.map((annotation) => ({\n ...annotation,\n // @ts-expect-error\n icon: annotation.icon?.__expo_shared_object_id__,\n }));\n\n if (!NativeView) {\n return null;\n }\n\n return (\n <NativeView\n {...props}\n ref={nativeRef}\n annotations={parsedAnnotations}\n onMapClick={onNativeMapClick}\n onMarkerClick={onNativeMarkerClick}\n onCameraMove={onNativeCameraMove}\n />\n );\n }\n);\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SharedRef as SharedRefType } from 'expo/types';
|
|
2
|
+
import type { Ref } from 'react';
|
|
2
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { Coordinates } from '../shared.types';
|
|
4
5
|
export type Marker = {
|
|
@@ -27,6 +28,16 @@ export type Marker = {
|
|
|
27
28
|
*/
|
|
28
29
|
icon?: SharedRefType<'image'>;
|
|
29
30
|
};
|
|
31
|
+
export type UserLocation = {
|
|
32
|
+
/**
|
|
33
|
+
* User location coordinates.
|
|
34
|
+
*/
|
|
35
|
+
coordinates: Coordinates;
|
|
36
|
+
/**
|
|
37
|
+
* Should the camera follow the users location.
|
|
38
|
+
*/
|
|
39
|
+
followUserLocation: boolean;
|
|
40
|
+
};
|
|
30
41
|
export type CameraPosition = {
|
|
31
42
|
/**
|
|
32
43
|
* The middle point of the camera.
|
|
@@ -155,6 +166,7 @@ export declare enum MapColorScheme {
|
|
|
155
166
|
FOLLOW_SYSTEM = "FOLLOW_SYSTEM"
|
|
156
167
|
}
|
|
157
168
|
export type MapProps = {
|
|
169
|
+
ref?: Ref<MapViewType>;
|
|
158
170
|
style?: StyleProp<ViewStyle>;
|
|
159
171
|
/**
|
|
160
172
|
* The initial camera position of the map.
|
|
@@ -176,6 +188,10 @@ export type MapProps = {
|
|
|
176
188
|
* Defines the color scheme for the map.
|
|
177
189
|
*/
|
|
178
190
|
colorScheme?: MapColorScheme;
|
|
191
|
+
/**
|
|
192
|
+
* User location, overrides default behavior.
|
|
193
|
+
*/
|
|
194
|
+
userLocation?: UserLocation;
|
|
179
195
|
/**
|
|
180
196
|
* Lambda invoked when the map is loaded.
|
|
181
197
|
*/
|
|
@@ -214,6 +230,20 @@ export type MapProps = {
|
|
|
214
230
|
bearing: number;
|
|
215
231
|
}) => void;
|
|
216
232
|
};
|
|
233
|
+
export type SetCameraPositionConfig = CameraPosition & {
|
|
234
|
+
/**
|
|
235
|
+
* The duration of the animation in milliseconds.
|
|
236
|
+
*/
|
|
237
|
+
duration?: number;
|
|
238
|
+
};
|
|
239
|
+
export type MapViewType = {
|
|
240
|
+
/**
|
|
241
|
+
* Update camera position.
|
|
242
|
+
*
|
|
243
|
+
* @param config New camera postion config.
|
|
244
|
+
*/
|
|
245
|
+
setCameraPosition: (config?: SetCameraPositionConfig) => void;
|
|
246
|
+
};
|
|
217
247
|
export type StreetViewProps = {
|
|
218
248
|
style?: StyleProp<ViewStyle>;
|
|
219
249
|
position?: Coordinates;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.types.d.ts","sourceRoot":"","sources":["../../src/google/GoogleMaps.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC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AAK,IAAI,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.types.js","sourceRoot":"","sources":["../../src/google/GoogleMaps.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GoogleMaps.types.js","sourceRoot":"","sources":["../../src/google/GoogleMaps.types.ts"],"names":[],"mappings":"AAgIA;;GAEG;AACH,MAAM,CAAN,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,kCAAuB,CAAA;IACvB;;OAEG;IACH,8BAAmB,CAAA;AACrB,CAAC,EAjBW,OAAO,KAAP,OAAO,QAiBlB;AA+CD,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,iDAA+B,CAAA;AACjC,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["import type { SharedRef as SharedRefType } from 'expo/types';\nimport type { Ref } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Coordinates } from '../shared.types';\n\nexport type Marker = {\n /**\n * The coordinates of the marker.\n */\n coordinates?: Coordinates;\n\n /**\n * The title of the marker, displayed in the callout when the marker is clicked.\n */\n title?: string;\n\n /**\n * The snippet of the marker, Displayed in the callout when the marker is clicked.\n */\n snippet?: string;\n\n /**\n * Whether the marker is draggable.\n */\n draggable?: boolean;\n\n /**\n * Whether the callout should be shown when the marker is clicked.\n */\n showCallout?: boolean;\n\n /**\n * The custom icon to display for the marker.\n */\n icon?: SharedRefType<'image'>;\n};\n\nexport type UserLocation = {\n /**\n * User location coordinates.\n */\n coordinates: Coordinates;\n\n /**\n * Should the camera follow the users location.\n */\n followUserLocation: boolean;\n};\n\nexport type CameraPosition = {\n /**\n * The middle point of the camera.\n */\n coordinates?: Coordinates;\n\n /**\n * The zoom level of the camera.\n * For some view sizez, lower zoom levels might not be available.\n */\n zoom?: number;\n};\n\nexport type MapUiSettings = {\n /**\n * Whether the compass is enabled on the map.\n * If enabled, the compass is only visible when the map is rotated.\n */\n compassEnabled?: boolean;\n\n /**\n * Whether the indoor level picker is enabled .\n */\n indoorLevelPickerEnabled?: boolean;\n\n /**\n * Whether the map toolbar is visible.\n */\n mapToolbarEnabled?: boolean;\n\n /**\n * Whether the my location button is visible.\n */\n myLocationButtonEnabled?: boolean;\n\n /**\n * Whether rotate gestures are enabled.\n */\n rotationGesturesEnabled?: boolean;\n\n /**\n * Whether the scroll gestures are enabled.\n */\n scrollGesturesEnabled?: boolean;\n\n /**\n * Whether the scroll gestures are enabled during rotation or zoom.\n */\n scrollGesturesEnabledDuringRotateOrZoom?: boolean;\n\n /**\n * Whether the tilt gestures are enabled.\n */\n tiltGesturesEnabled?: boolean;\n\n /**\n * Whether the zoom controls are visible.\n */\n zoomControlsEnabled?: boolean;\n\n /**\n * Whether the zoom gestures are enabled.\n */\n zoomGesturesEnabled?: boolean;\n\n /**\n * Whether the scale bar is displayed when zooming.\n * @platform ios\n */\n scaleBarEnabled?: boolean;\n\n /**\n * Whether the user is allowed to change the pitch type.\n * @platform ios\n */\n togglePitchEnabled?: boolean;\n};\n\n/**\n * The type of map to display.\n */\nexport enum MapType {\n /**\n * Satellite imagery with roads and points of interest overlayed.\n */\n HYBRID = 'HYBRID',\n /**\n * Standard road map.\n */\n NORMAL = 'NORMAL',\n /**\n * Satellite imagery.\n */\n SATELLITE = 'SATELLITE',\n /**\n * Topographic data.\n */\n TERRAIN = 'TERRAIN',\n}\n\nexport type MapProperties = {\n /**\n * Whether the building layer is enabled on the map.\n */\n isBuildingEnabled?: boolean;\n\n /**\n * Whether the indoor layer is enabled on the map.\n */\n isIndoorEnabled?: boolean;\n\n /**\n * Whether finding the user's location is enabled on the map.\n */\n isMyLocationEnabled?: boolean;\n\n /**\n * Whether the traffic layer is enabled on the map.\n */\n isTrafficEnabled?: boolean;\n\n /**\n * Defines which map type should be used.\n */\n mapType?: MapType;\n\n /**\n * If true, the user can select a location on the map to get more information.\n * @platform ios\n */\n selectionEnabled?: boolean;\n\n /**\n * The maximum zoom level for the map.\n * @platform android\n */\n maxZoomPreference?: number;\n\n /**\n * The minimum zoom level for the map.\n * @platform android\n */\n minZoomPreference?: number;\n};\n\nexport enum MapColorScheme {\n LIGHT = 'LIGHT',\n DARK = 'DARK',\n FOLLOW_SYSTEM = 'FOLLOW_SYSTEM',\n}\n\nexport type MapProps = {\n ref?: Ref<MapViewType>;\n style?: StyleProp<ViewStyle>;\n\n /**\n * The initial camera position of the map.\n */\n cameraPosition?: CameraPosition;\n\n /**\n * The array of markers to display on the map.\n */\n markers?: Marker[];\n\n /**\n * The `MapUiSettings` to be used for UI-specific settings on the map.\n */\n uiSettings?: MapUiSettings;\n\n /**\n * The properties for the map.\n */\n properties?: MapProperties;\n\n /**\n * Defines the color scheme for the map.\n */\n colorScheme?: MapColorScheme;\n\n /**\n * User location, overrides default behavior.\n */\n userLocation?: UserLocation;\n\n /**\n * Lambda invoked when the map is loaded.\n */\n onMapLoaded?: () => void;\n\n /**\n * Lambda invoked when the user clicks on the map.\n * It won't be invoked if the user clicks on POI or a marker.\n */\n onMapClick?: (event: { coordinates: Coordinates }) => void;\n\n /**\n * Lambda invoked when the user long presses on the map.\n */\n onMapLongClick?: (event: { coordinates: Coordinates }) => void;\n\n /**\n * Lambda invoked when a POI is clicked.\n */\n onPOIClick?: (event: { name: string; coordinates: Coordinates }) => void;\n\n /**\n * Lambda invoked when the marker is clicked\n */\n onMarkerClick?: (event: Marker) => void;\n\n /**\n * Lambda invoked when the map was moved by the user.\n */\n onCameraMove?: (event: {\n coordinates: Coordinates;\n zoom: number;\n tilt: number;\n bearing: number;\n }) => void;\n};\n\nexport type SetCameraPositionConfig = CameraPosition & {\n /**\n * The duration of the animation in milliseconds.\n */\n duration?: number;\n};\n\nexport type MapViewType = {\n /**\n * Update camera position.\n *\n * @param config New camera postion config.\n */\n setCameraPosition: (config?: SetCameraPositionConfig) => void;\n};\n\nexport type StreetViewProps = {\n style?: StyleProp<ViewStyle>;\n\n position?: Coordinates;\n isPanningGesturesEnabled?: boolean;\n isStreetNamesEnabled?: boolean;\n isUserNavigationEnabled?: boolean;\n isZoomGesturesEnabled?: boolean;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MapProps } from './GoogleMaps.types';
|
|
3
|
-
export declare
|
|
2
|
+
import type { MapProps, MapViewType } from './GoogleMaps.types';
|
|
3
|
+
export declare const GoogleMapsView: React.ForwardRefExoticComponent<Omit<MapProps, "ref"> & React.RefAttributes<MapViewType>>;
|
|
4
4
|
//# sourceMappingURL=GoogleMapsView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsView.d.ts","sourceRoot":"","sources":["../../src/google/GoogleMapsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"GoogleMapsView.d.ts","sourceRoot":"","sources":["../../src/google/GoogleMapsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAA2B,MAAM,oBAAoB,CAAC;AAiBzF,eAAO,MAAM,cAAc,2FAqD1B,CAAC"}
|