Hi there,
Tearing my hair out trying to figure out why all the infoWindows are displaying
the same content even though I'm using function closure to pass in the
individual marker and its contents. Here is the code which is being tested out
at http://eclipse3testconstruct.companionit.net/, on a side note, we're a
premier client-id user of the API.
{ varjobAppointments = appointments.split('|'); varj = 1;
varpushPinURL = $get('<%=hdnPushPinURL.ClientID%>').value;
for(vari = 0; i < jobAppointments.length; i++)
{ varriskAddress = jobAppointments[i].split('^')[0]; varcomments =
(jobAppointments[i].split('$')[1].indexOf('`')) ?
jobAppointments[i].split('$')[1].split('`')[0] : '';
geocoder.geocode({
{ if(status == google.maps.GeocoderStatus.OK) {
if(jobHasAppointment == jobHasAppointments.Yes)
map.setCenter(results[0].geometry.location);
{ varappointmentMarkerImage =
newgoogle.maps.MarkerImage(pushPinURL + j++ + ".png") varmarker
=
newgoogle.maps.Marker({'job#: '+ jobID, else
icon: appointmentMarkerImage,
map: map,
title:
position: results[0].geometry.location
});
points.push(results[0].geometry.location);
}
{ varmarker = newgoogle.maps.Marker({'job#: '+
jobID,function(jobID, comments, marker)
map: map,
title:
position: results[0].geometry.location
});
}
(
{'click', function() { varinfowindow =
newgoogle.maps.InfoWindow; varcontent = '<div
class="infowindow">comments + '</div>';this);else
google.maps.event.addListener(marker,
infowindow.setContent(content);
infowindow.open(map,
});
})(jobID, comments, marker);
}
{"Geocode was not successful for the following reason: "+ status);
alert(
}
});
}
}
'address': riskAddress }, function(results, status) functionsetMarkers(map,
appointments, jobHasAppointment)
--
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.