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
| function initCarte() {
var i, nb = data.length;
var monIconPerso = new google.maps.MarkerImage("http://www.xxxxxxx.fr/img/sc.gif",
/* dimensions de l'image */
new google.maps.Size(30, 30),
/* Origine de l'image 0,0. */
new google.maps.Point(0, 0),
/* l'ancre (point d'accrochage sur la map) du picto
(varie en fonction de ces dimensions) */
new google.maps.Point(0, 0)
);
var oMap = new google.maps.Map(document.getElementById('div_carte'), {
'center': new google.maps.LatLng(47, 4),
'zoom': 5,
'minZoom': 5,
'maxZoom': 7,
'backgroundColor': '#fff',
'mapTypeId': google.maps.MapTypeId.HYBRID
});
var coucheMeteo = new google.maps.weather.WeatherLayer();
coucheMeteo.setMap(oMap);
Marker = new google.maps.Marker({
'map': oMap,
'position': oMap.getCenter(),
title: "Centre Carte"
});
for (i = 0; i < nb; i++) {
oMarker = new google.maps.Marker({
'optimized': false,
'map': oMap,
icon: monIconPerso,
'position': new google.maps.LatLng(data[i][0], data[i][1])
});
}
}
// init lorsque la page est chargée
google.maps.event.addDomListener(window, 'load', initCarte);
</script>
</head >
<body>
<div id = "div_carte"> </div>
</body>
</html> |
Partager