开发环境:MapXtreme for Windows
代码:
创建折线图元
Function ObjMulLine(PointNums,byref x(),byref y(),layername,byref obj)
dim bresult
dim pts
dim i
dim style
set style=Session(SESN_COURIER).CreateMapXStyle
set pts=Session(SESN_COURIER).createmapxpoints
for i=0 to PointNums-1
pts.addxy x(i),y(i),i+1
next
set obj=Session(SESN_MAPPER).FeatureFactory.createline(pts,style)
end function
将折线图元添加到图层
sub DrawMulLine(PointNums,byref x(),byref y(),layername,style)
dim f
dim bresult
if pointnums= 0 then
exit sub
end if
bresult=ObjMulLine(PointNums,x,y,layername,f)
f.style=style
Session(SESN_MAPPER).Layers(layername).addfeature f
end sub
|