On Aug 15, 4:12 pm, Daniel Montenegro <
dmontenegr...@gmail.com> wrote:
> Hi there, Google Maps folks!
>
> Well, this is the question:
>
> Is there any diference between .getPosition() and .lat() .long() methods?
On what object? The getPosition method typically returns a
google.maps.LatLng object.
A google.maps.LatLng object tends to have .lat() and .lng() methods
which return the floating point values of those coordinates.
>
> I need to have the marker coordinates on the screen as I click on it. So I
> thought in a event like this:
>
> google.maps.event.addListener(marker, 'click', function() {
> document.getElementById('coords').value = marker.getPosition();
> });
That should work assuming marker is defined as a google.maps.Marker
object and is in scope.
>
> To work along such a form:
>
> <input type="textbox" id="coords">
>
> But unfortunnelly, Firebug is giving me a message error, saying that marker
> is not defined.
That is an entirely different problem. Most likely your "marker"
variable is not in the global scope (it is probably local to some
function).
-- Larry