No, that code won't work at all, for a few different reasons. What is it you're trying to do there? Just create the GIcon and the GMarker and add it to the map. You don't need to worry about whether the image has been downloaded yet - let the browser take care of it.
-Mike > From: Jorge > > Ok. So, I want to prevent comunication errors, repeating the > call to the servlet N times to get the image. Do you think > that this code works? > > var times = N; > while (times-- && marker.getIcon().image == null) > map.addOverlay(marker); > > I'll do the test... > > Thank you very much! > > On 19 nov, 01:39, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > On Nov 18, 4:20 am, Jorge <[EMAIL PROTECTED]> wrote: > > > > > Hello, I have a question about the use of GIcon class. > > > > > I use a custom image, provided by a servlet, with this code: > > > > > var icon = new GIcon(); > > > icon.image = "http://myapp/getImage?id=" + imageId; > > > (...) > > > > > Then, I create a GMarker with my icon and add the marker > to the map > > > with map.addOverlay(marker); > > > > > The question is: When do I get my image? When I assign the URL to > > > icon.image? When I call the addOverlay method? > > > > The API will make its request for the icon image when you call > > addOverlay. > > > > -- Larry > > > > > > > > > Thanks in advance! > > > Jorge --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
