利用MO实现流场显示 

                                                          利用MO实现流场显示 
转载

背景:有一个点状ShapeFile,每个点有一个方向字段,要将各个点显示为相应方向的箭头。

方法:想通了很简单,就是使用MO中的ClassBreaksRenderer,和点状Symbol即可完成,废话少说,关键代码上:

    Dim lyr As MapLayer, i As Integer
    Set lyr = Map1.Layers(0)
   
    Dim cl As New ClassBreaksRenderer
    cl.BreakCount = N
    cl.SymbolType = moPointSymbol
    cl.Field = "Angle"
    For i = 0 To N - 1
        cl.Break(i) = i / N * 360
        With cl.Symbol(i)
        .SymbolType = moPointSymbol
        .Color = moBlack
        .Font.Name = "宋体"
        .Font.Bold = False
        .Size = 22
        .Style = moTrueTypeMarker
        .SymbolType = moPointSymbol
        .CharacterIndex = 24
        .Rotation = i / N * 360 - 90
        End With
    Next i

    With cl.Symbol(i)
        .SymbolType = moPointSymbol
        .Color = moBlack
        .Font.Name = "宋体"
        .Size = 22
        .Style = moTrueTypeMarker
        .SymbolType = moPointSymbol
        .CharacterIndex = 24
        .Rotation = i / N * 360
    End With

    Set lyr.Renderer = cl

效果如下


posted on 2007-05-24 08:37  GIS云中飞鹏  阅读(1906)  评论(3编辑  收藏  举报

导航