您的位置:首页 > 移动开发

MapXtreme2005之WinApp开发----基本工具

2008-07-14 16:30 477 查看
MapInfo.Tools
命名空间包含用于 MapXtreme 中所有桌面工具的常用自定义 Tool 定义。
MapTools
集合是 MapControl 基类
MapInfo.Mapping.FeatureViewer
的成员。
View 工具是
ZoomIn、ZoomOut、Center 和 Pan。


常用 Select 工具包括:
SelectPoint、SelectPolygon、SelectRect、SelectRadius 和 SelectRegion。


SelectPoint 工具允许用户移动对象、调整对象的大小和旋转对象。Select 节点模式允许用户将独立点移动、增加或删除到对象和从对象移动、增加或删除独立点。使用 SelectRect、SelectRadius 和 SelectPolygon 工具,动态 Selection 显示当鼠标移动时何种对象可以在选择集内。

Add Feature 工具包括:
AddPoint、AddLine、AddPolyline、AddPolygon、AddCircle、AddEllipse 和 AddRectangle
。每个 Add 工具都具有样式和插入图层属性。

要将常用 Tool 分配给鼠标 LeftButton、MiddleButton 和 RightButton,则为适当的鼠标按键属性使用以下字符串工具名称:"Arrow"、"ZoomIn"、"ZoomOut"、"Center"、"Pan"、"Select"、"SelectRect"、"SelectRadius"、"SelectPolygon"、"SelectRegion"、"AddPoint"、"AddLine"、"AddPolyline"、"AddPolygon"、"AddRectangle"、"AddCircle"、"AddEllipse"、"AddText" 和 "Label"。



上面截图中几个工具按钮对应的代码为:
private void btnZoomIn_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "ZoomIn";
}

private void btnZoomOut_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "ZoomOut";
}

private void btnPan_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "Pan";
}

private void btnSelect_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "Select";
}

private void btnLayerControl_Click (object sender, EventArgs e)
{
LayerControlDlg laydlg = new LayerControlDlg();
laydlg.Map = MainMap.Map;
laydlg.LayerControl.Tools = MainMap.Tools;
laydlg.ShowDialog();
}

private void btnCenter_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "Center";
}

private void btnLabel_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "Label";
}

private void btnSelectRect_Click (object sender, EventArgs e)
{
MainMap.Tools.LeftButtonTool = "SelectRect";
}

Mapxtreme2005V6.7 + VS2005
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: