Bonjour, j'utilise un fichier txt pour intégerer des makers peronalisés . C'est maker sont geolocalisés et exploité par l api tres correctement via un fichier txt qui est inclus en php. Je voudrais exploité un deuxième fichier pour générer qui lui devra généner des maker de couleur différent . comment puis je faire ..... Je vous present une partie du code . Merci d'avance de vos réponses.
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 var locations = [ <?php include("test/fog/fichier.txt");?> ]; var infowindow = new google.maps.InfoWindow(); var monIconPerso = new google.maps.MarkerImage("pictos/Point1.png"),i; <--------------- voici le premier maker eploité par le fichier txt ci-dessus for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ icon : monIconPerso, position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); } } google.maps.event.addDomListener(window, 'load', initialize); </script> <div id="maCarte"> </div>
Cordialement







Répondre avec citation
Partager