On Jul 28, 12:44 am, kyusan93 <[email protected]> wrote: > Hi Guys, > > I really need some help here. > > I have entered 7 data in my database and all the markers' infowindows > are showing the last records. > Any way I can make it work?
Yes. 1. Read and follow the posting guidelines (post a link to your map that exhibits the problem, not code) 2. Don't geocode known points every time your page loads (that will "work" for up to about ten points, but is wasteful of the processing power on google's servers, which we all share) 3. Sounds like pitfall #3 in Mike Williams' v2 tutorial (search this group for lots of examples of that) Working example (without the geocoding): http://www.geocodezip.com/v3_MW_example_map1.html (uses function closure to associate the infowindow contents with the marker) -- Larry > > Much appreciated. > > ----------------------------------------------------------------------------------------------------------------------------------------------------- > > var marker, i; > var icon = new google.maps.MarkerImage("http://maps.google.com/ > mapfiles/ms/micons/blue.png", new google.maps.Size(32, 32), new > google.maps.Point(0, 0),new google.maps.Point(16, 32)); > > for (i = 0; i < locations.length; i++) { > getInfoAddress = "No: "+locations[i][3].toString()+" "+locations[i] > [1].toString()+" "+locations[i][2].toString()+" S("+locations[i] > [0].toString()+")"; > geocoder.geocode( { 'address': locations[i][0]}, function(results, > status) { > if (status == google.maps.GeocoderStatus.OK) { > marker = new google.maps.Marker({ > position: results[0].geometry.location, > map: map, > //animation: google.maps.Animation.BOUNCE, > icon: icon > }); > var popup = new google.maps.InfoWindow({}); > google.maps.event.addListener(marker, 'click', > function () { > popup.setContent(getInfoAddress); > popup.open(map, marker); > }); > } else { > alert("Geocode was not successful for the following > reason: " + > status); > } > });} > > ----------------------------------------------------------------------------------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
