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

498
Views
Reaccionar API de Google Maps (ReferenceError: google no está definido)

Estoy usando el módulo de nodo react-google-maps/api . Necesito configurar el valor de zoomControlOptions en TOP_LEFT pero terminé recibiendo este error Uncaught ReferenceError: google is not defined notdefined . Aquí está el enlace al repositorio.

Estoy recibiendo el error aquí

 const options = { zoomControl: true, mapTypeControl: false, minZoom: 2, streetViewControl: false, zoomControlOptions: { position: google.maps.ControlPosition.TOP_LEFT, // google is undefined here }, };

Por favor, ayúdame :)

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Intente definir la variable de google explícitamente así:

const google = window.google;

Además, también puede leer esta respuesta

about 4 years ago · Juan Pablo Isaza Report

0

Intente definir "opciones" dentro de su componente y agregue "ventana", como

 position: window.google.maps.ControlPosition.TOP_LEFT

Además, puedes poner solo un número.

 BOTTOM: 11 BOTTOM_CENTER: 11 BOTTOM_LEFT: 10 BOTTOM_RIGHT: 12 CENTER: 13 LEFT: 5 LEFT_BOTTOM: 6 LEFT_CENTER: 4 LEFT_TOP: 5 RIGHT: 7 RIGHT_BOTTOM: 9 RIGHT_CENTER: 8 RIGHT_TOP: 7 TOP: 2 TOP_CENTER: 2 TOP_LEFT: 1 TOP_RIGHT: 3
about 4 years ago · Juan Pablo Isaza Report
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!