<html>
<head>
<title>Application Google Maps : Tracer une polyligne</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=
ABQIAAAAFw0lDRKsdCra15LPvIxvehS3Kl_ZRrzIrsFqDz8GBXIeW1O52xQh3P31Xg2eTvqFRAyuOMY4dQrRQw"
type="text/javascript"></script>
<script type="text/javascript">//<![CDATA[
function load()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(51.50430000000001, -0.13454000000000002), 15);
// Initialisation de l'array "maligne" préchargé par le contenu des cordonnées
// délimitant les segments constituant la polyligne
var maligne = new GPolyline([
new GLatLng(51.50135, -0.14184000000000002),
new GLatLng(51.50161000000001, -0.14113),
new GLatLng(51.501400000000004, -0.14072),
new GLatLng(51.50150000000001, -0.14032),
new GLatLng(51.50175, -0.14008),
new GLatLng(51.501990000000006, -0.14012000000000002),
new GLatLng(51.50211, -0.14004),
new GLatLng(51.505840000000006, -0.13083),
new GLatLng(51.50524000000001, -0.12946000000000002),
new GLatLng(51.50513, -0.12912),
new GLatLng(51.50529, -0.12802000000000002)
], "#990000", 8);
// Affichage de la ligne
map.addOverlay(maligne);
}
}
//]]></script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 500px"></div>
</body>
</html>
|