The map editor is in Zone Mapping mode, single zone editing submode.

A zone simply marks out part of the map; think of it like a map layer with two states per tile: included in the zone, or not. This submode is for editing a single zone at a time. You can place each tile in multiple zones (up to 15) and you can create 9999 zones per map. Zones may be used for restricting NPC movement, and for scripted effects. 

{{mapedit_basic_controls}}

Press Z to switch to zone viewing submode.

Press < and > or PageDown and PageUp to change the current zone number, or type in an ID number, or use the MOUSE WHEEL. There's no need to use sequential ID numbers.

Press E to go to the zone info editor, where you can edit the triggers attached to this zone.

If the current tool isn't the Draw tool, press + or - to toggle whether you are adding or removing tiles.

At the top right corner the current drawing tool is shown. Press SPACE or LEFT CLICK to draw the zone. The tools are:

D - Draw tool:
  Press SPACE/CLICK to add or remove
  the selected tile to the current
  zone.  You can hold down space and
  move the cursor or drag the mouse.

B - Box tool:
  Press SPACE/CLICK once to place one
  corner of the box, and SPACE/CLICK
  a second time at the opposite
  corner to add or remove a rectangle
  of tiles to the zone.

F - Fill (Paint bucket) tool:
  Flood fills the continuous region
  under the cursor of tiles either in
  the zone or not.

P - Paint on Layer # tool:
  Finds the continuous area on the
  current tilemap layer under the
  cursor, and adds/removes all those
  tiles from the zone; like a flood
  fill of a map layer except that the
  map layer isn't modified. You can
  use PageDown and PageUp to change
  the selected layer. For example,
  you could use this to 'paint' a
  road with a zone.

M - Mark tool:
  Use to select a rectangular of the
  map to copy. Press SPACE/CLICK once
  to place one corner of the
  rectangle, and SPACE/CLICK a second
  time at the opposite corner. The
  tool will then be changed to the
  Clone tool. Mark copies the visible
  tilemap layers, wallmap, foemap,
  and zones in the rectangle.

C - Clone tool:
  Press SPACE/CLICK to paste a
  selection copied with the Mark
  tool.  You can switch to different
  editing modes to preview the
  changes to walls, foemap, and
  zones.  If default passability is
  on (press CTRL+D to toggle), the
  wallmap will updated using default
  walls instead of the copied walls.
  Only visible map layers are
  modified (press ALT+~ to toggle
  visibility of the current map
  layer), so a map layer has to be
  visible both when Marking and when
  Cloning.

Also,

CTRL+W paints (adds or removes) the tiles visible in the window/screen to/from the zone.

CTRL+Z undoes a change to the tilemap, wallmap, foemap or zonemap. Changes to NPCs and doors are not undoable. The undo history buffer is near-infinite, but certain things cause it to be cleared: resizing the map, deleting or swapping map layers, erasing map data, and leaving the map editor.

CTRL+Y redoes an undone change.

CTRL+S immediately saves, useful when live-previewing a game.

Pressing DELETE removes the selected tile from the zone.

Pressing TAB toggles a minimap that shows the selected zone, and what part of the map you are currently looking at.

~ shows a preview of the entire map.

CTRL+N toggles whethers NPCs are visible.
