react-native-map-link 3.7.0 → 3.9.0
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/README.md +0 -1
- package/app.plugin.js +1 -0
- package/lib/constants.js +3 -0
- package/lib/images/here.png +0 -0
- package/lib/type.d.ts +1 -1
- package/lib/utils.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/app.plugin.js
CHANGED
package/lib/constants.js
CHANGED
|
@@ -28,6 +28,7 @@ const generatePrefixes = ({ alwaysIncludeGoogle, naverCallerName, }) => {
|
|
|
28
28
|
liftago: 'lftgpas://',
|
|
29
29
|
petalmaps: 'petalmaps://',
|
|
30
30
|
sygic: 'com.sygic.aura://',
|
|
31
|
+
here: 'here-route://',
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
exports.generatePrefixes = generatePrefixes;
|
|
@@ -62,6 +63,7 @@ const generateTitles = (titles) => {
|
|
|
62
63
|
liftago: 'Liftago',
|
|
63
64
|
petalmaps: 'Petal Maps',
|
|
64
65
|
sygic: 'Sygic',
|
|
66
|
+
here: 'Here We Go',
|
|
65
67
|
...(titles || {}),
|
|
66
68
|
};
|
|
67
69
|
};
|
|
@@ -90,6 +92,7 @@ exports.icons = {
|
|
|
90
92
|
liftago: require('./images/liftago.png'),
|
|
91
93
|
petalmaps: require('./images/petalmaps.png'),
|
|
92
94
|
sygic: require('./images/sygic.png'),
|
|
95
|
+
here: require('./images/here.png'),
|
|
93
96
|
};
|
|
94
97
|
exports.appKeys = Object.keys(exports.icons);
|
|
95
98
|
exports.colorsPopup = {
|
|
Binary file
|
package/lib/type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageSourcePropType } from 'react-native';
|
|
2
2
|
/** id for map application. this is the id that is passed to the `app` option */
|
|
3
|
-
export type MapId = 'apple-maps' | 'google-maps' | 'citymapper' | 'uber' | 'lyft' | 'transit' | 'truckmap' | 'waze' | 'yandex' | 'moovit' | 'yandex-maps' | 'yandex-taxi' | 'kakaomap' | 'tmap' | 'mapycz' | 'maps-me' | 'osmand' | 'gett' | 'navermap' | 'dgis' | 'liftago' | 'petalmaps' | 'sygic';
|
|
3
|
+
export type MapId = 'apple-maps' | 'google-maps' | 'citymapper' | 'uber' | 'lyft' | 'transit' | 'truckmap' | 'waze' | 'yandex' | 'moovit' | 'yandex-maps' | 'yandex-taxi' | 'kakaomap' | 'tmap' | 'mapycz' | 'maps-me' | 'osmand' | 'gett' | 'navermap' | 'dgis' | 'liftago' | 'petalmaps' | 'sygic' | 'here';
|
|
4
4
|
export type DirectionMode = 'car' | 'walk' | 'public-transport' | 'bike';
|
|
5
5
|
/** options shared across different types */
|
|
6
6
|
export interface SharedOptions {
|
package/lib/utils.js
CHANGED
|
@@ -184,6 +184,9 @@ const generateMapUrl = ({ app, directionsMode, appleIgnoreLatLon, googleForceLat
|
|
|
184
184
|
if (!googleForceLatLon && title) {
|
|
185
185
|
url += `&destination=${encodedTitle}`;
|
|
186
186
|
}
|
|
187
|
+
else if (!googleForceLatLon && address) {
|
|
188
|
+
url += `&destination=${address}`;
|
|
189
|
+
}
|
|
187
190
|
else {
|
|
188
191
|
url += `&destination=${latlng}`;
|
|
189
192
|
}
|
|
@@ -435,6 +438,16 @@ const generateMapUrl = ({ app, directionsMode, appleIgnoreLatLon, googleForceLat
|
|
|
435
438
|
}
|
|
436
439
|
url += sygicDirectionsMode ? `${sygicDirectionsMode}` : '';
|
|
437
440
|
break;
|
|
441
|
+
case 'here':
|
|
442
|
+
// the prefix "here-route://" is defined in the constants.ts file but Here recommends using the https-address for deep links
|
|
443
|
+
// so here-route:// is used only to detect if the app is installed and the https url is used for linking
|
|
444
|
+
if (address) {
|
|
445
|
+
url = `https://share.here.com/r/${sourceLat && sourceLng ? `${sourceLat},${sourceLng}/` : ''}${lat},${lng},${address}?m=d`;
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
url = `https://share.here.com/r/${sourceLat && sourceLng ? `${sourceLat},${sourceLng}/` : ''}${lat},${lng}?m=d`;
|
|
449
|
+
}
|
|
450
|
+
break;
|
|
438
451
|
}
|
|
439
452
|
return url;
|
|
440
453
|
};
|