On May 21, 12:49 pm, Clarus <[email protected]> wrote:
> This is the link, the markers are in Italy but in the map don't
> appear:
>
> http://www.pacchettihotel.it/maps3.htm

Don't forget that geocoding is asynchronous. Your code reaches the
line
   map.setZoom(map.getBoundsZoomLevel(bounds));
before the markers have been added to the map.

Everything which depends on the geocoded location should be inside (or
called from) the callback function for the geocoder.

Have a look at http://andrew.leach.1.googlepages.com/pacchettihotel.htm
which keeps a count of how many addresses have been geocoded and sets
the bounds once all the results are plotted.

Note 1: geocoding fixed addresses is A VERY BAD IDEA. You should
*always* use the actual coordinates of places you know about. Only
geocode locations you cannot know when you write the page, like an
address the user enters.

Note 2: my page doesn't do anything to limit the rate of geocoding,
and it will fail erratically for many more than three addresses.

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