Pagina/area: Sito web di marketing Capgo. Ruolo: Etichetta UI breve o elemento di navigazione. Visualizzato in: componente doc/SignupCta.astro, componente Hero.astro. Chiave di messaggio `hero_title_line2` (Hero Title Line2).
Copia un prompt di configurazione con i passaggi di installazione e la guida markdown completa per questo plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-nativegeocoder`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/nativegeocoder/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installare
Sezione intitolata “Installazione”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:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsUsa 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:
npm install @capgo/capacitor-nativegeocodernpx cap syncImporta
Sezione intitolata “Importa”import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';API Overview
Sezione intitolata “API Overview”reverseGeocode
Sezione intitolata “reverseGeocode”Converti la latitudine e la longitudine in un indirizzo
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
const result = await NativeGeocoder.reverseGeocode({ latitude: 48.8566, longitude: 2.3522,});console.log(result);forwardGeocode
Sezione intitolata “forwardGeocode”Converti un indirizzo in coordinate di longitudine e latitudine
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';
const result = await NativeGeocoder.forwardGeocode({ addressString: 'address-string' });console.log(result);Riferimento di tipo
Sezione intitolata “Riferimento di tipo”ReverseOptions
Sezione intitolata “ReverseOptions”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[];}ForwardOptions
Sezione intitolata “ForwardOptions”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;}Fonte Di Verità
Sezione intitolata “Fonte Di Verità”Questa pagina è generata dal plugin’s src/definitions.tsRieccere lo sync quando il pubblico API cambia in alto flusso.
Continua da Getting Started
Sezione intitolata “Continua da Getting Started”Se stai utilizzando Getting Started per pianificare dashboard e API operazioni, connettilo con Utilizza @capgo/capacitor-nativegeocoder per la capacità nativa in Utilizza @capgo/capacitor-nativegeocoder, API Overview 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 nei dispositivi.