Thank you very much. This has worked perfectly.
Thanks for your help.


KAREN McCHESNEY | STYLE LIBRARY LTD | ACCELERATED DESIGN LTD |
www.accelerateddesign.co.nz | MOBILE: 021 394 395 | PHONE: 09 358 2641 |
FAX: 09 358 2641 |  UNIT E/326 NEW NORTH ROAD, EDEN TERRACE, AUCKLAND, NEW
ZEALAND
____________________________________________________________________________
__________
CAUTION: This email contains information which is CONFIDENTIAL and may be
subject to LEGAL PRIVILEGE. 
If you are not the intended recipient you must not peruse, use, disseminate,
distribute or copy this email or attachments.
If you have received this in error, please notify us immediately by return
email, facsimile or telephone and delete this email.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Andrew Leach
Sent: Monday, 15 March 2010 11:57 p.m.
To: Google Maps API
Subject: Re: Marker setImage changing image for the wrong marker

On Mar 15, 1:04 am, Kareb <[email protected]> wrote:
> Hi,
>
> I am using .setImage to change the image for a marker. Howevere it is
> changing the image for the wrong marker.
>
> I have set up a simplified example
athttp://www.homeforhire.com/googlemaptest.aspx

It works for me, but the problem is the asynchronous nature of
geocoding. You are geocoding four addresses, and you have no control
over which one finishes first.

So you could end up creating the marker with markerIndex 1 before
marker zero. However, you are simply pushing markers on to the
markers[] array in the order in which they are created. In this case
what you want to be marker 1 will be in position zero in the array.

A fix would be to replace
  markers.push(marker);
with
  markers[markerIndex] = marker;
as that would tie the marker to the index number you have given it.

-- 
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en.

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2735 - Release Date: 03/15/10
08:33:00

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-api?hl=en.

Reply via email to