Reimers.dk

.NET, AJAX and Google APIs brought together
Welcome to Reimers.dk Sign in | Join | Help
in Search

Does Polygon.Hide Work?

Last post 10-13-2009, 0:37 by jjrdk. 1 replies.
Sort Posts: Previous Next
  •  10-12-2009, 14:01 2803

    Does Polygon.Hide Work?

    Hi! I a previous post of mine I was asking about the hide functionality of a polygon. No matter what I've tried I can't get it to work.

    I have a simple overlay collection with polygons. I iterate thru the collection using a for each - next block as shown below (VB.net):

     

    for each item in myOverlayCollection

    dim retval as string = item.hide(myMap)

    ScriptManager.RegisterClientScriptBlock(Me.Page, Me.Page.GetType, "HideOverlay", retval, True)

    next item

     

    This is all executed from a button on my page.

    All the items in the overlay collection are polygons.

    The Map Control resides in an Update Panel that gets triggered from the button click event. The button obviously is not in an Update Panel.

    My problem is that when I click the button, the map completely disappears.

     

    Any help would be very much appreciated...

    If you need more data I can provide you with my full code-behind and markup...

     

    Oh! And one more thing. When I load more than 300 polygons it gets rediculously slow. Is it me or is it Google? (not the control obviously).

     

     


    CU@theBitter.end
  •  10-13-2009, 0:37 2805 in reply to 2803

    Re: Does Polygon.Hide Work?

    I think I answered the first bit in your initial post.

    Regarding update panels, then I have written a couple of posts about why they are bad together with maps, so you should really move the map out of the update panel. This way you can use the control's built in callback behavior to trigger serverside event handling.

    Finally about the many polygons. That is maybe not even Google's fault. HTML based maps really shouldn't have more that 150 overlays on, unless you want to kill performance. If you need that many overlays, have a look at doing the map in Silverlight. 

View as RSS news feed in XML