Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
¿Cómo cargar la API de Google Maps usando nextjs?

¿Cómo carga y usa la API de Google Maps usando Nextjs?

1 - ¿Cómo se carga la api? He intentado cargarlo en _document.js:

 import { Html, Head, Main, NextScript } from 'next/document' import Script from 'next/script' const source = `https://maps.googleapis.com/maps/api/js?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places` const Document = () => { return ( <Html> <Head> <Script type="text/javascript" src={source} strategy="beforeInteractive" /> </Head> <body> <Main /> <NextScript /> </body> </Html> ) } export default Document

2 - ¿Cómo haces referencia a la API?

Algo como: ? window.google.maps.places.AutocompleteService().getPlacePredictions()

Pero me sale un error de que google no está definido

También he intentado usar bibliotecas npm pero ninguna parece funcionar. reaccionar-lugares-autocompletar usar-lugares-autocompletar

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!