Hi All,
My Map has the following
<cc1:Map ID="Map1" runat="server" Width="100%" Height="100%" MapUnit="Meter" OnTrackShapeFinished="Map1_TrackShapeFinished">
</cc1:Map>
Now that works great for when my users draw a Point on the map.
But when they draw a polygon i get the following error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.0.30729; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Mon, 6 Jun 2011 13:35:30 UTC
Message: Sys.WebForms.PageRequestManagerServerErrorException: Target Shape Is Not Valid Type.
Line: 938
Char: 13
Note i have the following Code inside:
Protected Sub Map1_TrackShapeFinished(ByVal sender As Object, ByVal e As EventArgs)
Dim MapKeyId As String = "map1"
Dim SelectedMap As ThinkGeo.MapSuite.WebEdition.Map = DirectCast(Me.FindControlRecursively(MapKeyId), ThinkGeo.MapSuite.WebEdition.Map)
Dim lastPoint As Feature = SelectedMap.EditOverlay.Features(SelectedMap.EditOverlay.Features.Count - 1)
Dim textRadiusName As String = "txtRadius"
Dim textRadius As TextBox = DirectCast(Me.FindControlRecursively(textRadiusName), TextBox)
Dim ellipse As EllipseShape = New EllipseShape(lastPoint, Double.Parse(textRadius.Text))
SelectedMap.EditOverlay.Features.Add(New Feature(ellipse))
End Sub