locked
Google Maps Control Times out on Page Load RRS feed

  • Question

  • User-448731444 posted

    Hi there.  I have a google map control I am implementing that loops through a listview control and populates a google map control.  The map loads up slowly as the markers show up and then it times out and I get an error.  Anybody know if there is:

    1.  A faster way to load the map (I am new to the concept of using arrays and using its data)

    2.  Create a loader so the user sees the map markers all at once, instead of slowly populating the page. 

    Here is the code.  Your help is greatly appreciated!!

    Imports

    System

    Imports

    System.Collections

    Imports

    System.Configuration

    Imports

    System.Data

    Imports

    System.Linq

    Imports

    System.Web

    Imports

    System.Web.Security

    Imports

    System.Web.UI

    Imports

    System.Web.UI.HtmlControls

    Imports

    System.Web.UI.WebControls

    Imports

    System.Web.UI.WebControls.WebParts

    Imports

    System.Xml.Linq

    Imports

    Artem.Web.UI.Controls

    Partial

     

     

     

     

    Class aaaloopmapInherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As ListViewItemEventArgs) Handles ListView1.ItemDataBoundDim listViewDataItem As ListViewDataItem = TryCast(e.Item, ListViewDataItem)If listViewDataItem IsNot Nothing Then

     

    If e.Item.ItemType = ListViewItemType.DataItem Then

     

     

    Dim dataview As ListViewDataItem = TryCast(listViewDataItem.DataItem, ListViewDataItem)'if you binding your data to a custom type collection you will need to cast this to the appropriate custom type instead

     

    'and now get the address

     

     

     

    Dim address As String = listViewDataItem.DataItem("Address").ToString()Dim Name As String = listViewDataItem.DataItem("BarName").ToString()Dim iCounter As Integer

    GoogleMap1.Zoom =

    "12"

    GoogleMap1.ShowScaleControl =

    True

    GoogleMap1.EnableInfoWindow =

    True

    GoogleMap1.EnableMarkerManager =

    True

    GoogleMap1.EnableInfoWindow =

    True

     

    'For iCounter = Me.ListView1.Items.Count To 0 Step -1 -> if loop in reverse

     

    GoogleMap1.DataTextField = Name

     

    For iCounter = Me.ListView1.Items.Count To 0'GoogleMap1.ToolTip = Name

     

    'GoogleMap1.ShowTraffic = True

    GoogleMap1.Address = address

    GoogleMap1.Markers.Add(

     

    New GoogleMarker(address))Next

     

    End If

     

    End If

     

    End

    End Sub Class

    Thursday, January 21, 2010 2:29 PM

All replies

  • User960609757 posted

    Hi,

    check the following urls,

    http://www.shabdar.org/google-maps-user-control-for-ASP-Net-part1.html

    http://www.shabdar.org/google-maps-user-control-for-asp-net-part2.html



    Friday, January 22, 2010 12:36 AM
  • User-448731444 posted

    Thanks a lot for the map control website, but my problem is related to I believe what is called client side time-out (maybe I'm wrong).  The session seems to timeout after 30 seconds and I'm trying to increase this time.  I keep getting a script error and I've been scouring the web for an answer and have not found anything that works and maybe that is because my javascript skills are minimal to none.  Is there simple code that I can add to my aspx web page to increase the timeout?  I tried adding 

    EnableSessionState

     

    ="True"

    Tot he page tag but that does not work.

    Here is the error I keep getting:  Your help is greatly appreciated. 

    setTimeout(c,function(){})

    Saturday, January 23, 2010 4:51 PM
  • User1501715663 posted

    Did you get any work around onn this problem?. I have the same issue on this control 

    Tuesday, December 7, 2010 1:11 PM