Bonjour,

J'utilise un script JavaScript pour afficher des points reliés par des lignes sur une carte du monde dans une application Delphi
.
Ce script fonctionne bien, mais je souhaiterais le modifier pour ajouter des InfoWindow affichant le nom de ces points sur chacun d'entre eux.
Voici le script:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'<html> '+
'<head> '+
'<meta name="viewport" content="initial-scale=1.0, user-scalable=yes"/> '+
'<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true&v=3.22"></script> '+   //24/08/2016 (...&V=3.22 au lieu de V=3...)
'<script type="text/javascript"> '+
'  var map;'+
'  var polyline = [];'+
'  var markersArray = [];'+
'  var Circle = { '+
'  path: google.maps.SymbolPath.CIRCLE ,'+
'  fillColor: "Red",'+
'  fillOpacity: 1.0,'+
'  scale: 3,'+
'  strokeColor:"Black",'+
'  strokeWeight: 1 '+
'};'+
''+
''+
'  function initialize() {'+
'  var myLatLng = new google.maps.LatLng(48.0,2.0);'+
'  var mapOptions = {'+
'    zoom: 5,'+
'    center: myLatLng,'+
'    mapTypeId: google.maps.MapTypeId.TERRAIN'+
'  };'+
'  map = new google.maps.Map(document.getElementById("map_canvas"),'+
'    mapOptions);'+
'}'+
''+
' function DrawTrack(FromLat,FromLng,ToLat,ToLng){'+
' var geo_path = new Array();'+
'   var geo_path = [new google.maps.LatLng(FromLat,FromLng),'+
'                     new google.maps.LatLng(ToLat,ToLng)];'+
' var Track = new google.maps.Polyline({'+
'   path: geo_path,'+
'   strokeColor: "#FF0000",'+
'   strokeOpacity: 1.0,'+
'   strokeWeight: 2'+
' });'+
''+
' polyline.push(Track);'+
' Track.setMap(map);'+
' }'+
''+
''+
' function RemoveTrack(){' +
'  if (polyline){' +
'    for(i in polyline){' +
'      polyline[i].setMap(null);' +
'    }' +
'     polyline.length =0;' +
'   }' +
'}' +
''+
' function ClearMarkers() {  '+
'  if (markersArray) {        '+
'    for (i in markersArray) {  '+
'      markersArray[i].setMap(null); '+
'    } '+
'  } '+
' Bounds = new google.maps.LatLngBounds();'+
'}  '+
''+
' var Bounds = new google.maps.LatLngBounds(); '+
' function PutMarker(Lat, Lang, Msg) { '+
'   var latlng = new google.maps.LatLng(Lat,Lang);'+
'   var marker = new google.maps.Marker({'+
'      position: latlng,'+
'      icon: Circle,'+
'      map: map,'+
'      title: Msg'+
'   });'+
''+
' Bounds.extend(latlng);'+
' map.fitBounds(Bounds);'+
'}'+
''+
''+
''+'</script> '+
'</head> '+
'<body onload="initialize()"> '+
'  <div id="map_canvas" style="width:100%; height:100%"></div> '+
'</body> '+
'</html> ';
Merci de votre aide.

Le script ci-dessus affiche une label sur chaque point lorsqu'il est cliqué. serait-il possible d'avoir ces labels affichés dès le chargement et pour tous les points. Ceci éviterait les infowindows.
Qu'en pensez vous?

Cordialement
Pierre