文件名称:vb+mo开发的小程序
文件大小:32KB
文件格式:DOC
更新时间:2015-07-11 08:05:03
set
Private Sub Command1_Click() Dim i As Integer Dim layer As MapLayer Dim stats As Statistics Dim class As New ClassBreaksRenderer Dim break As Double Set layer = Map1.Layers("states") Set layer.Renderer = class With class .SymbolType = moFillSymbol .Field = "area" Set stats = layer.Records.CalculateStatistics("area") break = stats.Mean - (stats.StdDev * 3) For i = 0 To 6 If break >= stats.Min And break <= stats.Max Then .BreakCount = .BreakCount + 1 .break(.BreakCount - 1) = break End If break = break + stats.StdDev Next .RampColors moPaleYellow, moNavy End With Map1.Refresh End Sub Private Sub Form_Load() Dim dc As New DataConnection Dim layer As MapLayer dc.Database = "F:\2011MO\MEXICO" If Not dc.Connect Then MsgBox "no layer" End End If Set layer = New MapLayer Set layer.GeoDataset = dc.FindGeoDataset("states") Map1.Layers.Add layer Map1.Refresh End Sub