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 base map object and assigns it to the variable named "BaseMap" Set BaseMap = Plot.CreateBaseMap(InPath$+"us50alb.gsb") 'Creates a pie map object and assigns it to the variable named "PieMap" Set PinMap = Plot.CreatePinMap(InPath$+"uscity.xls") '''''''''''''''''''' 'Appends a pin map To an existing image. PinMap.Append = True 'Sets the data class column to 2 PinMap.ClassCol=2 'Sets the pin method to bin the classes from values in the class column PinMap.PinMethod=mvPinMethodBinClass 'Sets the number of classes for the pin map PinMap.NumClasses=3 'Returns the maximum value of Class 1 Debug.Print PinMap.ClassMaxVal(1) 'Returns the minimum value of Class 1 Debug.Print PinMap.ClassMinVal(2) 'Sets the Class Method for the pin map PinMap.ClassMethod = mvClassificationUserDefined 'Sets the properties for the symbol of class 1 PinMap.ClassSymbol(1).FillColor=mvColorRed PinMap.ClassSymbol(1).Index=24 PinMap.ClassSymbol(1).LineColor=mvColorPurple PinMap.ClassSymbol(1).Set="GSI Default Symbols" PinMap.ClassSymbol(1).Size=0.3 'Shows the labels on the pins PinMap.ShowLabel=True 'Sets the label angle in degrees PinMap.LabelAngle=45 'Sets the label column of the worksheet. PinMap.LabelCol=1 'Sets the font properties for the labels PinMap.LabelFont.BackColor=mvColorPowderBlue PinMap.LabelFont.Background=True PinMap.LabelFont.Bold=True PinMap.LabelFont.Face="Arial" PinMap.LabelFont.ForeColor=mvColorBlack PinMap.LabelFont.HAlign=mvTACenter PinMap.LabelFont.Italic=True PinMap.LabelFont.Size=10 PinMap.LabelFont.StrikeThrough=False PinMap.LabelFont.Underline=True PinMap.LabelFont.VAlign=mvTAVCenter 'Sets the label format properties PinMap.LabelFormat.AbsoluteValue = True PinMap.LabelFormat.NumDigits=4 PinMap.LabelFormat.Postfix="" PinMap.LabelFormat.Prefix="City Name= " PinMap.LabelFormat.Thousands=True PinMap.LabelFormat.Type = mvLabFixed 'Sets the label position offset type PinMap.LabelPosOffsetType=mvPosOffsetUser 'Sets the Label position X offset. PinMap.LabelPosXOffset=0.01 'Sets the Label position Y offset. PinMap.LabelPosYOffset=-0.16 'Sets the state using other location file PinMap.OtherLocation=False 'Sets the PID column of the worksheet PinMap.PIDCol=2 'Sets the symbol angle in degrees. PinMap.SymbolAngle=45 'Sets the symbol column of the worksheet. 'PinMap.SymbolCol=4 'Sets the symbol frequency PinMap.SymbolFrequency=2 'Sets the state of user limits checkbox and 'sets the min/max values PinMap.SetUserLimits(True,-120,-90) 'Returns the user limits max value Debug.Print PinMap.UserLimitMaxVal 'Returns the user limits min value Debug.Print PinMap.UserLimitMinVal 'Returns the state of user limits checkbox Debug.Print PinMap.UserLimits 'Sets the state of using US 5-digit ZIP code PinMap.UseUSZIPCode=False 'Sets the X coordinate column of the worksheet. 'PinMap.XCol=2 'Sets the Y coordinate column of the worksheet. 'PinMap.YCol=3 'Sets the min/max values for class 1 PinMap.SetClassMinMaxVals(1,-120, -115 ) 'Creates a legend for the map Set Legend = PinMap.CreateLegend(-2,6) 'Adds HatchMap information in Layer #1 to legend PinMap.AddLayerToLegend("Layer #1") End Sub