MAPX中修改图元的属性值
来源:互联网 发布:苹果笔记本安装软件 编辑:程序博客网 时间:2024/05/21 10:42
procedure TForm1.Map1ToolUsed(ASender: TObject; ToolNum: Smallint; X1,
Y1, X2, Y2, Distance: Double; Shift, Ctrl: WordBool;
var EnableDefault: WordBool);
Var
i : Integer;
fID : String;
searchType : Integer;
dist : OleVariant;
pt : Variant;
curFeatures : Variant;
rc : Variant;
obj : Variant;
featureSearchLayer : Variant;ftrNew: CmapXFeature;
arrVals: Variant; //leee 030621
idx,NodeCnt:integer;
NodeString:String;
ds: CMapxDataset;
rv: CMapxRowvalue;
rvs: CMapxRowvalues;
ftr :CMapxFeature;
ftrLayer :CmapxLayer;
begin
pt := CreateOleObject('MapX.Point.5');
// Clear Search Results listif ToolNum <> SEARCH_POINT_TOOL then
begin
// Set SearchType based on what key user may have down
if (Shift And Not Ctrl) then
searchType := miSearchTypePartiallyWithin
else if (Ctrl And Not Shift) then
searchType := miSearchTypeEntirelyWithin
else
searchType := miSearchTypeCentroidWithin;
end;
if(ToolNum=miSelectTool ) then
begin
ftrLayer:=Map1.Layers.Item[1];
if (ctrl) thenftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionAppend,emptyparam)
else if (Shift) then
ftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionRemove,emptyparam)
else
ftrLayer.Selection.SelectByPoint(X1, Y1, miSelectionNew,emptyparam);if (ftrLayer.selection.count >= 1) //0306 lee 设计
then
begin
ds := Map1.Datasets.Add(miDataSetLayer, ftrLayer,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam);obj:=ftrLayer.Selection.Item[ftrLayer.selection.count]; //此处示例取得最后一个Feature ,也可用循环语句取得所有Feature
// ftrLayer.BeginAccess( miAccessReadWrite);
rvs:=ds.Rowvalues[obj];rvs._Item(1).value:=aaaaa; //为第一个字段赋值(本例图元有三个属性)
rvs._Item(2).value:=bbbbb;//为第二个字段赋值rvs._Item(3).value:=ccccc;//为第三个字段赋值
obj.Update(true,rvs);
// ftrLayer.EndAccess( miAccessEnd);end;
end;
end;
再在一个BUTTON的CLUCK事件中加入以下代码:
map1.CurrentTool:=miSelectTool;当点击这个BUTTON后,再点选图元,被选中图元的属性就可以被修改
- MAPX中修改图元的属性值
- mapx 显示新建图元的属性
- 查找图元方法中遇见的MapX的Bug
- VC中mapx图元颜色的改变
- 如何在MapX下读取属性值、自定义范围专题图、在mapx中查找对象的方法
- VB + MapX 查找最近的图元
- Mapx中创建测距工具、自动滚屏、图元的拖拽
- mapx 删除所有图元
- C#MapX添加图元
- mapx+vb图元基本操作
- VC环境中MapX一次删除图层所有图元
- VC环境中MapX一次删除图层所有图元
- MapX中使用动态图层AnimationLayer,移动图元时标注和图元分离问题解决办法。
- VC中MapX的开发
- VC中MapX的开发
- VC+MAPX 属性数据的读取
- GMF中,编辑图元属性的方法
- 在Mapxtreme中修改单个图元的标注
- 弹出框的优化代码
- ora-01846:周中的日无效
- 人工神经网络 Artificial Neural Networks - A Tutorial
- apache支持ssi
- 在线程中如何操作Form上的控件
- MAPX中修改图元的属性值
- OTL(4.0) Frequently Asked Questions经典问答(2010.4.10更新)
- 明天奥运会就开幕了,中国,加油!
- 如何理解C run-time library
- Windows CE创建桌面快捷方式
- 在ARM9(s3c2410)上移植GUI系统(gtk+ 与 DirectFb)
- 隆重发布.net项目开发工具(V3.0 )
- js获取浏览器高度和宽度值
- 排序算法