react-native-map-link 2.10.2 → 2.11.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/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/constants.js +1 -1
- package/src/index.js +8 -5
package/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ interface Options extends SharedOptions {
|
|
|
49
49
|
/** optional, true will always add Google Maps to iOS and open in Safari, even if app is not installed (default: false) */
|
|
50
50
|
alwaysIncludeGoogle?: boolean;
|
|
51
51
|
googleForceLatLon?: boolean;
|
|
52
|
+
appleIgnoreLatLon?: boolean;
|
|
52
53
|
googlePlaceId?: string;
|
|
53
54
|
title?: string;
|
|
54
55
|
/** optionally specify specific app to use */
|
package/package.json
CHANGED
package/src/constants.js
CHANGED
|
@@ -17,7 +17,7 @@ export function generatePrefixes(options) {
|
|
|
17
17
|
truckmap: 'truckmap://',
|
|
18
18
|
waze: 'waze://',
|
|
19
19
|
yandex: 'yandexnavi://',
|
|
20
|
-
moovit: 'moovit://',
|
|
20
|
+
moovit: 'moovit://directions',
|
|
21
21
|
'yandex-maps': 'yandexmaps://maps.yandex.ru/',
|
|
22
22
|
'yandex-taxi': 'yandextaxi://',
|
|
23
23
|
kakaomap: 'kakaomap://',
|
package/src/index.js
CHANGED
|
@@ -125,10 +125,13 @@ export async function showLocation(options) {
|
|
|
125
125
|
case 'apple-maps':
|
|
126
126
|
const appleDirectionMode = getDirectionsModeAppleMaps();
|
|
127
127
|
url = prefixes['apple-maps'];
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
if (useSourceDestiny) {
|
|
129
|
+
url = `${url}?saddr=${sourceLatLng}&daddr=${latlng}`;
|
|
130
|
+
} else if (!options.appleIgnoreLatLon) {
|
|
131
|
+
url = `${url}?ll=${latlng}`;
|
|
132
|
+
}
|
|
133
|
+
url += useSourceDestiny || !options.appleIgnoreLatLon ? '&' : '?';
|
|
134
|
+
url += `q=${title ? encodedTitle : 'Location'}`;
|
|
132
135
|
url += appleDirectionMode ? `&dirflg=${appleDirectionMode}` : '';
|
|
133
136
|
break;
|
|
134
137
|
case 'google-maps':
|
|
@@ -223,7 +226,7 @@ export async function showLocation(options) {
|
|
|
223
226
|
}
|
|
224
227
|
break;
|
|
225
228
|
case 'moovit':
|
|
226
|
-
url = `${prefixes.moovit}
|
|
229
|
+
url = `${prefixes.moovit}?dest_lat=${lat}&dest_lon=${lng}`;
|
|
227
230
|
|
|
228
231
|
if (title) {
|
|
229
232
|
url += `&dest_name=${encodedTitle}`;
|