跳过主要内容
返回插件
@capgo/capacitor-nativegeocoder 重命名 Renamed from @capgo/nativegeocoder to @capgo/capacitor-nativegeocoder.
@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-nativegeocoder
@capgo/capacitor-nativegeocoder

Native Geocoder

使用原生地理编码将地址转换为坐标和坐标转换为地址

指南

Native Geocoder 使用教程

在设备上测试

下载 Capgo 应用程序,然后扫描 QR code。

原生地理编码器插件预览 QR code

使用 @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);

完整参考

继续使用 @capgo/capacitor-nativegeocoder

如果您正在使用 使用 @capgo/capacitor-nativegeocoder 来规划原生插件工作,连接它 @capgo/capacitor-nativegeocoder 为 @capgo/capacitor-nativegeocoder 的实现细节 开始使用 为开始使用的实现细节 Capgo 插件目录 为Capgo 插件目录中的产品工作流程 Capacitor 由 Capgo 提供的插件 为Capacitor 由 Capgo 提供的插件的实现细节 添加或更新插件 为添加或更新插件的实现细节