Mapx实现双标注

  Dim lyr As Layer
Private Sub Command1_Click()
 Dim ds As MapXLib.Dataset
  Set ds = Map1.DataSets.Item(1)
  lyr.LabelProperties.Overlap = True
  lyr.LabelProperties.Position = miPositionBC
  lyr.LabelProperties.Offset = 5
  lyr.LabelProperties.Style.TextFont.Size = 10
  lyr.LabelProperties.Style.TextFontColor = RGB(255, 0, 0)
  lyr.AutoLabel = True
   Set lyr.LabelProperties.Dataset = ds
  lyr.Visible = True
  Set lyr.LabelProperties.DataField = ds.Fields("f_value")
  'Map1.Layers.Item("观测站").Visible = False
  MsgBox lyr.Name
 
End Sub

Private Sub Command2_Click()
  Map1.CurrentTool = miZoomInTool
End Sub

Private Sub Form_Load()
    ChDrive App.Path
  ChDir App.Path
  Map1.GeoSet = "map/all.gst"
 
    Dim li As New MapXLib.LayerInfo
  li.Type = miLayerInfoTypeTab
  li.AddParameter "FileSpec", App.Path & "\Map\all\data\观测站.tab"
  li.AddParameter "Visible", False
  li.AddParameter "AutoCreateDataset", True
  li.AddParameter "DatasetName", "ll"
    'MsgBox Map1.Layers.Count
 
  Set lyr = Map1.Layers.Add(li)
  'MsgBox Map1.Layers.Count
End Sub

原文地址:https://www.cnblogs.com/jetz/p/1247918.html