As explained in the online doc, when reverse geocoding Lat/Lng
coordinates, you should use a property named "location" and not
"latLng" :
http://code.google.com/intl/fr/apis/maps/documentation/javascript/reference.html#GeocoderRequest

Can you copy/paste the full code (especially the function handler in
parameter to geocoder.geocode) ?

On 2 août, 02:54, haibin <[email protected]> wrote:
> hi please help me, i dont know what going on here. the follow is my
> code
>
> function selectLocation(location){
>                 if (typeof(location) == 'object'){
>                         location2 = {'latLng':location};
>                         }
>                 else {
>                         location2 = {'address': $('#map_input').val()+'
> '+location_default['country']};
>                         }
>                 //location2 = {'address': $('#map_input').val()+'
> '+location_default['country']};
>                 alert(location2['address']);
>         geocoder.geocode(location2, function(results, status){
>             ...........................
>             });
>
> my problem here is that if the location2 has the = {'address':
> 'xxxxxxx'} value from the if else statement I am getting this
> javascript error from firebug
>
> Invalid value for property <position>: homberg
> [Break on this error] V[A].bindTo=function(a,b,c,d){c=c||
> a;v...a=a.f[1])?new Ue(a):cf}var ef=new Ue; main.js (line 28)
>
> no problem with if the location has ={'latLng': xxxxx} value.
>
> But when I uncomment the line "location2 = {'address': $
> ('#map_input').val()+' '+location_default['country']};" just before
> the geocoder.gecode(....) no error occur
>
> Is there something wrong with my code?
>
> Thanks

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

Reply via email to