geocoder.geocode( {
                'address': loc
            }, function(results, status) {
                if(status=='OK'){
                    if(results[0].types[0]=='locality') var icon = '/
css/blue_mini.png';
                    if(results[0].types[0]=='country') var icon = '/
css/green_big_select.png';
                    //console.log(markers.length);
                    markers[markers.length] = new google.maps.Marker({
                        position: results[0].geometry.location,
                        map: map,
                        icon: icon
                    });
 
google.maps.event.addListener(markers[markers.length-1], 'click',
function() {/*infowindow gets only the last marker*/
                        var infowindow = new google.maps.InfoWindow({
                            content: title
                        });
 
infowindow.open(map,markers[markers.length-1]);
                    });
                }
                else alert('не удается найти объект');
            });
this code is running in cycle setting markers and infowindows by name
of input objects.. but in fact only the last maker get its infowindow
and all other makers refernse their clicks to this marker

-- 
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.

Reply via email to