Saltare al contenuto

Continua da Iniziare

Repository del geocodificatore nativo GitHub repository del geocodificatore nativo GitHub

Puoi utilizzare la nostra configurazione assistita dall'IA per installare il plugin. Aggiungi le Capgo competenze al tuo strumento di AI utilizzando il seguente comando:

Finestra del terminale
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Usa poi il seguente prompt:

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

Se preferisci l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma riportate di seguito:

Finestra del terminale
npm install @capgo/capacitor-nativegeocoder
npx cap sync
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';

Converti la latitudine e la longitudine in un indirizzo

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

Converti un indirizzo in latitudine e longitudine

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;
}

Questa pagina è generata dal plugin’s src/definitions.tsRiepilogare la sincronizzazione quando il pubblico API cambia in alto flusso.

Continua da qui: Iniziare

Se stai utilizzando

Iniziare per pianificare il dashboard e le __CAPGO_KEEP_0__ operazioni, connettilo con Utilizzare @API/__CAPGO_KEEP_1__-nativegeocoder per la capacità nativa in Utilizzare @capgo/capacitor-nativegeocoder for the native capability in Using @capgo/capacitor-nativegeocoder, API Panoramica per i dettagli di implementazione in API Panoramica, Introduzione per i dettagli di implementazione in Introduzione, API Chiavi per i dettagli di implementazione in API Chiavi, e Dispositivi per i dettagli di implementazione in Dispositivi.