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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
<script src="http://maps.google.com/maps?file=api&v=2.93&key=ABQIAAAAIRfOhVI_QbNxbeD4t42jChSElWySQjuLCY4-l24PUO45jPmrSRSE1qOtQDx1O4SBlfGIfKvQaE_jtA" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function load() {
if (GBrowserIsCompatible()) {
var MaCarte = new GMap2(document.getElementById("map"));
// centrage et niveau de zoom initial
MaCarte.setCenter(new GLatLng(43.08393444692567, 6.01226806640625), 11);
// affichage du contrôle de positionnement et de zoom
MaCarte.addControl(new GLargeMapControl());
// affichage du type de carte (carte, satellite, mixte)
MaCarte.addControl(new GMapTypeControl());
}
}
var geocoder = new GClientGeocoder();
function AfficherAdresse(addresse) {
if (geocoder) {
geocoder.getLatLng(
addresse,
function(point) {
if (!point) {
alert('Impossible de geolocaliser cette adresse ' + addresse);
} else {
markerAD2 = new GMarker(point, {draggable: false, title: 'Arrivée'});
MaCarte.addOverlay(markerAD2);
}
}
);
}
}
</script>
</head>
<body onload="load()" onunload="GUnload()">
<form action="#" name="formulaire" onSubmit="AfficherAdresse(this.addresse.value); return false">
Adresse postale de départ :
<input type="text" size="60" name="addresse" id="adresse" />
<input type="submit" value="Valider" />
<br />
</p>
</form>
<div id="map" style="height:600px; width:800px;"></div>
</body>
</html> |
Partager