Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In Studio click on the Map Source mapsource_iconImage RemovedImage Added icon for the Map Source whose .map file you wish to edit and select the Map Editor tab. 

Note

The LAYER NAME must start with a letter, underscore or hyphen and then can contain letters, numbers, underscores, full stops and hyphens (no spaces). Full stops are allowed as some customers use the convention schema.table for the Layer name. Total length must not exceed 32 characters.


Info

From version 5.4 you will be able to access the Map Editor by clicking the Edit button for an individual layer e.g.

...

Image Added


Map EditorImage RemovedImage Added

There are three panes for the editor the Editing pane, Information pane and Help pane.

Editing pane

This is the actual code editing Editing pane and shows the code for the map file. Any errors are underlined by a red squiggle whereas warnings are underlined with a blue squiggle. Any changes that you make can be seen immediately using the Map Viewer but will update the live configuration file until you click Save.

Editing Values

If you select an entry in the Editing pane it will be highlighted in yellow. If it is also underlined then you will be able to right -click on a known node that has a value, then a click on the entry and select Edit. A pop-up dialog will appear which will allow you to edit it’s values. Different types of dialog will be displayed depending upon the type of value you are editing. Here are some examples:

On / Off or True / FalseColourValuesSelection
BooleanImage Added
ColourImage Added
ExtentImage Added
Image TypeImage Added

You can also change them by either typing directly over them in the editor, selecting from a list of valid entries or if for instance, you select to edit a color entry the colour pallet will be displayedEditing pane.

Finding Values

If you wish to find a specific word in the .map file you may use Ctrl F to display a Find & Replace dialog.

Using the Toolbar

There is a Toolbar at the top of the Editing pane for common functions:

Map Editor ToolbarImage RemovedImage Added

  • Reload map - from disk
  • Save map - to disk
  • Undo - the last action
  • Redo - the last action
  • Cut - the selected data
  • Copy - the selected data to the clipboard
  • Paste - from the clipboard into the cursor position
  • Insert a snippet in the map file - please see the topic Inserting Snippets for details.
  • Comment out the selection - comments out the selected lines in the .map file
  • Uncomment out the selection - reinstates the selected, previously commented lines in the .map file
  • Format the map file - Formats all the entries in the .map file e.g. indents according to hierarchy
  • Show special characters - shows special characters in the Editing pane such as tabs etc.


Information pane

This is underneath the Editor Editing pane and has three tabs. If you double click on an entry the Editor pane will move directly Editing pane will be positioned to that line and highlight it will be highlighted.

Layers

Selecting this tab will display the list of Layers in your selected map file. The tab will also display a total count of the number of layers.

Errors

Selecting this tab will display the list of Errors in your map file together with the relevant line number in the Map Editor for you to fix the error. The tab will also display a total count of the number of errors.

Warnings

Selecting this tab will display the list of Warnings in your map file together with the relevant line number in the Map Editor. The tab will also display a total count of the number of warnings.

...

When you click on an entry in the Editing pane a description will appear in this pane for the highlighted entry. If the line contains an error or warning, then that will be shown as well. 

You may also wish to refer to the topic Creating your MapServer .map file.