if (.not.exist(fields)) return
if (fields%n.eq.0) return
!
define integer nf
let nf abs(fields%n)
define double xoff[nf] yoff[nf] xcen[nf] ycen[nf] inum[nf] semi
!
! Offsets are not reliable as Maps may have a different center
let xoff fields%offsets[1,]
let yoff fields%offsets[2,]
! Use absolute coordinates instead
let xcen fields%centers[1,]/pi*12
let ycen fields%centers[2,]/pi*180
let inum[i] i
let semi fields%primary/2
!
! ellipse semi  /user xcen ycen ABS  ! Does not work for ABSOLUTE value
for i 1 to nf
  greg2\ellipse semi  /user xcen[i] ycen[i] ABS
next
!
if (exist(fields%n_select)) then
  ! Highligh in Red the selected fields
  greg1\pencil 1 /we 2
  define integer i
  for j 1 to fields%n_select
    let i fields%selected[j]
    greg2\ellipse fields%primary/2 /user xcen[i] ycen[i] ABS !! 'fields%offsets[1,i]' 'fields%offsets[2,i]'
  next
  greg1\pencil 0
  for j 1 to nf
    greg2\ellipse fields%primary/16 /user xcen[j] ycen[j] ABS /fill 8
  next
  greg1\pencil /we 3
  for j 1 to nf
    greg1\draw text 'xcen[j]' 'ycen[j]' 'j' 5 /user ABS
  next
  greg1\pencil 1 /we 4
  for j 1 to fields%n_select
    let i fields%selected[j]
    greg1\draw text 'xcen[i]' 'ycen[i]' 'i' 5 /user ABS
  next
  delete /var i
else
  !
  ! Overlay the field numbers at center
  greg1\pencil /we 3
  for j 1 to nf
    greg2\ellipse fields%primary/16 /user xcen[j] ycen[j] ABS /fill 8
    greg1\draw text 'xcen[j]' 'ycen[i]' 'j' 5 /user ABS
  next
endif
greg1\pencil 0 /we 1
