阅读:1516回复:0
[求助]MO+VB
<P>下面的代码主要是实现在Map control中画线和面的,但是在程序运行当中,只能是画一个,要么是面,要么是线。如果同时画就会出错…………希望高手给予指点。看看下面的代码有没有问题??</P>
<P>Private Function trackshape() As Object<BR> If Option1.Value = True Then<BR> Dim line As New MapObjects2.line<BR> Set line = Map1.TrackLine<BR> Set trackshape = line<BR> Dim evline As New MapObjects2.GeoEvent<BR> Set evline = Map1.TrackingLayer.AddEvent(line, 1)<BR> ElseIf Option2.Value = True Then<BR> Dim poly As New MapObjects2.Polygon<BR> Set poly = Map1.TrackPolygon<BR> Set trackshape = poly<BR> Dim evpoly As New MapObjects2.GeoEvent<BR> Set evpoly = Map1.TrackingLayer.AddEvent(poly, 2)<BR> End If<BR> <BR>End Function<BR></P> |
|