|
阅读:1454回复:1
[求助]:基于VB+MAPX如何通过代码在地图上新建图层
求助如题:各位大虾帮帮忙,最好有代码。网上的代码不完整,无法实现<img src="images/post/smile/dvbbs/em02.gif" />
|
|
|
1楼#
发布于:2008-07-15 11:55
<P>你试一下,不知道是否可以 </P>
<P> Private Sub Form_Load()</P> <P> Dim newLayer As Layer<BR> Dim LayerInfoObject As New LayerInfo<BR> Dim fields As New fields</P> <P> fields.AddStringField "GeoName", 10</P> <P> LayerInfoObject.Type = miLayerInfoTypeTemp<BR> LayerInfoObject.AddParameter "Name", "Temporary Layer"<BR> LayerInfoObject.AddParameter "Fields", fields</P> <P> Set newLayer = Map1.Layers.Add(LayerInfoObject, 1)</P> <P> newLayer.Editable = True<BR> Set Map1.Layers.InsertionLayer = newLayer<BR> Map1.CurrentTool = miPanTool<BR> End Sub</P> |
|