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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
| <html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Carte des clients</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="utils.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
// Set the Map variable
var map;
function ajaxGet(url, callback) {
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (4 === req.readyState) {
if (200 === req.status) {
callback(req.responseText);
} else {
alert('La requête a échoué !\n' +
'(code = ' + res.status + ', ' + req.statusText + ')');
}
}
};
req.open('GET', url);
req.send();
}
function initialize() {
var myOptions = {
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infoWindow = new google.maps.InfoWindow;
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
// Set the center of the map
var pos = new google.maps.LatLng(46.368333, -0.596111);
map.setCenter(pos);
ajaxGet('json_mysql_2.php', function(responseText) {
var tMarker = JSON.parse(responseText);
});
setMarkers(map, tMarker)
};
function setMarkers(map, tMarker) {
for (var i in tMarker) {
var lat = tMarker[i].lat;
var lng = tMarker[i].lon;
var locNr = tMarker[i].locNr;
var nom = tMarker[i].nom;
var city = tMarker[i].city;
var land = tMarker[i].land;
var fixe = tMarker[i].fixe;
var portable = tMarker[i].portable;
var informatique = tMarker[i].informatique;
var exploitation = tMarker[i].exploitation;
var internet = tMarker[i].internet;
var telecoms = tMarker[i].telecoms;
var telephonie = tMarker[i].telephonie;
var poste = tMarker[i].poste;
var tvadsl = tMarker[i].tvadsl;
var canalsat = tMarker[i].canalsat;
var home = tMarker[i].home;
var lecteur = tMarker[i].lecteur;
var videosurveillance = tMarker[i].videosurveillance;
var detecteur = tMarker[i].detecteur;
var radio = tMarker[i].radio;
var latlngset = new google.maps.LatLng(lat, lng);
var oMarkOpt = {
position: latlngset,
map: map,
title: city
};
var marker = new google.maps.Marker(oMarkOpt);
var contentInfoWindow = ['<div id="InfoText">', '<div class ="tabs">', '<ul>', '<li><a href="#tab1">General</a></li>','<li><a href="#tab2">Configuration</a></li>','<li><a href="#tab3" id="SV">Street View</a></li>', '</ul>', '<div id="tab1">', '<h3><font color=\"#8A40A4\">' + nom + '</font></h3>', '<p>' + locNr + '<BR>' + city + '<BR>' + land + '<BR><BR>Téléphone fixe : ' + fixe + '<BR>Téléphone portable : ' + portable + '</p>', '</div>', '<div id="tab2">', '<p><font color=\"#8A40A4\">Informatique : </font>' + informatique + '<BR>Système d\'exploitation : ' + exploitation + '<BR>Connexion Internet : ' + internet + '<BR>Opérateur Télécoms : ' + telecoms + '<BR>Téléphonie : ' + telephonie + '<BR>Nbre de postes téléphoniques : ' + poste + '<BR>TV sur ADSL : ' + tvadsl + '<BR>CanalSat : ' + canalsat + '<BR>Home Cinéma : ' + home + '<BR>Lecteur DVD : ' + lecteur + '<BR>Système de vidéosurveillance : ' + videosurveillance + '<BR>Détecteur de fumée : ' + detecteur + '<BR>Radio Numérique : ' + radio + '</p>', '</div>', '<div id="tab3">', '<div id="pano"></div>', '</div>'].join('');
var infoWindowOptions = {
content: contentInfoWindow,
position: latlngset
};
var infowindow = new google.maps.InfoWindow(infoWindowOptions);
setEventMarker(marker, infowindow);
} // For
};
function setEventMarker(marker, infowindow) {
google.maps.event.addListener(marker, "click", function () {
infowindow.open(this.getMap(), this);
});
var panoramaOptions = {
position: marker.position
};
google.maps.event.addListener(infowindow, 'domready', function () {
$(".tabs").tabs();
$('#SV').click(function () {
var panorama = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
map.setStreetView(panorama);
});
});
};
// Initializes the Google Map
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<style>
#infotext {
font-size:12px;
width:480px;
height:380px;
}
.tabs {
width:450px;
height:350px;
}
#pano {
width:350px;
height: 250px;
}
</style>
</head>
<body>
<div id="map_canvas" style="width:100%; height:100%"></div>
<!-- <div id='pano' style='position: absolute: top: 40px; left: 2px; width: 380px; height:290px;'></div> -->
</body>
</html> |
Partager