Legend Object

 

The Legend object contains all the properties and methods for a map legend. Legends are created using the CreateLegend method.

 

Derived from: Shape object (All methods and properties of Shape apply to this object.)

 

Properties

ArrangeLegendsVertically

ArrangeSamplesVertically

ArrangeVarsVertically

Font

FrameFill

FrameLine

FrameStyle

LabelFormat

NumColumns

NumSamples

RectangleSampleEdge

SampleOrder

SampleSpacing

ShowBasicInfoOnly

ShowClassHits

ShowClassName

TextOnLeftOfSample

Title

TitleFont

VerticalSampleLabel

 

Methods

UnlinkLegend

 

Example

This example creates a hatch map of Colorado and creates a legend object for the map.

 

Sub main

'Creates an instance of the MapViewer Application

'object and assigns it to the variable named "mvApp"

 Set mvApp = CreateObject("MapViewer.Application")

 

'Makes the application main window visible

 mvApp.Visible = True

 

'Assigns the location of the samples folder

'to the variable "InPath"

 InPath$ = mvApp.ApplicationFolder + " samples\"

 

'Creates a map document object, and assigns it

'to the variable named "Plot"

 Set Plot = mvApp.Documents.Add(DocType:=mvDocPlot)

 

'Creates a hatch map object and assigns it

'to the variable named "HatchMap"

 Set HatchMap = Plot.CreateHatchMap( BoundaryFileName:=InPath$ + _

 "co2010.gsb", DataFileName:=InPath$ + "co2010.dat", _

 PIDCol:=1, VarCol:=5, NumClasses:=4)

 

'Create a map legend and assign it to the

'variable named "Legend"

 Set Legend = HatchMap.CreateLegend( Left:=-2, Top:=6 )

End Sub