On Dec 14, 8:44 am, howhow <[email protected]> wrote:
> correction::
>
> first i want a thank you all for helping
>
> what i 'm trying to do is creating a function that returns the lat/ltg by
> the address:
> i did somthing like this:
>
> var pointTo = getMyLtLg ('New York City, NY, USA');
>
> function *getMyLtLg* (showAdd) {
> var address = showAdd ;
> geocoder.geocode( { 'address': address}, function(results, status) {
>
> if (status == google.maps.GeocoderStatus.OK) {
> var LtLg= results[0].geometry.location;
> return LtLg;
Geocoding is asynchronous, you can't return a value from the callback
function.
Please see the working examples in the documentation.
> }
> else { }
> });
>
Please post a link to your map that shows the problem, not code.
-- Larry
>
>
> }- Hide quoted text -
>
> - Show quoted text -
--
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.