On Aug 27, 9:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Aug 27, 8:49 am, ewjsong <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I'm a beginner and I just started to create a simple google map by
> > following the example from google site. However, I have problem to get
> > GLatLng value. Here is my code:
>
> > function initialize() {
> > if (GBrowserIsCompatible()) {
> > map = new GMap2(document.getElementById("map_canvas"));
> > geocoder = new GClientGeocoder();
> > //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
> > alert(geocoder.getLatLng("1260 Lancaster Dr. S.E. Salem OR"));
>
> > }
> > }
>
> > I commented out the sample code which is not the value I wanted, but I
> > got "undefined" return instead, no actual GLatLng value. Please help!
>
> The geocoder is asynchronous.  You have to wailt for the response to
> come back.  Mike Williams tutorial should give you some working
> examples (or the documentation...)http://econym.googlepages.com/index.htm

See the documentation example (you are not implementing the call back
function)
http://code.google.com/apis/maps/documentation/services.html#Geocoding
> > alert(geocoder.getLatLng("1260 Lancaster Dr. S.E. Salem OR"));
won't work.
 geocoder.getLatLng("1260 Lancaster Dr. S.E. Salem OR",
function(point) { alert(point); });
Might (but probably isn't what you want)...

  -- Larry


>
>   -- Larry- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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