ThinkGeo.com    |     Documentation    |     Premium Support

AsyncPostback not working?

Hi,


I have a map object placed inside an UpdatePanel. I also have a toolbar object placed inside another Updatepanel.


The expectation is that when a button on the toolbar is clicked, the map will refresh with new data. The map, however, does not refresh. When one zooms in or out, or resize the map's updatepanel, then the map refreshes and shows the correct information. This leads me to belief that the layer data is updated correctly, but that the map does not respond correctly to the AsyncPostBackTrigger.


Any ideas?


Thanks,


Chris



Chris, 
  
 The update panel might have cached these images so cannot refresh, Please try the following statement to redraw the layer overlay. (if you are using custom overlay, just convert it to a LayerOverlay and then call Redraw()). 
  
                    Map1.StaticOverlay.Redraw(); 
 Add/Or       Map1.DynamicOverlay.Redraw(); 
  
 If you still have problem, please let me know more like how you refreshed the map after clicking the button. 
  
 Thanks, 
  
 Ben 


Ben, 
  
 Thanks - that did the trick. I was using custom overlays and thus did not have a ReDraw at my disposal. Converting it to a LayerOverlay and then calling ReDraw() did the trick 
  
 Chris

That’s great Chris, just let us know if we can make your coding easier.

I tried this, but it did not work for me. 
 I’m using InMemoryMarkerOverlays in addition to Google and LayerOverlay. 
  
 Zooming and panning work fine, but if you click it triggers a MarkerOverlay click event. 
 This does not update the map in any way so should not require a refresh, but it does update a datagrid in another panel. 
 The datagrid updates fine, but the map turns blue and stays that way. Attempting to navigate away from the page causes a JavaScript error. 
 Is there anyway to avoid the map trying to refresh completely, or forcing it to redraw itself?

Kirk 
  
 MarkerOverlay.Click is a server part event and it will definitely cause a post back, which refreshes everything in the UpdatePanel… Could you let me know the exact javascript error you met, or it will be great if you can provide a sample to recreate this issue. 
  
 Thanks, 
  
 Ben