Bonjour,
j'ai un souci avec les markers, j'arrive bien a tous les afficher, le tooltip fonctionne bien pour chaque marker, mais tous les listeners fonctionne sur le dernier élément de mon tableau
si quelqu'un sait pourquoi j'ai ce problème je suis tout ouï
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 var map = new Mappy.api.map.Map({container:"#mymap"}); var markerLayer = new Mappy.api.map.layer.MarkerLayer(40); map.addLayer(markerLayer); var icon = new Mappy.api.ui.Icon(Mappy.api.ui.Icon.DEFAULT); for (i=0; i<coordonneesTab.length; i++) { temp = coordonneesTab[i]; lgt = temp[0]; lat = temp[1]; idFD = temp[2]; address = temp[3]; //alert(address); map.setCenter(new Mappy.api.geo.Coordinates(lgt,lat),10); icon.label = i+1+((currentPage-1)*10); var marker = new Mappy.api.map.Marker(new Mappy.api.geo.Coordinates(lgt, lat), icon); marker.addToolTip(address); markerLayer.addMarker(marker); marker.addListener("click", function (){ marker.openPopUp(address); //loadFD(idFD); });
Merci
Partager