1、请问MAPX的有关参数?
Set searchLayer = Map1.Layers.Item("tablename")
  
  'searchLayer.LabelProperties.Offset = 10
  'searchLayer.LabelProperties.Position = miPositionCL
  请问与miPositionCL 相关的上、下、左、右参数是什么?
  'Offset
  '字体颜色
 searchLayer.LabelProperties.Style.TextFontColor = miColorPurple
 '字体颜色miColorPurple的其它参数如红色
 'searchLayer.LabelProperties.Style.字号=?
  还有字号的设置怎么设置?
 searchLayer.LabelProperties.Style.TextFontBackColor = miColorWhite2、请问动画图层怎么设置?
Dim bindlayer As New bindlayer
    Dim conn As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim rs As New ADODB.Recordset
    Dim ds As Dataset
      
    ‘我要设置为动画图层怎么设置,因为我的数据是随时更时的
      '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        'Dim lyr As MapXLib.Layer
      
       ' Set lyr = Map1.Layers.CreateLayer("tablename")
       ' Set Map1.Layers.AnimationLayer = lyr
       '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    bindlayer.LayerName = "tablename"
    bindlayer.LayerType = miBindLayerTypeXY
   
    bindlayer.RefColumn1 = "Longitude"
    bindlayer.RefColumn2 = "Latitude"
        conn.Open "provider=Microsoft.Jet.oledb.4.0;Data Source =" + App.Path + "\a.mdb "    Set cmd.ActiveConnection = conn
    cmd.CommandText = "select * from StationPar"
    rs.CursorLocation = adUseClient
    rs.Open cmd, , adOpenDynamic, adLockBatchOptimistic
    
   Set ds = Map1.DataSets.Add(miDataSetADO, rs, "tablename", "backup1", , bindlayer)3、我怎么样知道某个图层已存在?我怎么样知道某个图层已存在,如果这个图层存在,则删除它。

解决方案 »

  1.   

    关于设置字体的:
    MapMain.DefaultStyle.TextFont.Bold = True
    MapMain.DefaultStyle.TextFont.Name = "宋体"
    MapMain.DefaultStyle.TextFont.Size = 20
    MapMain.DefaultStyle.TextFontColor = vbRed动画图层?
    是不是向要在某个图层上添加一个图元,再对该图元做操作(删除等)?
    系统再加载时添加一个临时图层,然后在该图层上随便添加图元,系统卸载时不保存该图层即可。关于图层:
    MapX有一个属性:
    MapMain.Layers
    通过:MapMain.Layers(1).Name 知道图层名字,图层名字是唯一的!
      

  2.   

    希望对你有所帮助:
    '初始化动态图层,如:车辆图层、轨迹图层等。如果指定路径下没有该图层则创建指定图层。
    '           如果已有该图层,则删除后,重新创建空白图层。
    'Param:     dynamicLyrPath为动态图层的文件夹名称,如"map1"
    '           layerName格式为"\file"
    '           bAutoLabel是否现实标注:true-显示,false-关闭。
    Public Sub initDynamicLayer(lyrObject As Layer, lyrDataSet As MapXLib.Dataset, dynamicLyrPath As String, LayerName As String, bAutoLabel As Boolean)    
        Dim fso As Object
        Dim lyrPath As String
        Dim lyr As MapXLib.Layer
        
        Set fso = CreateObject("Scripting.FileSystemObject")
        
        '图层文件路径,注意无后缀名
        lyrPath = App.Path + "\" + dynamicLyrPath + LayerName
        
        If fso.FileExists(lyrPath + ".tab") Then
        
            Kill lyrPath + ".tab"
            Kill lyrPath + ".dat"
            Kill lyrPath + ".map"
            Kill lyrPath + ".id"
            Kill lyrPath + ".ind"
        End If
        '判断gst里面是否有临时图层,如果有,先把他们给删除
        For Each lyr In frmMainMap.Map1.Layers
            If lyr.Name = Trim(Right(LayerName, Len(LayerName) - 1)) Then
                frmMainMap.Map1.Layers.Remove (lyr.Name)
                Exit For
            End If
        Next
        '需求:把动态临时图层放在区域图层的上面,以便动态临时图层不会盖住原来图层的图元
        '逻辑:在动态临时图层生产的时候,把其位置由原来的10变为3,
        Set lyrObject = frmMainMap.Map1.Layers.CreateLayer(Right(LayerName, Len(LayerName) - 1), lyrPath + ".tab", 4)
        Set lyrDataSet = frmMainMap.Map1.DataSets.Add(miDataSetLayer, lyrObject)
        Set lyrObject.LabelProperties.Dataset = objDataSet
        Set lyrObject.LabelProperties.DataField = objDataSet.Fields.Item("GEONAME")
        lyrObject.LabelProperties.Position = miPositionTC
        frmMainMap.Map1.Layers.Item(Right(LayerName, Len(LayerName) - 1)).AutoLabel = bAutoLabel
        End Sub