|
|
Utiliser l'API Google Maps
> Utiliser XML, les sources
|
|
|
Le fichier XML que nous utilisons, qui doit impérativement être encodé en UTF-8 :
<?xml version="1.0" encoding="utf-8" ?>
<markers>
<marker lat="48.9" lng="2.3" info="Premier endroit" details="Quelques informations supplémentaires" />
<marker lat="49" lng="3" info="Deuxième endroit" details="Quelques informations supplémentaires" />
<marker lat="48.2" lng="2.7" info="Troisième endroit" details="Quelques informations supplémentaires" />
<marker lat="48.5" lng="2.4" info="Quatrieme endroit" details="Quelques informations supplémentaires" />
</markers>
Notre fichier XHTML :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Utilisation de XML</title>
<script src="http://maps.google.com/maps?file=api&v=2"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() );
return marker;
}
GDownloadUrl("donnees.xml", function(data)
});
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 600px; height: 200px"></div>
</body>
</html>
Exemple de code HTML pour les infobulles :
- <marker lat="48.2" lng="2.7" info="Troisième endroit" details="Grâce à HTML, nous pouvons utiliser des images : <br/> <img src='http://www.google.com/intl/fr_fr/images/maps_results_logo.gif'/> " />
|
|
|
| Copyright
2006 Benchmark Group - 69-71 avenue Pierre Grenier, 92517 Boulogne Billancourt Cedex, FRANCE |
|