This project is read-only.

Drag marker then Open InfoWindow??

Sep 14, 2009 at 2:35 PM

Hey

Firstly thank you for the great map control:-)

I would like to know how do I ........open the info window of the draggable marker after it was dragged to a new location

Im sure there a lot of people that  faced this or will face this in the future

Thank you for your help and advise , I greatly appreciate your time for helping me

Kind Regards

Jake

Sep 14, 2009 at 6:56 PM

Ok I got this to work

For anyone in the future that need this..... hope this code helps you

 

 

<input type="text" id="Label1"  visible="false" readonly="readOnly"/>
    <input type="text" id="Label2"  visible="false" readonly="readOnly"/><br />

    <br />

    <br />
<br />
    <script type="text/javascript">
  function __showInfo(point) {
        if(point) {
            document.getElementById('Label1').value = point.lat();
            document.getElementById('Label2').value = point.lng();
        }
        
        
    }
    
    
    </script>
<script type="text/javascript">
function showInfoWindow(index) {
    var marker = GoogleMap1.Markers[index];
    marker.openInfoWindowHtml("HELLO");
}
</script>


<artem:GoogleMap ID="GoogleMap1" runat="server" Width="800px" Height="500px"
        Address="South Africa" Zoom="5"  OnClientMapLoad="setTimeout('showInfoWindow(0)', 1000)" EnableContinuousZoom="true"  EnableDoubleClickZoom="true" EnableDragging ="true"  EnableMarkerManager="true" EnableScrollWheelZoom="true" ShowMapTypeControl="true" ZoomPanType= "Large3D"    >
    <MarkerEvents OnClientDragEnd="__showInfo"  OnClientDragStart="setTimeout('showInfoWindow(0)', 1000)"/>
</artem:GoogleMap>

 

 

codebehind vb

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      
        If Not IsPostBack Then
            Dim address As String = "George, South Africa"
            Dim marker As New GoogleMarker()
            marker.Draggable = True
            marker.Address = address

            marker.Text = "This is a draggable marker test"
            marker.Title = "Click on the marker" 'actually a tooltip





            GoogleMap1.Markers.Add(marker)


        End If
       
    End Sub