开发环境:MapXtreme for Windows
代码:
点击选中单个图层上的图元目标
function pointselobjs(x1,y1,layername,byref objs)
dim bresult
dim pt
dim mapx1,mapy1
mapx1=x1
mapy1=y1
set pt=Session(SESN_COURIER).createmapxpoint
pt.set mapx1,mapy1
set objs=Session(SESN_MAPPER).layers(layername).Searchatpoint(pt)
end function
删除点选的图元目标
sub pointdelete(x1,y1,layername)
dim fs
dim f
dim bresult
Session(SESN_MAPPER).ExportSelection=true
bresult=pointselobjs(x1,y1,layername,fs)
for each f in fs
Session(SESN_MAPPER).Layers(layername).deletefeature f
next
end sub