Can I import my company logo into a map using MapViewer's Scripter?

This article provides a sample script for importing a company logo into a map with MapViewer's Scripter.

To import a company logo or any other image onto an existing map, use the Import command, making sure to set AppendImage to False since your logo isn't referenced and thus shouldn't be projected into the coordinate system of the plot.

To run this script:

  1. Copy the text below, from the Sub main start line to the End Sub end line.
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
  3. Double click on Scripter.exe to launch Scripter.
  4. Press Ctrl+A to select all of the existing lines.
  5. Press Ctrl+V to paste your copied script over top of these existing lines.
  6. Click Script | Run to run the script.



Sub main

Set mvApp = CreateObject("MapViewer.Application")
mvApp.Visible = True

'Defines variables to use for the file path and the GSM and logo file names
InPath$ = "C:\Users\<username>\Desktop\MapViewerFiles\"
GSMFileName$ = "HatchMap.gsm"
LogoFileName$ = "Logo.png"

'Creates a new plot window and opens the GSM file there
Set Plot = mvApp.Documents.Open(FileName:=InPath$+GSMFileName$)

'Import image without rescaling the map
Set Layer = Plot.Import(FileName:= InPath$+LogoFileName$, AppendImage:=False)

'Assign the name 'Logo' to the last item imported into the Layer
Set Logo = Layer.Shapes.Item(Layer.Shapes.Count)

'Resize the logo
Logo.Height = 4.00
Logo.Width = 2.00

'Move the logo on the page
Logo.Left = 1
Logo.Top = 5

End Sub


Updated January 4, 2019

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.