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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值