Getting Started
复制安装提示并包含该插件的完整Markdown指南。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-launch-navigator`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/launch-navigator/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
您可以使用我们的AI辅助安装来安装插件。使用以下命令将Capgo技能添加到您的AI工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-launch-navigator` plugin in my project.如果您更喜欢手动设置,请按照以下命令安装插件并遵循以下平台特定的说明:
bun add @capgo/capacitor-launch-navigatorbunx cap syncimport { LaunchNavigator } from '@capgo/capacitor-launch-navigator';API概述
标题为“API概述”的部分navigate
标题为“导航”的部分使用经纬度坐标导航到一个位置
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.navigate({} as { /** * Destination coordinates [latitude, longitude] */ destination: [number, number];
/** * Optional navigation options */ options?: NavigateOptions; });isAppAvailable
节标题:isAppAvailable检查设备上特定导航应用的可用性
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.isAppAvailable({} as { /** * App identifier to check */ app: IOSNavigationApp | AndroidNavigationApp | string; });getAvailableApps
节标题:getAvailableApps获取设备上可用的导航应用列表
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getAvailableApps();getSupportedApps
节标题:getSupportedApps获取当前平台支持的应用列表
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getSupportedApps();getDefaultApp
节标题:getDefaultApp获取导航的默认应用名称
import { LaunchNavigator } from '@capgo/capacitor-launch-navigator';
await LaunchNavigator.getDefaultApp();类型参考
类型参考NavigateOptions
导航选项复制到剪贴板
export interface NavigateOptions { /** * Starting location coordinates [latitude, longitude] */ start?: [number, number];
/** * Starting location name */ startName?: string;
/** * Destination name (will be ignored since we only support coordinates) */ destinationName?: string;
/** * Transport mode */ transportMode?: TransportMode;
/** * Specific app to launch (if not specified, will use default or prompt) */ app?: IOSNavigationApp | AndroidNavigationApp | string;
/** * Launch mode */ launchMode?: LaunchMode;
/** * Additional parameters specific to certain apps */ extras?: Record<string, any>;
/** * Enable debug logging */ enableDebug?: boolean;}IOSNavigationApp
可用iOS导航应用复制到剪贴板
export enum IOSNavigationApp { APPLE_MAPS = 'apple_maps', GOOGLE_MAPS = 'google_maps', WAZE = 'waze', CITYMAPPER = 'citymapper', GARMIN_NAVIGON = 'garmin_navigon', TRANSIT_APP = 'transit_app', YANDEX_NAVIGATOR = 'yandex', UBER = 'uber', TOMTOM = 'tomtom', SYGIC = 'sygic', HERE_MAPS = 'here', MOOVIT = 'moovit', LYFT = 'lyft', MAPS_ME = 'mapsme', CABIFY = 'cabify', BAIDU = 'baidu', GAODE = 'gaode', TAXI_99 = '99taxi',}AndroidNavigationApp
可用Android导航应用复制到剪贴板
export enum AndroidNavigationApp { GOOGLE_MAPS = 'google_maps', WAZE = 'waze', CITYMAPPER = 'citymapper', UBER = 'uber', YANDEX = 'yandex', SYGIC = 'sygic', HERE_MAPS = 'here', MOOVIT = 'moovit', LYFT = 'lyft', MAPS_ME = 'mapsme', CABIFY = 'cabify', BAIDU = 'baidu', GAODE = 'gaode',}AvailableApp
可用应用应用可用性检查结果
export interface AvailableApp { /** * App identifier */ app: string;
/** * Display name of the app */ name: string;
/** * Whether the app is available on the device */ available: boolean;}TransportMode
运输模式运输模式
export enum TransportMode { DRIVING = 'driving', WALKING = 'walking', BICYCLING = 'bicycling', TRANSIT = 'transit',}LaunchMode
启动模式启动模式
export enum LaunchMode { MAPS = 'maps', TURN_BY_TURN = 'turn_by_turn', GEO = 'geo',}真实来源
真实来源本页面由插件生成 src/definitions.ts重新同步时,公共API上游发生变化。
继续从Getting Started
标题为“继续从Getting Started”如果您正在使用 Getting Started 来规划仪表板和API操作,连接它与 使用@capgo/capacitor-launch-navigator 为native能力在使用@capgo/capacitor-launch-navigator 中API概述 为API概述中的实现细节 介绍 为《介绍》中的实现细节 API Keys 为《API Keys》中的实现细节, 设备 为《设备》中的实现细节。