expo-location 58.0.21 → 58.0.23
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 +15 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/location/LocationModule.kt +2 -5
- package/android/src/main/java/expo/modules/location/next/LocationModuleNext.kt +29 -0
- package/android/src/main/java/expo/modules/location/next/LocationRecords.kt +6 -2
- package/android/src/main/java/expo/modules/location/next/geocoding/Geocoding.kt +117 -0
- package/android/src/main/java/expo/modules/location/next/geocoding/GeocodingExceptions.kt +27 -0
- package/android/src/main/java/expo/modules/location/next/geocoding/GeocodingRecords.kt +24 -0
- package/build/Location.d.ts +5 -4
- package/build/Location.js +35 -17
- package/build/Location.js.map +1 -1
- package/build/Location.types.d.ts +12 -0
- package/build/next/Location.d.ts +1 -1
- package/build/next/Location.js +1 -1
- package/build/next/Location.js.map +1 -1
- package/build/next/index.d.ts +1 -1
- package/build/next/index.js.map +1 -1
- package/build/next/js/geocoding.d.ts +38 -0
- package/build/next/js/geocoding.js +49 -0
- package/build/next/js/geocoding.js.map +1 -0
- package/build/next/js/index.d.ts +1 -0
- package/build/next/js/index.js +1 -0
- package/build/next/js/index.js.map +1 -1
- package/build/next/native/types/NativeLocationModuleNextClass.types.d.ts +3 -1
- package/build/next/types/Geocoding.types.d.ts +74 -0
- package/build/next/types/Geocoding.types.js +7 -0
- package/build/next/types/Geocoding.types.js.map +1 -0
- package/build/next/types/index.d.ts +1 -0
- package/build/next/types/index.js +1 -0
- package/build/next/types/index.js.map +1 -1
- package/ios/next/Geocoding/Address.swift +11 -0
- package/ios/next/Geocoding/AddressNormalization.swift +8 -0
- package/ios/next/Geocoding/CompatibilityGeocoder.swift +73 -0
- package/ios/next/Geocoding/GeocodeOptions.swift +6 -0
- package/ios/next/Geocoding/GeocoderNext.swift +4 -0
- package/ios/next/Geocoding/MapKitGeocoder.swift +70 -0
- package/ios/next/Geocoding/ReverseGeocodeOptions.swift +6 -0
- package/ios/next/Geocoding/String+toLocale.swift +12 -0
- package/ios/next/LocationModuleNext.swift +15 -0
- package/ios/next/LocationNextExceptions.swift +19 -0
- package/ios/next/Position/Position.swift +13 -3
- package/local-maven-repo/host/exp/exponent/expo.modules.location/{58.0.21/expo.modules.location-58.0.21-sources.jar → 58.0.23/expo.modules.location-58.0.23-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/{58.0.21/expo.modules.location-58.0.21.module → 58.0.23/expo.modules.location-58.0.23.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/{58.0.21/expo.modules.location-58.0.21.pom → 58.0.23/expo.modules.location-58.0.23.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.23/expo.modules.location-58.0.23.pom.sha512 +1 -0
- package/package.json +2 -2
- package/src/Location.ts +50 -19
- package/src/Location.types.ts +13 -0
- package/src/next/Location.ts +2 -0
- package/src/next/index.ts +3 -0
- package/src/next/js/geocoding.ts +56 -0
- package/src/next/js/index.ts +1 -0
- package/src/next/native/types/NativeLocationModuleNextClass.types.ts +6 -0
- package/src/next/types/Geocoding.types.ts +77 -0
- package/src/next/types/index.ts +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/58.0.21/expo.modules.location-58.0.21.pom.sha512 +0 -1
package/src/Location.types.ts
CHANGED
|
@@ -611,6 +611,19 @@ export type MotionActivityObject = {
|
|
|
611
611
|
timestamp: number;
|
|
612
612
|
};
|
|
613
613
|
|
|
614
|
+
/**
|
|
615
|
+
* Options for `getMotionActivityAsync`.
|
|
616
|
+
*/
|
|
617
|
+
export type MotionActivityOptions = {
|
|
618
|
+
/**
|
|
619
|
+
* The maximum time to wait for an activity update, in milliseconds. When it passes, the promise
|
|
620
|
+
* rejects with an error whose `code` is `ERR_LOCATION_MOTION_ACTIVITY_TIMEOUT`. Without it the
|
|
621
|
+
* promise waits for the next activity update. That can take a long time if the device is still
|
|
622
|
+
* or the app is in the background.
|
|
623
|
+
*/
|
|
624
|
+
timeout?: number;
|
|
625
|
+
};
|
|
626
|
+
|
|
614
627
|
/**
|
|
615
628
|
* Represents the `watchMotionActivityAsync` callback.
|
|
616
629
|
*/
|
package/src/next/Location.ts
CHANGED
package/src/next/index.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Platform, UnavailabilityError } from 'expo';
|
|
2
|
+
|
|
3
|
+
import { NativeLocationModuleNext } from '../native';
|
|
4
|
+
import type { Address, Coordinates, GeocodeOptions, ReverseGeocodeOptions } from '../types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Finds the places that match an address string. Requires a network connection.
|
|
8
|
+
*
|
|
9
|
+
* @param address The text to look up, for example, `1 Infinite Loop, Cupertino`.
|
|
10
|
+
* @param options The language of the result.
|
|
11
|
+
* @return A promise that resolves to the matching addresses, or to an empty array when there are none.
|
|
12
|
+
* @throws When the device has no geocoding backend, geocoding is unavailable, or the request fails.
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const [match] = await Location.geocode('1 Infinite Loop, Cupertino');
|
|
16
|
+
* if (match) {
|
|
17
|
+
* console.log(match.coordinates.latitude, match.coordinates.longitude);
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
* @platform android
|
|
21
|
+
* @platform ios
|
|
22
|
+
*/
|
|
23
|
+
export async function geocode(address: string, options?: GeocodeOptions): Promise<Address[]> {
|
|
24
|
+
if (Platform.OS !== 'android' && Platform.OS !== 'ios') {
|
|
25
|
+
throw new UnavailabilityError('expo-location', 'geocode');
|
|
26
|
+
}
|
|
27
|
+
return NativeLocationModuleNext.geocode(address, options);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Finds the addresses at the given coordinates. Requires a network connection.
|
|
32
|
+
*
|
|
33
|
+
* @param coordinates The point to look up.
|
|
34
|
+
* @param options The language of the result.
|
|
35
|
+
* @return A promise that resolves to the addresses at the point, or to an empty array when there are none.
|
|
36
|
+
* @throws When the coordinates are invalid, the device has no geocoding backend, geocoding is unavailable, or the request fails.
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const position = await Location.getPosition();
|
|
40
|
+
* if (position) {
|
|
41
|
+
* const [address] = await Location.reverseGeocode(position.coordinates);
|
|
42
|
+
* console.log(address?.formattedAddress);
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
* @platform android
|
|
46
|
+
* @platform ios
|
|
47
|
+
*/
|
|
48
|
+
export async function reverseGeocode(
|
|
49
|
+
coordinates: Coordinates,
|
|
50
|
+
options?: ReverseGeocodeOptions
|
|
51
|
+
): Promise<Address[]> {
|
|
52
|
+
if (Platform.OS !== 'android' && Platform.OS !== 'ios') {
|
|
53
|
+
throw new UnavailabilityError('expo-location', 'reverseGeocode');
|
|
54
|
+
}
|
|
55
|
+
return NativeLocationModuleNext.reverseGeocode(coordinates, options);
|
|
56
|
+
}
|
package/src/next/js/index.ts
CHANGED
|
@@ -2,12 +2,16 @@ import { NativeModule } from 'expo';
|
|
|
2
2
|
import type { PermissionResponse, SharedRef } from 'expo';
|
|
3
3
|
|
|
4
4
|
import type {
|
|
5
|
+
Address,
|
|
6
|
+
Coordinates,
|
|
7
|
+
GeocodeOptions,
|
|
5
8
|
GetPositionOptions,
|
|
6
9
|
LocationPermissionResponse,
|
|
7
10
|
LocationProfile,
|
|
8
11
|
LocationProviderRefType,
|
|
9
12
|
Position,
|
|
10
13
|
RequestPermissionsOptions,
|
|
14
|
+
ReverseGeocodeOptions,
|
|
11
15
|
} from '../../types';
|
|
12
16
|
import type { NativeBackgroundSessionClass } from './NativeBackgroundSessionClass.types';
|
|
13
17
|
import type { NativeLocationProviderClass } from './NativeLocationProviderClass.types';
|
|
@@ -31,6 +35,8 @@ export declare class NativeLocationModuleNextClass extends NativeModule {
|
|
|
31
35
|
enableLocationServices(): Promise<boolean>;
|
|
32
36
|
getPosition(options?: GetPositionOptions): Promise<Position | null>;
|
|
33
37
|
watchPosition(profile?: LocationProfile): NativePositionWatchHandleClass;
|
|
38
|
+
geocode(address: string, options?: GeocodeOptions): Promise<Address[]>;
|
|
39
|
+
reverseGeocode(coordinates: Coordinates, options?: ReverseGeocodeOptions): Promise<Address[]>;
|
|
34
40
|
LocationProvider: typeof NativeLocationProviderClass;
|
|
35
41
|
PositionWatchHandle: typeof NativePositionWatchHandleClass;
|
|
36
42
|
LocationUpdatesHandle: typeof NativeLocationUpdatesHandleClass;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Coordinates } from './Position.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An address paired with the coordinates it stands for. Fields the platform does not know for a
|
|
5
|
+
* given place are `null`.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* {
|
|
9
|
+
* coordinates: { latitude: 37.3317, longitude: -122.0301 },
|
|
10
|
+
* name: '1 Infinite Loop',
|
|
11
|
+
* formattedAddress: '1 Infinite Loop, Cupertino, CA 95014, United States',
|
|
12
|
+
* city: 'Cupertino',
|
|
13
|
+
* country: 'United States',
|
|
14
|
+
* isoCountryCode: 'US',
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
* @platform android
|
|
18
|
+
* @platform ios
|
|
19
|
+
*/
|
|
20
|
+
export type Address = {
|
|
21
|
+
/**
|
|
22
|
+
* The latitude and longitude of the place, in degrees, for example,
|
|
23
|
+
* `{ latitude: 37.3317, longitude: -122.0301 }`.
|
|
24
|
+
*/
|
|
25
|
+
coordinates: Coordinates;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the place, for example, `1 Infinite Loop`. Each platform reads this from its own
|
|
28
|
+
* field, so it can be a building, a street, a postcode or an administrative area.
|
|
29
|
+
*/
|
|
30
|
+
name: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The whole address on one line, for example,
|
|
33
|
+
* `1 Infinite Loop, Cupertino, CA 95014, United States`.
|
|
34
|
+
*/
|
|
35
|
+
formattedAddress: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* The city name of the address, for example, `Cupertino`.
|
|
38
|
+
*
|
|
39
|
+
* This is `null` when the backend has no city for the place. That can happen even for a town you
|
|
40
|
+
* would name, in which case the city is often still part of `formattedAddress`.
|
|
41
|
+
*/
|
|
42
|
+
city: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* The country name of the address, for example, `United States`.
|
|
45
|
+
*/
|
|
46
|
+
country: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* The ISO 3166-1 alpha-2 country code of the address, for example, `US`.
|
|
49
|
+
*/
|
|
50
|
+
isoCountryCode: string | null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Options for [`geocode`](#geocodeaddress-options).
|
|
55
|
+
* @platform android
|
|
56
|
+
* @platform ios
|
|
57
|
+
*/
|
|
58
|
+
export type GeocodeOptions = {
|
|
59
|
+
/**
|
|
60
|
+
* The language of the text fields in the result, as a BCP 47 tag such as `en-US`. Defaults to
|
|
61
|
+
* the device language.
|
|
62
|
+
*/
|
|
63
|
+
locale?: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Options for [`reverseGeocode`](#reversegeocodecoordinates-options).
|
|
68
|
+
* @platform android
|
|
69
|
+
* @platform ios
|
|
70
|
+
*/
|
|
71
|
+
export type ReverseGeocodeOptions = {
|
|
72
|
+
/**
|
|
73
|
+
* The language of the text fields in the result, as a BCP 47 tag such as `en-US`. Defaults to
|
|
74
|
+
* the device language.
|
|
75
|
+
*/
|
|
76
|
+
locale?: string;
|
|
77
|
+
};
|
package/src/next/types/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9cd70fc8266a1f17601f49e84e3255d3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2ab913e2508bb752970c222cf4906f023b772209
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cd09575a93cfc2f28b138c1b4d479e407035cc991639a75e3da3e5a057170a28
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
18552c6609c50cfccd8b7cea5c9c1295a2df6e7080f4e8472681c4ea633376e94f43bcfbc70946391792d635dcd9c7c0688d4ab382b6b34f1add598d82916943
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
88320df8c179b0f8fcb669f696ab0f96
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e619441840ee48b895ef8deac3cfdf03db006d02
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d19b8691e52672f787c2f00f17b0bf4e134cd1af43cc3503f79c2c3bbb5bc8b8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d3eb631b8bd28712b804810b901ec3fe51d1eb83366f189d7c65490b905b9d08cf99775a9d9f0cb5dea2b5d735a232488619c78c482220ebf1d04d9fd48c6d6f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4c78fd3484417685f46e86bcd9332487
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cff559c5cc359169068db2589ca1c563e08b3c24
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
db97545c9f956f7f2cefd08126e7c87c4c13e5bdd2b6e07e540fa99efefa5aff
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
58f9998ca00f996f8b21e963e78c55b803a945c7f6f3bb417d11641c87772a22bb4c85789cc5a22f3e59fcdc1a3a86747f4c58eeca66b4377bba44fbdaf50712
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3a09551b142a0a86c8febf6859bfae5c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
513c9c09d5c51d3ccc65242cda09f2a366a9ae61
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f4a7f9c2f80e1aef46cd6d86f27f13ad0c5d1fb2ac75448f086ca3ea705624f3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
756ed9726cb961df2b65ad6d44d16c7547b7709829efbd6b820e82432c42827824c9b2a3c8e3b0c8c173ff91d2dc9a699fde8fa13d38db3423ad1c9af053cdad
|