title: Laravel 8 fetching coordinates data and display in Google Maps in JavaScript
body: <p>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 <strong>&quot;view on map&quot;</strong> 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.</p>
  <pre><code>var map;
  var myLatLng;
  
  function initMap() {
    
    var loc = { lat: -74.17972, lng:34.56445312 };
   
    
    var map = new google.maps.Map(document.getElementById(&quot;map&quot;), {
      zoom: 8,
      center: loc,
    });
    
    var marker = new google.maps.Marker({
      position: loc,
      map: map,
      draggable: true
    });
  }
  </code></pre>