现在的位置: 首页 > 综合 > 正文

MapXtreme2005之WinApp开发—-基本工具

2013年10月08日 ⁄ 综合 ⁄ 共 1631字 ⁄ 字号 评论关闭

MapInfo.Tools

命名空间包含用于 MapXtreme 中所有桌面工具的常用自定义 Tool 定义。MapTools 集合是 MapControl 基类 MapInfo.Mapping.FeatureViewer 的成员。

View 工具是 ZoomInZoomOutCenter Pan

常用 Select 工具包括:SelectPointSelectPolygonSelectRectSelectRadius SelectRegion

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

Add Feature 工具包括:AddPointAddLineAddPolylineAddPolygonAddCircleAddEllipse AddRectangle。每个 Add 工具都具有样式和插入图层属性。

要将常用 Tool 分配给鼠标 LeftButtonMiddleButton 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

抱歉!评论已关闭.