Skip to content

Commit 2c39b76

Browse files
authored
Merge pull request #316 from Pauligrinder/master
Add Here We Go support
2 parents 8d4d96a + 83acf85 commit 2c39b76

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

app.plugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const schemes = [
2424
'lftgpas',
2525
'petalmaps',
2626
'sygic',
27+
'here-route',
2728
];
2829

2930
const intents = ['geo', 'waze'].map((app) => {

src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const generatePrefixes = ({
3434
liftago: 'lftgpas://',
3535
petalmaps: 'petalmaps://',
3636
sygic: 'com.sygic.aura://',
37+
here: 'here-route://',
3738
};
3839
};
3940

@@ -70,6 +71,7 @@ export const generateTitles = (
7071
liftago: 'Liftago',
7172
petalmaps: 'Petal Maps',
7273
sygic: 'Sygic',
74+
here: 'Here We Go',
7375
...(titles || {}),
7476
};
7577
};
@@ -98,6 +100,7 @@ export const icons: Record<string, number> = {
98100
liftago: require('./images/liftago.png'),
99101
petalmaps: require('./images/petalmaps.png'),
100102
sygic: require('./images/sygic.png'),
103+
here: require('./images/here.png'),
101104
};
102105

103106
export const appKeys: string[] = Object.keys(icons);

src/images/here.png

15.9 KB
Loading

src/type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export type MapId =
2424
| 'dgis'
2525
| 'liftago'
2626
| 'petalmaps'
27-
| 'sygic';
27+
| 'sygic'
28+
| 'here';
2829

2930
export type DirectionMode = 'car' | 'walk' | 'public-transport' | 'bike';
3031

src/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,16 @@ export const generateMapUrl = ({
557557
}
558558
url += sygicDirectionsMode ? `${sygicDirectionsMode}` : '';
559559
break;
560+
case 'here':
561+
// the prefix "here-route://" is defined in the constants.ts file but Here recommends using the https-address for deep links
562+
// so here-route:// is used only to detect if the app is installed and the https url is used for linking
563+
564+
if (address) {
565+
url = `https://share.here.com/r/${sourceLat && sourceLng ? `${sourceLat},${sourceLng}/` : ''}${lat},${lng},${address}?m=d`;
566+
} else {
567+
url = `https://share.here.com/r/${sourceLat && sourceLng ? `${sourceLat},${sourceLng}/` : ''}${lat},${lng}?m=d`;
568+
}
569+
break;
560570
}
561571

562572
return url;

0 commit comments

Comments
 (0)