ThinkGeo.com    |     Documentation    |     Premium Support

Click on a marker

Hi,


I'm trying to manage clicks on markers to display an info panel.


I'm using several LayerOverlays added to CustomOverlays collection, including Google/Yahoo/VE maps.


The InMemoryMarkerOverlay itself is added to CustomOverlays collection.


The markers are correctly displayed on the map, but when I click on one of them, I obtain the following error:


Error binding to target method.


   at System.Delegate.CreateDelegate(Type type, Object target, String method, Boolean ignoreCase, Boolean throwOnBindFailure)     at System.Delegate.CreateDelegate(Type type, Object target, String method)     at ThinkGeo.MapSuite.WebEdition.MarkerOverlay.x7f7af3ab7e11f7b1(Object x28db80135f012008)     at ThinkGeo.MapSuite.WebEdition.Map.x8fada0c5bad2e61c()     at ThinkGeo.MapSuite.WebEdition.Map.LoadViewState(Object savedState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)     at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)     at System.Web.UI.Page.LoadAllState()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


 


Viewstate on the page is enabled, the map is contained in an UpdatePanel.


Do you have any suggestion?


Thanks in advance.


Fabio



Hi Fabio,



We couldn’t recreate your issue, here attached is our test sample, please have a try and check the difference.



Thanks,



Howard

 



613-Post5629.zip (14.6 KB)

Hi Howard, 
 thanks for the sample. My code didn’t work because I registered the click event and I implemented the relative click function inside a class, not in the page where the map control is designed. 
 Moving only the click function (not the click event subscription) int the page, my code correctly works. 
  
 Thanks for the support. 
 Fabio

Hi Fabio, 
  
 That’s great you fixed your issue! 
  
 In web edition, to support session serialization, we delete the event handlers temporarily before saving into session and rewire it back when the page is loaded. In order to find original event handler back, we need the event handlers within its naming container. 
  
 Any more questions, please let us know, 
  
 Thanks, 
  
 Howard