@capawesome/capacitor-maps-launcher 0.0.1 → 0.1.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 +80 -9
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/mapslauncher/MapsLauncher.java +2 -2
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +3 -3
- package/dist/esm/definitions.js +3 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js +3 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/MapsLauncher.swift +3 -3
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Capacitor Maps Launcher Plugin
|
|
2
2
|
|
|
3
3
|
Capacitor plugin to launch navigation apps with turn-by-turn directions.
|
|
4
4
|
|
|
@@ -20,9 +20,14 @@ Capacitor plugin to launch navigation apps with turn-by-turn directions.
|
|
|
20
20
|
|
|
21
21
|
Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Use Cases
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The Maps Launcher plugin is typically used whenever an app wants to hand the user over to a navigation app, for example:
|
|
26
|
+
|
|
27
|
+
- **Store locators**: Add a "Get directions" button that starts turn-by-turn navigation to a store or office.
|
|
28
|
+
- **Delivery and field service**: Launch navigation to the next stop using its coordinates.
|
|
29
|
+
- **Event apps**: Navigate attendees to a venue by its plain address, without needing coordinates.
|
|
30
|
+
- **User choice**: Detect which navigation apps are installed with `getAvailableApps` and let users pick their favorite one.
|
|
26
31
|
|
|
27
32
|
## Compatibility
|
|
28
33
|
|
|
@@ -78,18 +83,40 @@ No configuration required for this plugin.
|
|
|
78
83
|
|
|
79
84
|
## Usage
|
|
80
85
|
|
|
86
|
+
The following examples show how to get the available and default navigation apps and how to navigate to coordinates or an address.
|
|
87
|
+
|
|
88
|
+
### Get the available navigation apps
|
|
89
|
+
|
|
90
|
+
Check which navigation apps are installed and can be launched. On iOS, Apple Maps is always included, while Google Maps and Waze are only included if the corresponding URL schemes are declared in your `Info.plist` file (see [Installation](#installation)). Only available on Android and iOS:
|
|
91
|
+
|
|
81
92
|
```typescript
|
|
82
|
-
import { MapsLauncher
|
|
93
|
+
import { MapsLauncher } from '@capawesome/capacitor-maps-launcher';
|
|
83
94
|
|
|
84
95
|
const getAvailableApps = async () => {
|
|
85
96
|
const { apps } = await MapsLauncher.getAvailableApps();
|
|
86
97
|
return apps;
|
|
87
98
|
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Get the default navigation app
|
|
102
|
+
|
|
103
|
+
Find out which navigation app is configured as the default handler for navigation intents. Returns `null` if the default app is not part of the curated list of supported apps or if no default app is set. Only available on Android:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { MapsLauncher } from '@capawesome/capacitor-maps-launcher';
|
|
88
107
|
|
|
89
108
|
const getDefaultApp = async () => {
|
|
90
109
|
const { app } = await MapsLauncher.getDefaultApp();
|
|
91
110
|
return app;
|
|
92
111
|
};
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Navigate to coordinates
|
|
115
|
+
|
|
116
|
+
Launch a navigation app with turn-by-turn directions to a destination defined by its latitude and longitude. You can optionally specify the app to launch and the travel mode:
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { MapsLauncher, NavigationApp } from '@capawesome/capacitor-maps-launcher';
|
|
93
120
|
|
|
94
121
|
const navigate = async () => {
|
|
95
122
|
await MapsLauncher.navigate({
|
|
@@ -101,6 +128,14 @@ const navigate = async () => {
|
|
|
101
128
|
travelMode: 'driving',
|
|
102
129
|
});
|
|
103
130
|
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Navigate to an address
|
|
134
|
+
|
|
135
|
+
Instead of coordinates, you can also pass a plain address as the destination. If no `app` is provided, the system default behavior is used (a chooser on Android, Apple Maps on iOS):
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { MapsLauncher } from '@capawesome/capacitor-maps-launcher';
|
|
104
139
|
|
|
105
140
|
const navigateToAddress = async () => {
|
|
106
141
|
await MapsLauncher.navigate({
|
|
@@ -251,11 +286,11 @@ The travel mode to use for the directions.
|
|
|
251
286
|
|
|
252
287
|
#### NavigationApp
|
|
253
288
|
|
|
254
|
-
| Members | Value
|
|
255
|
-
| ---------------- |
|
|
256
|
-
| **`AppleMaps`** | <code>'
|
|
257
|
-
| **`GoogleMaps`** | <code>'
|
|
258
|
-
| **`Waze`** | <code>'
|
|
289
|
+
| Members | Value | Description | Since |
|
|
290
|
+
| ---------------- | -------------------------- | ---------------------------------- | ----- |
|
|
291
|
+
| **`AppleMaps`** | <code>'APPLE_MAPS'</code> | Apple Maps. Only available on iOS. | 0.1.0 |
|
|
292
|
+
| **`GoogleMaps`** | <code>'GOOGLE_MAPS'</code> | Google Maps. | 0.1.0 |
|
|
293
|
+
| **`Waze`** | <code>'WAZE'</code> | Waze. | 0.1.0 |
|
|
259
294
|
|
|
260
295
|
</docgen-api>
|
|
261
296
|
|
|
@@ -283,6 +318,42 @@ If `start` is not provided, the current location of the device is used.
|
|
|
283
318
|
|
|
284
319
|
Unsupported travel modes fall back to the default behavior of the respective app. Waze only supports driving and ignores the `travelMode` option.
|
|
285
320
|
|
|
321
|
+
## FAQ
|
|
322
|
+
|
|
323
|
+
### How is this plugin different from other similar plugins?
|
|
324
|
+
|
|
325
|
+
It launches turn-by-turn navigation in Google Maps, Apple Maps, and Waze from a single fully typed API, accepting either coordinates or a plain address and supporting driving, walking, bicycling, and transit modes. It also detects which navigation apps are installed and, on Android, which one is the default handler, so you can let users pick their favorite. Per-app behavior is documented transparently, and the plugin is actively maintained against the latest Capacitor and OS versions across Android and iOS.
|
|
326
|
+
|
|
327
|
+
### Why are Google Maps and Waze reported as unavailable on iOS?
|
|
328
|
+
|
|
329
|
+
To detect and launch Google Maps and Waze on iOS, the `comgooglemaps` and `waze` URL schemes must be added to the `LSApplicationQueriesSchemes` array in the `Info.plist` file of your app. Without them, `getAvailableApps` reports those apps as unavailable and `navigate` rejects with the `APP_NOT_AVAILABLE` error code. See the [Installation](#installation) section for details.
|
|
330
|
+
|
|
331
|
+
### What happens if I do not specify a navigation app?
|
|
332
|
+
|
|
333
|
+
If no `app` is provided, the system default behavior is used: Android shows a chooser and iOS opens Apple Maps. On Android, you can use `getDefaultApp` to find out which supported navigation app is configured as the default handler.
|
|
334
|
+
|
|
335
|
+
### Which travel modes are supported?
|
|
336
|
+
|
|
337
|
+
The plugin supports the `driving`, `walking`, `bicycling`, and `transit` travel modes, but the support depends on the selected app and is best-effort. Google Maps supports all four modes, Apple Maps does not support bicycling, and Waze only supports driving and ignores the option. Unsupported travel modes fall back to the default behavior of the respective app.
|
|
338
|
+
|
|
339
|
+
### Can I set a custom start location for the route?
|
|
340
|
+
|
|
341
|
+
Yes, use the `start` option of the `navigate` method. However, the support depends on the selected app: Apple Maps supports it fully, Google Maps opens the directions preview instead of starting turn-by-turn navigation, and Waze ignores it. If no start location is provided, the current location of the device is used.
|
|
342
|
+
|
|
343
|
+
### Does the plugin work on the web?
|
|
344
|
+
|
|
345
|
+
No, the `getAvailableApps` and `navigate` methods are only available on Android and iOS, and `getDefaultApp` is only available on Android. Launching installed navigation apps is a native capability that is not available in the browser.
|
|
346
|
+
|
|
347
|
+
## Related Plugins
|
|
348
|
+
|
|
349
|
+
- [App Launcher](https://capawesome.io/docs/sdks/capacitor/app-launcher/): Check if an app can be opened and open it.
|
|
350
|
+
- [Geocoder](https://capawesome.io/docs/sdks/capacitor/geocoder/): Convert addresses into coordinates and vice versa.
|
|
351
|
+
- [Android Intent Launcher](https://capawesome.io/docs/sdks/capacitor/android-intent-launcher/): Launch arbitrary Android intents.
|
|
352
|
+
|
|
353
|
+
## Newsletter
|
|
354
|
+
|
|
355
|
+
Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).
|
|
356
|
+
|
|
286
357
|
## Changelog
|
|
287
358
|
|
|
288
359
|
See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/maps-launcher/CHANGELOG.md).
|
package/android/src/main/java/io/capawesome/capacitorjs/plugins/mapslauncher/MapsLauncher.java
CHANGED
|
@@ -20,8 +20,8 @@ import java.util.List;
|
|
|
20
20
|
|
|
21
21
|
public class MapsLauncher {
|
|
22
22
|
|
|
23
|
-
public static final String APP_GOOGLE_MAPS = "
|
|
24
|
-
public static final String APP_WAZE = "
|
|
23
|
+
public static final String APP_GOOGLE_MAPS = "GOOGLE_MAPS";
|
|
24
|
+
public static final String APP_WAZE = "WAZE";
|
|
25
25
|
public static final String PACKAGE_GOOGLE_MAPS = "com.google.android.apps.maps";
|
|
26
26
|
public static final String PACKAGE_WAZE = "com.waze";
|
|
27
27
|
|
package/dist/docs.json
CHANGED
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
"members": [
|
|
267
267
|
{
|
|
268
268
|
"name": "AppleMaps",
|
|
269
|
-
"value": "'
|
|
269
|
+
"value": "'APPLE_MAPS'",
|
|
270
270
|
"tags": [
|
|
271
271
|
{
|
|
272
272
|
"text": "0.1.0",
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
"name": "GoogleMaps",
|
|
280
|
-
"value": "'
|
|
280
|
+
"value": "'GOOGLE_MAPS'",
|
|
281
281
|
"tags": [
|
|
282
282
|
{
|
|
283
283
|
"text": "0.1.0",
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
"name": "Waze",
|
|
291
|
-
"value": "'
|
|
291
|
+
"value": "'WAZE'",
|
|
292
292
|
"tags": [
|
|
293
293
|
{
|
|
294
294
|
"text": "0.1.0",
|
|
@@ -151,19 +151,19 @@ export declare enum NavigationApp {
|
|
|
151
151
|
*
|
|
152
152
|
* @since 0.1.0
|
|
153
153
|
*/
|
|
154
|
-
AppleMaps = "
|
|
154
|
+
AppleMaps = "APPLE_MAPS",
|
|
155
155
|
/**
|
|
156
156
|
* Google Maps.
|
|
157
157
|
*
|
|
158
158
|
* @since 0.1.0
|
|
159
159
|
*/
|
|
160
|
-
GoogleMaps = "
|
|
160
|
+
GoogleMaps = "GOOGLE_MAPS",
|
|
161
161
|
/**
|
|
162
162
|
* Waze.
|
|
163
163
|
*
|
|
164
164
|
* @since 0.1.0
|
|
165
165
|
*/
|
|
166
|
-
Waze = "
|
|
166
|
+
Waze = "WAZE"
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
169
|
* The travel mode to use for the directions.
|
package/dist/esm/definitions.js
CHANGED
|
@@ -12,19 +12,19 @@ export var NavigationApp;
|
|
|
12
12
|
*
|
|
13
13
|
* @since 0.1.0
|
|
14
14
|
*/
|
|
15
|
-
NavigationApp["AppleMaps"] = "
|
|
15
|
+
NavigationApp["AppleMaps"] = "APPLE_MAPS";
|
|
16
16
|
/**
|
|
17
17
|
* Google Maps.
|
|
18
18
|
*
|
|
19
19
|
* @since 0.1.0
|
|
20
20
|
*/
|
|
21
|
-
NavigationApp["GoogleMaps"] = "
|
|
21
|
+
NavigationApp["GoogleMaps"] = "GOOGLE_MAPS";
|
|
22
22
|
/**
|
|
23
23
|
* Waze.
|
|
24
24
|
*
|
|
25
25
|
* @since 0.1.0
|
|
26
26
|
*/
|
|
27
|
-
NavigationApp["Waze"] = "
|
|
27
|
+
NavigationApp["Waze"] = "WAZE";
|
|
28
28
|
})(NavigationApp || (NavigationApp = {}));
|
|
29
29
|
/**
|
|
30
30
|
* @since 0.1.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAiJA;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAqBX;AArBD,WAAY,aAAa;IACvB;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAiJA;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAqBX;AArBD,WAAY,aAAa;IACvB;;;;;;OAMG;IACH,yCAAwB,CAAA;IACxB;;;;OAIG;IACH,2CAA0B,CAAA;IAC1B;;;;OAIG;IACH,8BAAa,CAAA;AACf,CAAC,EArBW,aAAa,KAAb,aAAa,QAqBxB;AAcD;;GAEG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB;;;;OAIG;IACH,kDAAqC,CAAA;IACrC;;;;OAIG;IACH,2CAA8B,CAAA;AAChC,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB","sourcesContent":["export interface MapsLauncherPlugin {\n /**\n * Get the navigation apps that are installed and can be launched.\n *\n * On iOS, Apple Maps is always included. Google Maps and Waze are only\n * included if the corresponding `LSApplicationQueriesSchemes` entries are\n * added to the `Info.plist` file of your app.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n getAvailableApps(): Promise<GetAvailableAppsResult>;\n /**\n * Get the navigation app that is configured as the default handler for\n * navigation intents.\n *\n * Returns `null` if the default app is not part of the curated list of\n * supported apps or if no default app is set (i.e. the system shows a\n * chooser).\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n getDefaultApp(): Promise<GetDefaultAppResult>;\n /**\n * Launch a navigation app with turn-by-turn directions to a destination.\n *\n * If no `app` is provided, the system default behavior is used (a chooser on\n * Android, Apple Maps on iOS).\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n navigate(options: NavigateOptions): Promise<void>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetAvailableAppsResult {\n /**\n * The navigation apps that are installed and can be launched.\n *\n * @since 0.1.0\n */\n apps: NavigationApp[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetDefaultAppResult {\n /**\n * The navigation app that is configured as the default handler.\n *\n * Returns `null` if the default app is not part of the curated list of\n * supported apps or if no default app is set.\n *\n * @since 0.1.0\n */\n app: NavigationApp | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface NavigateOptions {\n /**\n * The navigation app to launch.\n *\n * If not provided, the system default behavior is used (a chooser on\n * Android, Apple Maps on iOS).\n *\n * @since 0.1.0\n */\n app?: NavigationApp;\n /**\n * The destination to navigate to.\n *\n * @since 0.1.0\n */\n destination: Destination;\n /**\n * The start location of the route.\n *\n * If not provided, the current location of the device is used.\n *\n * **Note**: The support depends on the selected app. Apple Maps supports it\n * fully, Google Maps opens the directions preview instead of starting\n * turn-by-turn navigation, and Waze ignores it.\n *\n * @since 0.1.0\n */\n start?: Destination;\n /**\n * The travel mode to use for the directions.\n *\n * **Note**: The support depends on the selected app and is best-effort.\n * Waze only supports driving and ignores this option.\n *\n * @default 'driving'\n * @since 0.1.0\n */\n travelMode?: TravelMode;\n}\n\n/**\n * A destination is either defined by its coordinates or by its address, but\n * not both.\n *\n * @since 0.1.0\n */\nexport interface Destination {\n /**\n * The address of the destination.\n *\n * Must be provided without `latitude` and `longitude`.\n *\n * @example 'Apple Park, Cupertino, CA'\n * @since 0.1.0\n */\n address?: string;\n /**\n * The latitude of the destination.\n *\n * Must be provided together with `longitude` and without `address`.\n *\n * @example 37.3349\n * @since 0.1.0\n */\n latitude?: number;\n /**\n * The longitude of the destination.\n *\n * Must be provided together with `latitude` and without `address`.\n *\n * @example -122.009\n * @since 0.1.0\n */\n longitude?: number;\n}\n\n/**\n * A navigation app that can be launched.\n *\n * @since 0.1.0\n */\nexport enum NavigationApp {\n /**\n * Apple Maps.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n AppleMaps = 'APPLE_MAPS',\n /**\n * Google Maps.\n *\n * @since 0.1.0\n */\n GoogleMaps = 'GOOGLE_MAPS',\n /**\n * Waze.\n *\n * @since 0.1.0\n */\n Waze = 'WAZE',\n}\n\n/**\n * The travel mode to use for the directions.\n *\n * - `driving`: Driving directions.\n * - `walking`: Walking directions.\n * - `bicycling`: Bicycling directions.\n * - `transit`: Public transit directions.\n *\n * @since 0.1.0\n */\nexport type TravelMode = 'driving' | 'walking' | 'bicycling' | 'transit';\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * The requested navigation app is not installed or cannot be launched.\n *\n * @since 0.1.0\n */\n AppNotAvailable = 'APP_NOT_AVAILABLE',\n /**\n * The navigation app could not be launched.\n *\n * @since 0.1.0\n */\n LaunchFailed = 'LAUNCH_FAILED',\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -16,19 +16,19 @@ exports.NavigationApp = void 0;
|
|
|
16
16
|
*
|
|
17
17
|
* @since 0.1.0
|
|
18
18
|
*/
|
|
19
|
-
NavigationApp["AppleMaps"] = "
|
|
19
|
+
NavigationApp["AppleMaps"] = "APPLE_MAPS";
|
|
20
20
|
/**
|
|
21
21
|
* Google Maps.
|
|
22
22
|
*
|
|
23
23
|
* @since 0.1.0
|
|
24
24
|
*/
|
|
25
|
-
NavigationApp["GoogleMaps"] = "
|
|
25
|
+
NavigationApp["GoogleMaps"] = "GOOGLE_MAPS";
|
|
26
26
|
/**
|
|
27
27
|
* Waze.
|
|
28
28
|
*
|
|
29
29
|
* @since 0.1.0
|
|
30
30
|
*/
|
|
31
|
-
NavigationApp["Waze"] = "
|
|
31
|
+
NavigationApp["Waze"] = "WAZE";
|
|
32
32
|
})(exports.NavigationApp || (exports.NavigationApp = {}));
|
|
33
33
|
/**
|
|
34
34
|
* @since 0.1.0
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * A navigation app that can be launched.\n *\n * @since 0.1.0\n */\nexport var NavigationApp;\n(function (NavigationApp) {\n /**\n * Apple Maps.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n NavigationApp[\"AppleMaps\"] = \"
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * A navigation app that can be launched.\n *\n * @since 0.1.0\n */\nexport var NavigationApp;\n(function (NavigationApp) {\n /**\n * Apple Maps.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n NavigationApp[\"AppleMaps\"] = \"APPLE_MAPS\";\n /**\n * Google Maps.\n *\n * @since 0.1.0\n */\n NavigationApp[\"GoogleMaps\"] = \"GOOGLE_MAPS\";\n /**\n * Waze.\n *\n * @since 0.1.0\n */\n NavigationApp[\"Waze\"] = \"WAZE\";\n})(NavigationApp || (NavigationApp = {}));\n/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The requested navigation app is not installed or cannot be launched.\n *\n * @since 0.1.0\n */\n ErrorCode[\"AppNotAvailable\"] = \"APP_NOT_AVAILABLE\";\n /**\n * The navigation app could not be launched.\n *\n * @since 0.1.0\n */\n ErrorCode[\"LaunchFailed\"] = \"LAUNCH_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst MapsLauncher = registerPlugin('MapsLauncher', {\n web: () => import('./web').then(m => new m.MapsLauncherWeb()),\n});\nexport * from './definitions';\nexport { MapsLauncher };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class MapsLauncherWeb extends WebPlugin {\n async getAvailableApps() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getDefaultApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async navigate(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NavigationApp","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACWA;AACX,CAAC,UAAU,aAAa,EAAE;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,WAAW,CAAC,GAAG,YAAY;AAC7C;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,aAAa;AAC/C;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;AAClC,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;AACzC;AACA;AACA;AACWC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;AAC/C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AC5C5B,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -15,19 +15,19 @@ var capacitorMapsLauncher = (function (exports, core) {
|
|
|
15
15
|
*
|
|
16
16
|
* @since 0.1.0
|
|
17
17
|
*/
|
|
18
|
-
NavigationApp["AppleMaps"] = "
|
|
18
|
+
NavigationApp["AppleMaps"] = "APPLE_MAPS";
|
|
19
19
|
/**
|
|
20
20
|
* Google Maps.
|
|
21
21
|
*
|
|
22
22
|
* @since 0.1.0
|
|
23
23
|
*/
|
|
24
|
-
NavigationApp["GoogleMaps"] = "
|
|
24
|
+
NavigationApp["GoogleMaps"] = "GOOGLE_MAPS";
|
|
25
25
|
/**
|
|
26
26
|
* Waze.
|
|
27
27
|
*
|
|
28
28
|
* @since 0.1.0
|
|
29
29
|
*/
|
|
30
|
-
NavigationApp["Waze"] = "
|
|
30
|
+
NavigationApp["Waze"] = "WAZE";
|
|
31
31
|
})(exports.NavigationApp || (exports.NavigationApp = {}));
|
|
32
32
|
/**
|
|
33
33
|
* @since 0.1.0
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * A navigation app that can be launched.\n *\n * @since 0.1.0\n */\nexport var NavigationApp;\n(function (NavigationApp) {\n /**\n * Apple Maps.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n NavigationApp[\"AppleMaps\"] = \"
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * A navigation app that can be launched.\n *\n * @since 0.1.0\n */\nexport var NavigationApp;\n(function (NavigationApp) {\n /**\n * Apple Maps.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n NavigationApp[\"AppleMaps\"] = \"APPLE_MAPS\";\n /**\n * Google Maps.\n *\n * @since 0.1.0\n */\n NavigationApp[\"GoogleMaps\"] = \"GOOGLE_MAPS\";\n /**\n * Waze.\n *\n * @since 0.1.0\n */\n NavigationApp[\"Waze\"] = \"WAZE\";\n})(NavigationApp || (NavigationApp = {}));\n/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The requested navigation app is not installed or cannot be launched.\n *\n * @since 0.1.0\n */\n ErrorCode[\"AppNotAvailable\"] = \"APP_NOT_AVAILABLE\";\n /**\n * The navigation app could not be launched.\n *\n * @since 0.1.0\n */\n ErrorCode[\"LaunchFailed\"] = \"LAUNCH_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst MapsLauncher = registerPlugin('MapsLauncher', {\n web: () => import('./web').then(m => new m.MapsLauncherWeb()),\n});\nexport * from './definitions';\nexport { MapsLauncher };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class MapsLauncherWeb extends WebPlugin {\n async getAvailableApps() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getDefaultApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async navigate(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["NavigationApp","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,WAAW,CAAC,GAAG,YAAY;IAC7C;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,aAAa;IAC/C;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAClC,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;IACzC;IACA;IACA;AACWC;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;IACtD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;IAC/C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AC5C5B,UAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -5,9 +5,9 @@ import MapKit
|
|
|
5
5
|
import UIKit
|
|
6
6
|
|
|
7
7
|
@objc public class MapsLauncher: NSObject {
|
|
8
|
-
static let appAppleMaps = "
|
|
9
|
-
static let appGoogleMaps = "
|
|
10
|
-
static let appWaze = "
|
|
8
|
+
static let appAppleMaps = "APPLE_MAPS"
|
|
9
|
+
static let appGoogleMaps = "GOOGLE_MAPS"
|
|
10
|
+
static let appWaze = "WAZE"
|
|
11
11
|
static let schemeGoogleMaps = "comgooglemaps"
|
|
12
12
|
static let schemeWaze = "waze"
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-maps-launcher",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Capacitor plugin to launch navigation apps with turn-by-turn directions.",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Capacitor plugin to launch navigation apps with turn-by-turn directions on Android and iOS.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
@@ -33,14 +33,21 @@
|
|
|
33
33
|
"url": "https://opencollective.com/capawesome"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
"homepage": "https://capawesome.io/docs/
|
|
36
|
+
"homepage": "https://capawesome.io/docs/sdks/capacitor/maps-launcher/",
|
|
37
37
|
"keywords": [
|
|
38
38
|
"capacitor",
|
|
39
|
+
"capacitor-plugin",
|
|
39
40
|
"plugin",
|
|
40
41
|
"native",
|
|
41
42
|
"maps",
|
|
42
43
|
"navigation",
|
|
43
|
-
"launch navigator"
|
|
44
|
+
"launch navigator",
|
|
45
|
+
"maps launcher",
|
|
46
|
+
"google maps",
|
|
47
|
+
"apple maps",
|
|
48
|
+
"waze",
|
|
49
|
+
"directions",
|
|
50
|
+
"turn-by-turn navigation"
|
|
44
51
|
],
|
|
45
52
|
"scripts": {
|
|
46
53
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|