1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!-- Fonction JS d'initialisation et de création de marqueur -->
<script type="text/javascript">
var map = null;
/* Crées la MAP */
function initialize() {
var latlng = new google.maps.LatLng(48.825, 2.39);
var myOptions = {
zoom: 7,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
<?php
include_once("../../_notes/config.php");
//Connexion Database
// DETAILS SUPRIMES
$req = 'SELECT * FROM tracking';
$result = mysql_query($req);
while ($data = mysql_fetch_array($result)) {
// on affiche les résultats
echo 'var latlng2 = new google.maps.LatLng('.$data['lat'].', '.$data['long'].');';
echo " var marker = new google.maps.Marker({
position: latlng2,
});";
echo" marker.setMap(map); ";
}
?>
}
</script> |
Partager