<?php
for($a=0;$a<$total_ouvintes;$a++){
$locations = $ipLite->getCity("$contip[$a]");
echo "var myLatlng$a = new google.maps.LatLng( $locations[latitude], $locations[longitude]);\n";
}
?>
var locationArray = [<?php for($b=0;$b<$total_ouvintes;$b++){ echo "myLatlng$b,";}?>];
var locationArrayName = [<?php for($c=0;$c<$total_ouvintes;$c++){echo '"'."Ouvinte: $contip[$c]".'",';}?>];
var myOptions = {
zoom: 2,
center: new google.maps.LatLng(5,-20),
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById("mapa_ips"), myOptions);
for(var cont = 0; cont < locationArray.length; cont++) {
var marker = new google.maps.Marker({
position: locationArray[cont],
title: locationArrayName[cont]
});
marker.setMap(map);
}
}