On 3 December 2010 19:54, Yellowstone <[email protected]> wrote:
>
> I have a map canvas, the map's center is displayed below it, and every
> time the user drags it the value is updated. It works perfectly if I
> use a <span> container to display it, but what I really want is an
> <input> field. I can't get the value to update in the input field, it
> stays at the initial value. Any suggestions? Thanks! :)
What does this have to do with the Maps API?
> Here's my code:
> google.maps.event.addListener(map, 'dragend', function() {
> mapCenter = map.getCenter();
> document.getElementById("mcenter").innerHTML = mapCenter; });
>
>
> This updates: <span id="mcenter"></span><br/>
> This does not update: <input type="text" name="name" id="test"
> value="">
What happens if you include the "test" element in the dragend
listener? Currently you only set it once and then forget it.
--
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.