Hello - seems to be working now.

The variable scope was not the problem. I replaced:

markerArray[id].setImage(testicon);

with

var temp = new google.maps.MarkerImage(testicon);
markerArray[id].setIcon(temp);


And all seems to work :-)

My only issue now is the infowindow. I can update the markers onclick
event listner in my ajax callback, so that the next time that marker
is clicked the infowindow content changes. What would be nice is if I
can update the infowindow if it is already being displayed at the time
of the callback.

I tried this by putting a div inside the infowindow and using
getElementByID and innerHTML in the callback, which failed. I'll keep
trying :-)







On Aug 1, 2:23 pm, Rossko <[email protected]> wrote:
> > When the ajax call completes, I check the newly received data to see
> > if the marker needs changing. If it does, I call:
> > markerArray[id].setImage(testicon);
>
> This will be happening asynchronously, as you are using AJAX ; are you
> sure 'id' is still in scope in your AJAX callback etc.?

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