GoogleMap Control 6.0 and add markers server side

Nov 10, 2011 at 10:00 AM

Hi,

This is probably simple but i cant see it in the new documentation.

In the old control we used to clear and add markers on the serverside as follows -

 GoogleMap1.Markers.Clear()
 GoogleMap1.Markers.Add(Marker1)

How do we do this now with control 6.0. 

I have already used the datasource from a sql server db with control 6.0 for loading points and it works great. But in this case i want to just load a couple of values quickly on the serverside.

NB For any one using datasource, make sure your long and lat DB fields are not in varchar etc format as this got a cast error for me...use float etc 

Thanks...

 

 

Nov 14, 2011 at 2:27 PM

hi,

it was the 'targetcontrolID' that i was missing.  i got this working by the below in the aspx page -

<artem:GoogleMap ID="GoogleMap1" runat="server"Zoom="11" EnableScrollWheelZoom="true"  MapType="Roadmap">
        </artem:GoogleMap>
      
        <artem:GoogleMarkers ID="GoogleMarkersK" TargetControlID="GoogleMap1" runat="server" >
            <Markers>
        
            </Markers>
            <MarkerOptions Draggable="true">
            </MarkerOptions>
        </artem:GoogleMarkers>

 

then in the code behind -

 GoogleMarkersK.Markers.Clear()
  Dim marker1 As Marker = New Marker
        marker1.Address = txtAddress.Text
        marker1.Info = txtAddress.Text
        'marker1.Text = txtAddress.Text
        marker1.Draggable = True
        GoogleMarkersK.Markers.Add(marker1)

 

Feb 19, 2012 at 7:58 AM

Hii Kieran,

I added many markers as you described above, but the info window dont auto close when click on other marker. How to auto info window close when click on another marker.

 

Thanks,