This project is read-only.

Reading longitude and latitude after marker move

Dec 9, 2010 at 12:54 PM
Edited Dec 9, 2010 at 12:56 PM

I have a single marker, I'm reading and storing latitude and longitude for it in xml file. Idea is to save the value from that draggable marker on button click.

In v4, to read current long/lat info after moving the marker, I could simply pass GoogleMap1.Markers[0].Longitude and GoogleMap1.Markers[0].Latitude values to my method on button click. However, when I do this in v5 long/lat values I pass are the same as when I first loaded the marker.

Do I now need to handle an event or use javascript to achive this?

Thank you

Dec 9, 2010 at 4:54 PM

I'm using a javascript technique that worked fine in 4.1 but in v5 it is not updating the long/lat values either. I need advice on a fix too. The code is:

    <script type="text/javascript">
       function showInfo(marker) {
           document.getElementById("<%# TextLat.ClientID %>").value = this.getLatLng().lat();
           document.getElementById("<%# TextLng.ClientID %>").value = this.getLatLng().lng();

        <artem:GoogleMap ID="GoogleMap1" runat="server" >
                <MarkerEvents OnClientDragEnd="showInfo"  />