react-native-map-link 3.8.0 → 3.10.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/app.plugin.js +1 -0
- package/lib/constants.d.ts +2 -1
- package/lib/constants.js +3 -0
- package/lib/images/here.png +0 -0
- package/lib/type.d.ts +3 -3
- package/lib/utils.js +10 -0
- package/package.json +2 -2
package/app.plugin.js
CHANGED
package/lib/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ImageRequireSource } from 'react-native';
|
|
1
2
|
import type { MapId } from './type';
|
|
2
3
|
export declare const isIOS: boolean;
|
|
3
4
|
export declare const generatePrefixes: ({ alwaysIncludeGoogle, naverCallerName, }: {
|
|
@@ -6,7 +7,7 @@ export declare const generatePrefixes: ({ alwaysIncludeGoogle, naverCallerName,
|
|
|
6
7
|
}) => Record<MapId, string>;
|
|
7
8
|
export declare const prefixForGoogleMaps: (alwaysIncludeGoogle?: boolean) => string;
|
|
8
9
|
export declare const generateTitles: (titles?: Record<string, string>) => Record<string, string>;
|
|
9
|
-
export declare const icons: Record<string,
|
|
10
|
+
export declare const icons: Record<string, ImageRequireSource>;
|
|
10
11
|
export declare const appKeys: string[];
|
|
11
12
|
export declare const colorsPopup: {
|
|
12
13
|
black: string;
|
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
|
-
import type {
|
|
1
|
+
import type { ImageRequireSource } 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 {
|
|
@@ -12,7 +12,7 @@ export interface SharedOptions {
|
|
|
12
12
|
export type GetAppsResponse = {
|
|
13
13
|
id: MapId;
|
|
14
14
|
name: string;
|
|
15
|
-
icon:
|
|
15
|
+
icon: ImageRequireSource;
|
|
16
16
|
/** function to link user to map app */
|
|
17
17
|
open: () => Promise<string | null | undefined>;
|
|
18
18
|
};
|
package/lib/utils.js
CHANGED
|
@@ -438,6 +438,16 @@ const generateMapUrl = ({ app, directionsMode, appleIgnoreLatLon, googleForceLat
|
|
|
438
438
|
}
|
|
439
439
|
url += sygicDirectionsMode ? `${sygicDirectionsMode}` : '';
|
|
440
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;
|
|
441
451
|
}
|
|
442
452
|
return url;
|
|
443
453
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-map-link",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "Open the map app of the user's choice with a specific location.",
|
|
5
5
|
"source": "src/index",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/core": "^7.23.9",
|
|
45
45
|
"@babel/eslint-parser": "^7.23.10",
|
|
46
46
|
"@babel/eslint-plugin": "^7.23.5",
|
|
47
|
-
"@babel/runtime": "^7.
|
|
47
|
+
"@babel/runtime": "^7.28.4",
|
|
48
48
|
"@expo/config-plugins": "^7.8.4",
|
|
49
49
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
50
50
|
"@types/jest": "^29.5.12",
|