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

290
Views
AQUÍ map.getcenter() devuelve 0

Estoy usando la plataforma de geocodificador para obtener la latitud/longitud de una dirección. Luego configuro el centro del mapa en esas coordenadas.

Sin embargo, cuando llamo map.getCenter() después, solo obtengo 0 para lat, lng y alt. ¿Cual podría ser el problema?

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

0

Si solicita el centro del mapa justo después de configurar el nuevo centro, obtendrá el antiguo (o mejor dicho, el actual).

Deberías esperar hasta que el centro del mapa esté realmente actualizado o usar mapviewchangeend event listener:

 map.setCenter({lat:15,lng:16}); map.addEventListener('mapviewchangeend', (e) => { console.log(map.getCenter()); })
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!