The DEFINE_LAYER_STYLE command allows you to define a layer style for the area, line, or point features in a vector layer. You can then apply this with the IMPORT or SET_LAYER_OPTIONS command later.

The DEFINE_LAYER_STYLE command consists of a single command line followed by a series of lines with the contents of a .gm_layer_style file, like you would save from the Area Styles, Line Styles, or Point Styles tab of the Options dialog for a vector layer. You can also provide a .gm_layer_style in the FILENAME parameter to just reference an external file rather than embedding the layer style directly in the script file.

The DEFINE_LAYER_STYLE command is terminated with a single line containing only the text END_DEFINE_LAYER_STYLE.

For a sample of the DEFINE_LAYER_STYLE command in use, load some data and set up some attribute-based or other custom styling on the Styles tabs of the Options dialog, then save a Global Mapper workspace file from the File->Save Workspace menu command. Open the resulting .gmw file in an editor and you can see how the DEFINE_LAYER_STYLE command is used to define a layer style and then use it in the IMPORT command.

The following parameters are required by the DEFINE_LAYER_STYLE command.

  • NAME - specifies the name to associate with the style. Use this value in an IMPORT command with the AREA_STYLE_NAME, LINE_STYLE_NAME, or POINT_STYLE_NAME parameters.
  • TYPE - type of style being specified, allowed values are AREA, LINE, and POINT.
  • FILENAME - specifies the name of a .gm_layer_style file to use for the style rather than embedding it.
  • LAYERSTYLE - number indicating the type of styling used. Save a workspace with a styled layer to check these values.

Various other parameters define the layer style. Load data in Global Mapper and style using the layer options, then save a style file or save the workspace to see the style definition.


This sample defines a quiver plot style. The best way to set up a Quiver Plot point style is to create a Quiver Plot in Global Mapper, then save a workspace. Open the workspace in a text editor to see the Quiver Plot layer style definition.