Mapx实现双标注

时间:2022-04-23
本文章向大家介绍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 & "Mapalldata观测站.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