Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

309
Vistas
Laravel 8 fetching coordinates data and display in Google Maps in JavaScript

I have coordinates stored in my database, and I want to fetch those coordinates to display on Google Maps, where the user will click on the link which says like "view on map" in the column table. However, the link will redirect to that map based on stored coordinates from the database, and I don't know how to fetch those coordinates from the database with JavaScript.

var map;
var myLatLng;

function initMap() {
  
  var loc = { lat: -74.17972, lng:34.56445312 };
 
  
  var map = new google.maps.Map(document.getElementById("map"), {
    zoom: 8,
    center: loc,
  });
  
  var marker = new google.maps.Marker({
    position: loc,
    map: map,
    draggable: true
  });
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I believe the way to make client js talks to you db , will be through an API Call by Ajax.

You can create an Api route and controller function to handle query the coords from the DB and test it out

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda