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
| <!-- RECUPERATION DES PTS GPS -->
downloadUrl("FICHIERXML", function(data) {
var xml = parseXml(data);
var marqueurs = xml.documentElement.getElementsByTagName("marqueur");
for (var i = 0; i < marqueurs.length; i++) {
var level = '<br /><li>Niveau Recommandé : ' + marqueurs[i].getAttribute('level') + '</li>' ;
var notation = '<br /><li>Intéret de la plongée : ' + marqueurs[i].getAttribute('notation') + ' sur 5 ' + '</li>' ;
var prof = '<br /><li>Profondeur Maximale : <font color=#FF0000>-' + marqueurs[i].getAttribute('prof') + ' Mètres ' + '</font></li>';
var gps = '<br /><li>Coordonnées GPS : ' + marqueurs[i].getAttribute('gps') + '</li></ul>' ;
var url = '<br /><center><a href="/' + marqueurs[i].getAttribute('url') + '" target="_blank">Description Complete </a></center>';
var type = '</u></strong><br /><ul><li>Type de Plongée : ' + marqueurs[i].getAttribute('type') + '</li>' ;
var nom = '<strong><u>' + marqueurs[i].getAttribute('nom');
var ile = marqueurs[i].getAttribute('ile');
var point = new google.maps.LatLng(
parseFloat(marqueurs[i].getAttribute("latitude")),
parseFloat(marqueurs[i].getAttribute("longitude")));
var marqueur = new google.maps.Marker({
map: carte,
position: point,
title: marqueurs[i].getAttribute('nom'),
icon: iconeVert
});
// Contenu de la fenetre
var contenu = {
content: nom + type + notation + level + prof + gps
};
// Création de la fenêtre
var deselectCurrent = function() {};
var fenetreinfo = new google.maps.InfoWindow(contenu);
// Affichage de la fenêtre au click sur le marker
google.maps.event.addListener(marqueur, 'click', function() {
deselectCurrent();
fenetreinfo.open(carte,this);
carte.setZoom(15);
});
}
});
} |
Partager