跳过主要内容
返回插件
@capgo/capacitor-nativegeocoder 重命名 从 @capgo/nativegeocoder 重命名为 @capgo/capacitor-nativegeocoder。
教程
@capgo/capacitor-nativegeocoder

原生地理编码

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

指南

本地地理编码教程

使用 @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_KEEP_0__/__CAPGO_KEEP_1__-nativegeocoder 入门 Capgo Plugin Directory Capgo 插件目录 Capacitor 插件由 Capgo 提供 为 Capacitor 插件由 Capgo 提供的实现细节 添加或更新插件 为添加或更新插件的实现细节