zoukankan      html  css  js  c++  java
  • MO sample中的缓冲冲区的例子很简单的一个例子

    Option Explicit

    Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    'Point buffering

    If Option1.Value Then

    Dim pt As New MapObjects2.Point

    Dim eventPt As New MapObjects2.GeoEvent

    Dim buffPt As New MapObjects2.Polygon

    Dim buffEventPt As New MapObjects2.GeoEvent

    Set pt = Map1.ToMapPoint(x, y)

    Set eventPt = Map1.TrackingLayer.AddEvent(pt, 0)

    Set buffPt = pt.Buffer(Text1.Text, Map1.FullExtent)

    Set buffEventPt = Map1.TrackingLayer.AddEvent(buffPt, 3)

    'Line buffering

    ElseIf Option2.Value Then

    Dim line As New MapObjects2.line

    Dim eventLine As New MapObjects2.GeoEvent

    Dim buffLine As New MapObjects2.Polygon

    Dim buffEventLine As New MapObjects2.GeoEvent

    Set line = Map1.TrackLine

    Set eventLine = Map1.TrackingLayer.AddEvent(line, 1)

    Set buffLine = line.Buffer(Text1.Text, Map1.FullExtent)

    Set buffEventLine = Map1.TrackingLayer.AddEvent(buffLine, 3)

    'Rectangle buffering

    ElseIf Option3.Value Then

    Dim rect As New MapObjects2.Rectangle

    Dim eventRect As New MapObjects2.GeoEvent

    Dim buffRect As New MapObjects2.Polygon

    Dim buffEventRect As New MapObjects2.GeoEvent

    Set rect = Map1.TrackRectangle

    Set eventRect = Map1.TrackingLayer.AddEvent(rect, 2)

    Set buffRect = rect.Buffer(Text1.Text, Map1.FullExtent)

    Set buffEventRect = Map1.TrackingLayer.AddEvent(buffRect, 3)

    'Polygon buffering

    ElseIf Option4.Value Then

    Dim poly As New MapObjects2.Polygon

    Dim eventPoly As New MapObjects2.GeoEvent

    Dim buffPoly As New MapObjects2.Polygon

    Dim buffEventPoly As New MapObjects2.GeoEvent

    Set poly = Map1.TrackPolygon

    Set eventPoly = Map1.TrackingLayer.AddEvent(poly, 2)

    Set buffPoly = poly.Buffer(Text1.Text, Map1.FullExtent)

    Set buffEventPoly = Map1.TrackingLayer.AddEvent(buffPoly, 3)

    'Ellipse buffering

    ElseIf Option5.Value Then

    Dim arect As New MapObjects2.Rectangle

    Dim elli As New MapObjects2.Ellipse

    Dim eventElli As New MapObjects2.GeoEvent

    Dim buffElli As New MapObjects2.Polygon

    Dim buffEventElli As New MapObjects2.GeoEvent

    Set arect = Map1.TrackRectangle

    elli.Top = arect.Top

    elli.Bottom = arect.Bottom

    elli.Left = arect.Left

    elli.Right = arect.Right

    Set eventElli = Map1.TrackingLayer.AddEvent(elli, 2)

    Set buffElli = elli.Buffer(Text1.Text, Map1.FullExtent)

    Set buffEventElli = Map1.TrackingLayer.AddEvent(buffElli, 3)

    End If

    End Sub

    Private Sub Form_Load()

    Option1.Caption = "Point"

    Option2.Caption = "Line"

    Option3.Caption = "Rectangle"

    Option4.Caption = "Polygon"

    Option5.Caption = "Ellipse"

    Text1.Text = "100"

    Map1.TrackingLayer.SymbolCount = 4

    With Map1.TrackingLayer.Symbol(0)

    .SymbolType = moPointSymbol

    .Style = moTriangleMarker

    .Color = moRed

    .Size = 3

    End With

    With Map1.TrackingLayer.Symbol(1)

    .SymbolType = moLineSymbol

    .Color = moRed

    .Size = 3

    End With

    With Map1.TrackingLayer.Symbol(2)

    .SymbolType = moFillSymbol

    .Style = moGrayFill

    .Color = moRed

    .OutlineColor = moRed

    End With

    With Map1.TrackingLayer.Symbol(3)

    .SymbolType = moFillSymbol

    .Style = moGrayFill

    .Color = moBlue

    .OutlineColor = moBlue

    End With

    End Sub

    运行结果

    用mo真是累.写个毕业设计真是麻烦.

    转载请注明出处,有技术问题,欢迎互相交流,或者留言.
  • 相关阅读:
    超级好用的装机神器——Ventoy
    CentOS7.4安装Nvidia Tesla T4驱动
    ESXI常用命令
    阿里云|腾讯云MySQL备份文件一键恢复工具
    在甲方做三年安全的碎碎念
    golang操作docker
    Nginx Module扩展模块实现
    炒冷饭之ThinkPHP3.2.X RCE漏洞分析
    Windows:sysprep.exe工具:审核模式 VS OOBE模式(工厂模式 VS 用户模式)
    高校毕业生人数增长图
  • 原文地址:https://www.cnblogs.com/sunliming/p/1721843.html
Copyright © 2011-2022 走看看