On Nov 23, 10:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am able to load map by clicking the button after the document is > loaded; however, I cannot get the map to load when the page loads. I > am loading the map from a query string parameter. > > As of now I have hard coded the address for testing. > > How do I load the map when the document is loading? > > http://googlemaps.afccinc.com > map.setCenter( geocoder.getLatLng(GetPoint('7805 new castle ct, mckinney, tx')) , 13);
The geocoder is asynchronous. It doesn't return anything useful. See: Part 2 Asynchronous I/O http://econym.org.uk/gmap/async.htm What is the purpose of this? function GetPoint(point) { if (point) return point; } the getLatLng method of the geocoder takes a string if you are doing geocoding, a GLatLng if you are doing reverse geocoding. It is not good practice to only initialize the map if the geocoder returns a valid value (the initial map.setCenter call initializes the map). -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
