Protected Sub Map1_TrackShapeFinished(ByVal sender As Object, ByVal e As System.EventArgs) Handles Map1.TrackShapeFinished Dim dynamicOverlay As LayerOverlay = DirectCast(Map1.CustomOverlays("DynamicOverlay"), LayerOverlay) Dim shapeLayer As InMemoryFeatureLayer = DirectCast(dynamicOverlay.Layers("shapeLayer"), InMemoryFeatureLayer) Dim markerOverlay As InMemoryMarkerOverlay = DirectCast(Map1.CustomOverlays("MarkerOverlay"), InMemoryMarkerOverlay) Dim MarkeID As String = "'" For Each feature As Feature In Map1.EditOverlay.Features Dim returnMarkers As New Collection(Of Marker) Dim zoomLevel As MarkerZoomLevel = markerOverlay.ZoomLevelSet.GetZoomLevelForDrawing(GetZoomFromScale(Map1.CurrentScale, Map1.ZoomLevelSet)) If Not (IsDBNull(zoomLevel)) Then markerOverlay.FeatureSource.Open() 'returnMarkers include all markers contained within that shape returnMarkers = zoomLevel.GetMarkers(markerOverlay.FeatureSource.GetFeaturesInsideBoundingBox(feature.GetShape().GetBoundingBox(), ReturningColumnsType.AllColumns)) markerOverlay.FeatureSource.Close() For Each Marker As Marker In returnMarkers MarkeID = MarkeID + Marker.Id + "','" Next End If shapeLayer.InternalFeatures.Add(feature.Id, feature) Next End Sub