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

116
Views
Mostrar múltiples marcadores en los mapas de Google

Estoy tratando de mostrar varios marcadores en los mapas de Google, lo que funciona bien, pero el problema al que me enfrento es que cuando obtengo la latitud/longitud para una ubicación al buscar en Google Maps y luego uso esos marcadores de latitud/longitud en mis mapas, escribe el marcador. muestra un poco lejos de la ubicación.

Mi código es el siguiente:

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { padding: 0px; margin: 0px; } #map { display: table; width: 100%; height: 600px; } </style> <!-- Async script executes immediately and must be after any DOM elements used in callback. --> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&libraries=&v=weekly&channel=2" async></script> </head> <body> <div id="map"></div> <script> var locations = [ ['Elite Tuning', 53.214032, -2.551536, 3], ['North Wales Carbon', 53.294184, -3.579918, 2], ['os-Carz', 52.6629864, 1.1101281, 1] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 8, center: new google.maps.LatLng(52.7646718, -1.2562978), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); } </script> </body> </html>

¿Por qué está pasando esto? Cualquier ayuda es apreciada.

Gracias por adelantado.

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!