Skip to content

完成给管理的请法

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Terminal window
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-nativegeocoder` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

Terminal window
npm install @capgo/capacitor-nativegeocoder
npx cap sync
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';

緯度と経度を住所に変換

import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
await NativeGeocoder.reverseGeocode({} as ReverseOptions);

住所を緯度と経度に変換

import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
await NativeGeocoder.forwardGeocode({} as ForwardOptions);

型の参照

「型の参照」
export interface ReverseOptions {
/**
* latitude is a number representing the latitude of the location.
*/
latitude: number;
/**
* longitude is a number representing the longitude of the location.
*/
longitude: number;
/**
* Localise the results to the given locale.
*/
useLocale?: boolean;
/**
* locale is a string in the format of language_country, for example en_US.
*/
defaultLocale?: string;
/**
* Max number of results to return.
*/
maxResults?: number;
/**
* Only used for web platform to use google api
*/
apiKey?: string;
/**
* Only used for web platform to use google api
*/
resultType?: string;
}
export interface Address {
latitude: number;
longitude: number;
countryCode: string;
countryName: string;
postalCode: string;
administrativeArea: string;
subAdministrativeArea: string;
locality: string;
subLocality: string;
thoroughfare: string;
subThoroughfare: string;
areasOfInterest: string[];
}
export interface ForwardOptions {
/**
* address is a string of the address to be geocoded.
*/
addressString: string;
/**
* Localise the results to the given locale.
*/
useLocale?: boolean;
/**
* locale is a string in the format of language_country, for example en_US.
*/
defaultLocale?: string;
/**
* Max number of results to return.
*/
maxResults?: number;
/**
* Only used for web platform to use google api
*/
apiKey?: string;
}

このページはプラグインから生成されています。 src/definitions.tsパブリック API がアップストリームで変更された場合に再度同期を実行してください。

Capgo を使用している場合 スタート APIを使用してダッシュボードとAPIの操作を計画し、 @capgo/capacitor-nativegeocoderを使用 Using @capgo/capacitor-nativegeocoderのネイティブ機能について APIの概要 APIの実装詳細について 導入 __CAPGO_KEEP_0__の実装詳細について APIのキー APIの実装詳細について デバイス __CAPGO_KEEP_0__の実装詳細について