鹰眼
map对象的CtlBounds是当前可视地图区域的边框矩形,可以用CtlBounds生成鹰眼。
If Not m_mxMapEE Is Nothing Then
Dim mxPoints As New MapXLib.Points
Dim mxRectangle As New MapXLib.Rectangle 'MapXLib.Rectangle
Dim mxFeature As New MapXLib.Feature 'MapXLib.Feature
Dim mxStyle As New MapXLib.Style
Dim mxFeatures As MapXLib.Features
'删除之前的鹰眼框
mxFeatures = m_mxMapEE.Layers.Item("lish").AllFeatures
If Not mxFeatures Is Nothing Then
For i As Integer = 1 To mxFeatures.Count
m_mxMapEE.Layers.Item("lish").DeleteFeature(mxFeatures.Item(i))
Next
End If
'生成新的鹰眼框
mxRectangle = m_mxMap.CtlBounds mxPoints.AddXY(mxRectangle.XMax, mxRectangle.YMax, 1)
mxPoints.AddXY(mxRectangle.XMax, mxRectangle.YMin, 2)
mxPoints.AddXY(mxRectangle.XMin, mxRectangle.YMin, 3)
mxPoints.AddXY(mxRectangle.XMin, mxRectangle.YMax, 4)
mxPoints.AddXY(mxRectangle.XMax, mxRectangle.YMax, 5)
mxStyle.LineColor = 16711680
mxStyle.LineWidth = 2
mxStyle.LineStyle = 1
mxFeature = m_mxMapEE.FeatureFactory.CreateLine(mxPoints, mxStyle)
m_mxMapEE.Layers.Item("lish").AddFeature(mxFeature)
End If