Public Function DrawEditShapes() As ActionResult Return View() End Function _ Public Sub SaveMap(map As Map, args As GeoCollection(Of Object)) Dim features As Collection(Of Feature) = MapHelper.ConvertJsonToFeatures(args(0).ToString()) Dim dynamicOverlay As LayerOverlay = DirectCast(map.CustomOverlays("DynamicOverlay"), LayerOverlay) Dim shapeLayer As MsSql2008FeatureLayer = DirectCast(dynamicOverlay.Layers("shapeLayer"), MsSql2008FeatureLayer) shapeLayer.Open() For Each feature As Feature In features shapeLayer.EditTools.BeginTransaction() shapeLayer.EditTools.Update(feature) shapeLayer.EditTools.CommitTransaction() Next map.EditOverlay.Features.Clear() End Sub _ Public Function EditShape(map As Map, args As GeoCollection(Of Object)) As String Dim dynamicOverlay As LayerOverlay = DirectCast(map.CustomOverlays("DynamicOverlay"), LayerOverlay) Dim shapeLayer As MsSql2008FeatureLayer = DirectCast(dynamicOverlay.Layers("shapeLayer"), MsSql2008FeatureLayer) shapeLayer.Open() Dim features As Collection(Of Feature) = shapeLayer.FeatureSource.GetFeaturesByIds(New Collection(Of String)() From { _ "10", _ "20", _ "30" _ }, ReturningColumnsType.NoColumns) Dim featuresJson As String = MapHelper.ConvertFeaturesToJson(features) Return featuresJson End Function