I am using a custom image marker overlay on my maps. The overlay is shown down to specified zoom level, then I switch to a different overlay. The high level marker overlay causes errors when using any buttons with server side calls. The error I get is very vague:
Server Error in '/' Application.
Error binding to target method.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Error binding to target method.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Error binding to target method.]
System.Delegate.CreateDelegate(Type type, Object target, String method, Boolean ignoreCase, Boolean throwOnBindFailure) +7575934
System.Delegate.CreateDelegate(Type type, Object target, String method) +12
ThinkGeo.MapSuite.WebEdition.MarkerOverlay.x7f7af3ab7e11f7b1(Object x28db80135f012008) +160
ThinkGeo.MapSuite.WebEdition.Map.x8fada0c5bad2e61c() +362
ThinkGeo.MapSuite.WebEdition.Map.LoadViewState(Object savedState) +264
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +183
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
System.Web.UI.Page.LoadAllState() +312
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661
Here is the code I am using to build the overlay: Dim immO As New InMemoryMarkerOverlay("mapMarkers")
Private Sub DefineIndoorMapMarkerLayer()
'Define imm (indoor map marker) layer
immO.IsBaseOverlay = False
immO.FeatureSource.Open()
'Set display options
immO.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage = New WebImage("../media/images/blueprint_60.png", 50, 55, -10.5F, -25.0F)
immO.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.AutoSize = True
immO.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = "[#MAPNAME#]"
immO.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level14
Dim colMAPNAME As New FeatureSourceColumn("MAPNAME")
immO.Columns.Add(colMAPNAME)
End Sub
Protected Function AddIndoorMapMarker(ByVal mapMarkerOverlay As InMemoryMarkerOverlay, _
ByVal Lon As Double, ByVal Lat As Double, _
ByVal MapName As String) As InMemoryMarkerOverlay
'mapMarkerOverlay.Markers.Add(New Marker(Lon, Lat, New WebImage("/theme/default/img/ap_60.png", 21, 25, -10.5F, -25.0F)))
Dim values(0) As String
values(0) = "MAPNAME:" & MapName.Trim
Dim fMap As New Feature(New Vertex(Lon, Lat), MapName.Trim, values)
mapMarkerOverlay.Features.Add(fMap)
Return mapMarkerOverlay
End Function
'Called from another sub:
DefineIndoorMapMarkerLayer()
immO = AddIndoorMapMarker(immO, -119.764329, 39.446474, "Reno Office")
thisMap.CustomOverlays.Add(immO)
What am I doing wrong here? I guess I will try to use a simple marker overlay for now and just leave it there for low zoom levels.