HI
I want to drag image along with label. Need an idea or code. I can just see drag icon.
Dim pointLayer As New EditInteractiveOverlay()
Dim Rightlabel As New EditInteractiveOverlay()
Dim Icon As New ValueStyle
Dim RightTextStyle As New TextStyle()
RightTextStyle.TextColumnName = "Right Label"
RightTextStyle.TextSolidBrush = New GeoSolidBrush(GeoColor.StandardColors.Black)
RightTextStyle.Font = New GeoFont("Arial", 10)
RightTextStyle.PointPlacement = PointPlacement.CenterRight
RightTextStyle.YOffsetInPixel = 0
RightTextStyle.XOffsetInPixel = 20
'Icon Properties setting
pointLayer.DragControlPointsLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.IsActive = False pointLayer.DragControlPointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 pointLayer.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.IsActive = False pointLayer.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.IsActive = False pointLayer.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.IsActive = False
'Right Label Properties setting
Rightlabel.DragControlPointsLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.IsActive = False Rightlabel.DragControlPointsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 Rightlabel.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.IsActive = False Rightlabel.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.IsActive = False Rightlabel.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.IsActive = False
'Icon
pointLayer.EditShapesLayer.Open()
pointLayer.EditShapesLayer.Columns.Add(New FeatureSourceColumn("Type", "string", 20))
pointLayer.EditShapesLayer.Close()
Icon.ColumnName = "Type"
proj.Open()
Dim pos As Vertex = proj.ConvertToExternalProjection(47.5579, 29.7032)
proj.Close()
Dim Coordinates As New Feature(New PointShape(pos.X, pos.Y))
Icon.ValueItems.Add(New ValueItem(1, New PointStyle(New GeoImage("..\..\Images\sedan.png"))))
pointLayer.EditShapesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(Icon)
Coordinates.ColumnValues.Add("Type", 1)
pointLayer.EditShapesLayer.InternalFeatures.Add("Car", Coordinates)
pointLayer.EditShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
'Right Label
Rightlabel.EditShapesLayer.Open()
Rightlabel.EditShapesLayer.Columns.Add(New FeatureSourceColumn("Right Label", "string", 20))
Rightlabel.EditShapesLayer.Close()
proj.Open()
Dim pos1 As Vertex = proj.ConvertToExternalProjection(47.5579, 29.7032)
proj.Close()
Dim RPosition As New Feature(New PointShape(pos1.X, pos1.Y))
RPosition.ColumnValues.Add("Right Label","12")
Rightlabel.EditShapesLayer.InternalFeatures.Add(1, RPosition)
Rightlabel.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = RightTextStyle
Rightlabel.EditShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Rightlabel.CanAddVertex = False
Rightlabel.CanDrag = True
Rightlabel.CanRemoveVertex = False
Rightlabel.CanResize = False
Rightlabel.CanRotate = False
Rightlabel.CalculateAllControlPoints()
winformsMap1.EditOverlay = Rightlabel
pointLayer.CanAddVertex = False
pointLayer.CanDrag = True
pointLayer.CanRemoveVertex = False
pointLayer.CanResize = False
pointLayer.CanRotate = False
pointLayer.CalculateAllControlPoints()
winformsMap1.EditOverlay = pointLayer
winformsMap1.Refresh()
Regards,
Zeeshan