电容器启动导航 
允许您的应用程序启动本地导航的电容插件 .
从 https://github.com/ProteanSoftware/电容-启动-导航 原为.
API 密码
启动 MapsApp (...)
launchMapsApp(options: StartNavigationOptions) => Promise<void>
打开带开始方向的本地地图应用程序
| 参数 | 类型 |
|---|---|
options | StartNavigationOptions |
接口
启动导航选项
| Prop | 类型 | 说明 |
|---|---|---|
latitude | string | number | null | 地坐标纬度. 只能搜索地址是无效的 . |
longitude | string | number | null | 地坐标经度. 只能搜索地址是无效的 . |
address | StartNavigationAddress | null | 寻找一个地址。 (iOS和Android)可以与<c>纬度</c>和<c>经度</c>结合使用来完善搜索结果(仅Android). |
name | string | null | 为结束显示名称标签 |
travelMode | TravelMode | 默认“ 驾驶 ” 所有选项都可以在网络上访问 iOS 只提供“ 驾驶”、“ 步行” 和“ 过境” 。 Android 只提供“ 驾驶”、“ 步行”、“ 自行车” |
开始导航 地址
| Prop | 类型 |
|---|---|
street | string | null |
city | string | null |
state | string | null |
postalCode | string | null |
country | string | null |
类型异名
旅行模式
"driving" | "walking" | "transit" | "bicycling"
import { StartNavigation } from "capacitor-start-navigation";
//
// launches native maps with directions to Warwick, UK
StartNavigation.launchMapsApp({
latitude: 52.28333,
longitude: -1.58333,
name: "Example location",
travelMode: "walking"
});
//
// launches native maps with directions to Warwick, UK
StartNavigation.launchMapsApp({
address: {
street: "Market Place",
city: "Warwick",
postalCode: "CV34 4SA",
Country: "United Kingdom"
},
name: "Example location"
});
旅行模式
默认为"驾驶" .
所有选项均可上网查阅.
在iOS上只提供"驾驶","行走"和"Transit".
在Android上只有"驾驶","行走","骑自行车"等可用.
iOS 设置
sudo gem install cocoapods(一次性)ionic start my-cap-app --capacitorcd my-cap-appmkdir www && touch www/index.htmlnpx cap add iosnpm install --save capacitor-start-navigationnpx cap sync ios(插件安装后总是同步)npx cap open ios
机器人设置
ionic start my-cap-app --capacitorcd my-cap-appmkdir www && touch www/index.htmlnpx cap add androidnpm install --save capacitor-start-navigationnpx cap sync android(插件安装后总是同步)npx cap open android
现在你该走了 尝试使用 ionic cap run android --livereload。 。 。 .
许可证
麻省理工学院