KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for creating a cartogram map and editing the methods and properties of the cartogram map.
To run this script:
- Copy the script below, or click here to download the BAS file: Create_Cartogram_Map.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
*********
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Create_Cartogram_Map.bas ' Copyright (C) Golden Software Inc. 1992-2015 ' ' This script creates a Dorling cartogram and fills in ' the circles with a color. ' ' This script requires MapViewer 6 or later. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Dim mvApp, plot, cartmap As Object Dim path As String ' Start MapViewer and create a pointer to the application object Set mvApp = CreateObject("MapViewer.Application") ' Make the application visible mvApp.Visible = True ' Create a plot document Set plot = mvApp.Documents.Add(DocType:=mvDocPlot) path = mvApp.ApplicationFolder & "samples\" ' Create cartogram map Set cartmap = plot.CreateCartogramMap ( BoundaryFileName := path & "AL2010.gsb", _ DataFileName := path & "AL2010.dat", PIDCol := 1, VarCol := 7 ) ' Fill the cartogram circles with blue cartmap.Fill.ForeColor = mvColorBabyBlue cartmap.Fill.Pattern = "solid" End Sub
Updated November 2, 2016
Comments
0 comments
Please sign in to leave a comment.