You are only printing a marker on the map, so it will only show one.
Each marker must be a new object google.maps.Map
. Since you are printing via PHP, you can iterate the data via PHP:
$latLngList = [
'40.349859, -8.583798',
'38.720430, -9.154948',
'41.159531, -8.659574',
'40.3497085,-8.5958659'
];
//iteração da lista
foreach($latLngList as $latLng)
{
echo "var latLng = new google.maps.LatLng($latLng);
";
//criação de cada marcador
echo "var marker = new google.maps.Marker({position: latLng , map: map});
";
}
This is the basic one, you must iterate over each location and create a new marker by linking to the map. I omitted the rest of the code, because it will remain virtually the same.
How you are iterating over the bookmark list and printing the bookmark?
– Gabriel Heming
I’m printing the marker across the line
var myCenter = new google.maps.LatLng('.$users_dumps_map[$dump['container_id']].');
– Tiago Gonçalves
You are printing only one marker.
– Gabriel Heming