SET_LAYER_OPTIONS

The SET_LAYER_OPTIONS command sets the display options for one of more loaded layers. These are the options that you would normally supply when importing a layer. The following parameters are supported by the command. In addition, all of the option parameters for the IMPORT command are also supported for this command.

  • FILENAME - full path or description of loaded layer to set the options for. This can include wildcard characters like '*'. If you specify an empty filename then all layers that have no filename, like generated contours, will be matched. If you leave of the FILENAME parameter entirely or use a '*' wildcard (like FILENAME="*") then all loaded layers will be updated. If you want layers only in some groups, you can add <sub> to the FILENAME. For example, to match all layers in the layer group 'Line Group', use FILENAME="Line Group<sub>*". When running the script in the context of the main map view (including loading a workspace) you can also pass in the value 'USER CREATED FEATURES' to have the 'User Created Features' layer updated or 'SELECTED LAYERS' to have any layers selected in the Control Center.

Shared Import Parameters

These parameters are shared across import and layer options commands to set layer properties.

  • HIDDEN - set to YES to cause this overlay to be hidden from view after it is loaded. The default is to show the overlay.
  • LAYER_DESC - specifies a description to use for the layer when displaying it in the Control Center. This overrides the default description based on the filename or other information within the file.
  • LAYER_GROUP - specifies the name of the group for the layer in the Control Center. To include multiple layers of grouping put the string <sub> in between levels. For example to make a group with 2 levels of nesting, use LAYER_GROUP="Top Level<sub>Next Level".
  • ALLOW_SELECTION - set to NO to disable selection of features from this layer using either the Feature Info or Digitizer Tools.
  • ALLOW_EXPORT - set to NO to disable export from this layer.
  • LOAD_FLAGS - contains flags for any import options that you were prompted for when loading the file, such as if you have a .tif file that you were prompted to select as elevation or raster. Also things like the coverages and tile sets for VPF layers. To see how to set these if you are writing a script, load a file with the settings that you want in the main user interface and then save a workspace, then examine the IMPORT command in the .gmw file for that file and see how the LOAD_FLAGS were set.
  • METADATA_FILENAME - specifies full path and filename of a file to display the contents of on the Metadata dialog for a layer. The file can be any simple displayable text format, including text and XML.
  • METADATA_URL - specifies a URL to a displayable web file (including HTML web page or XML document) to show on the Metadata dialog for a layer.
  • CODE_PAGE- specifies the code page to use when interpreting text from this layer. By default if the file doesn't specify a code page the current system code page will be used. Use the code page number, or the text UTF-8 (number 65001).
  • ALT_MODE (vector only) - altitude mode specifies how the 3D viewer should interpret z-values in the vector features of an layer, relative to terrain. Altitude mode may also be set in an individual feature, in which case it overrides the layer setting. The following values are supported:
    • UNSPECIFIED - Altitude mode is determined by either the setting in the feature, or if unspecified, the setting in the 3D viewer
    • ABSOLUTE - treat z-values as absolute elevations, ignoring any terrain
    • RELATIVE_TO_GROUND - treat z-values as distances above the terrain
    • RELATIVE_TO_SEA_FLOOR - treat z-values as distances above the sea floor (currently implemented as RELATIVE_TO_GROUND)
    • CLAMP_TO_GROUND - ignore z-values, and clamp the feature to the terrain
    • CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the sea floor (currently implemented as CLAMP_TO_GROUND)
    • DEPTH - treat z-values as absolute depths, ignoring any terrain
  • ZOOM_DISPLAY - specifies when the map should be displayed and when it should be hidden based on the display zoom scale. This command will be formatted as a name from the list, below followed by 2 numeric paramters. For example, use ZOOM_DISPLAY="SCALE,25000,0" to have a map display only when zoomed in below 1:25000 scale.
    • ALWAYS - always display the map. The numeric parameters are ignored.
    • PERCENT - display the map when the map bounding box is a certain percentage of the screen size. For example, use ZOOM_DISPLAY="PERCENT,0.10,0" to display the map when its bounding box is at least 10% of the screen size.
    • PIXEL_SIZE - display the map when each display pixel is less than some number of meters in size. For example, use PIXEL_SIZE="SCALE,10,0" to display the map when the current display resolution is 10 meters per pixel (or less/higher resolution).
    • SCALE - display the map when the current display is at or below a certain scale. For example, use ZOOM_DISPLAY="SCALE,25000,0" to display the map when the current draw scale is at or below 1:25000.
    • SCALE_RANGE - display the map when the current display is below a range of scale value. For example, use ZOOM_DISPLAY="SCALE_RANGE,25000,100000" to display the map when the current draw scale is between 1:25000 and 1:100000.
  • PROJ - special Projection Specification type of parameter that specifies the projection to use for the file. This will override any projection information stored in the file.
  • PROJ_NAME (DEPRECATED use PROJ instead) - specifies the name of the projection to use for this file (this will override any projection information stored in the file). This name must have been defined with a prior DEFINE_PROJ command.
  • PROJ_FILENAME (DEPRECATED use PROJ instead)- specifies the name of the projection (.prj) file to use for this file (this will override any projection information stored in the file).
  • PROJ_EPSG_CODE (DEPRECATED use PROJ instead) - specifies the numeric EPSG projection code that defines the projection for this file (this will override any projection information stored in the file). For example, use PROJ_EPSG_CODE=26715 to define a UTM zone 15 projection with NAD27 as the datum and meters as the units.
  • PROMPT_IF_PROJ_UNKNOWN - set to NO if you don't want the user to be prompted to select a projection if the projection of the file cannot be automatically determined.
  • USE_DEFAULT_PROJ - specifies that if no projection can be automatically determined for a layer that the default projection selection should be used rather than prompting the user. Use USE_DEFAULT_PROJ=YES to enable. The default projection uses the first valid option from the following, including a check for linear versus angular numeric ranges:
    • Projection of any files loaded from the same folder
    • Last projection user selected on a projection dialog in this session
    • Current view projection
    • Projection from default.prj in global_mapper.exe path
    • Projection from default.prj in User Settings File path
    • Last projection user selected on a projection dialog in previous session of GM
    • Default UTM/15N/NAD83 projection
  • USE_DEFAULT_POS - specifies that if no position data for a raster layer can be automatically determined that a default position should be chosen so that it displays. Use USE_DEFAULT_POS=YES to enable.
  • PICTURE_POS - specifies that the image should be loaded as a 'picture point' that displays the image when you select the point with the Feature Info Tool. The value should contain the X and Y coordinates (in the projection specified for the layer). For example to place the value at 30N 95W with the projection set as PROJ_EPSG_CODE=4326 you can use PICTURE_POS="-95.0,30.0".
  • LOAD_HIDDEN_PDF_LAYERS - for PDF import, specifies that if no layer prompt is provided that hidden layers should be loaded automatically. Use LOAD_HIDDEN_PDF_LAYERS=YES to enable.