使用 @capgo/capacitor-nativegeocoder
Capacitor 插件用于本地前向和反向地理编码。
安装
npm install @capgo/capacitor-nativegeocoder
npx cap sync
此插件暴露的内容
reverseGeocode- 将经纬度转换为地址。forwardGeocode- 将地址转换为经纬度。
示例用途
reverseGeocode
将经纬度转换为地址。
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
await NativeGeocoder.reverseGeocode({} as ReverseOptions);
forwardGeocode
将地址转换为经纬度。
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
await NativeGeocoder.forwardGeocode({} as ForwardOptions);
全参考
- GitHub: https://github.com/Cap-go/capacitor-nativegeocoder/
- 文档:/docs/plugins/nativegeocoder/
从使用@capgo/capacitor-nativegeocoder继续
如果您正在使用 使用@capgo/capacitor-nativegeocoder 来规划原生插件工作,连接它与 @capgo/capacitor-nativegeocoder 原生插件工作的实现细节在@capgo/capacitor-nativegeocoder, 开始使用 了解开始使用中的实现细节 Capgo 插件目录 了解Capgo 插件目录中的产品工作流程 Capacitor 由 Capgo 提供的插件 了解Capacitor 由 Capgo 提供的插件中的实现细节 添加或更新插件 了解添加或更新插件中的实现细节