Get latitude and longitude dynamiclly from database

Posted 2 years ago by user224564

I am trying to integrate maps to one of my projects, I store latitude and longitude in the DB for each rapport. How is the javascript to do get dynamically for each rapport its coordinates.


function initMap() { var raport_location = {lat: {{$raport->info_latt}}, lng:{{$raport->info_long}}}; var map = new google.maps.Map(document.getElementById('map'), { zoom: 16, center: raport_location }); var raport_marker = new google.maps.Marker({ position: raport_location, map: map }); }


Please sign in or create an account to participate in this conversation.