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

308
Views
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 answers
Answer question

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 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!