# @(#) $Id$

# Include polygon fill patterns and scalebar definition.
#
include symbols.mapyrus
include scalebar.mapyrus


newpage "eps", "mapview2.eps", 70, 40, "background=white lineantialiasing=true"
worlds 40000, 40000, 50000, 45000

let scale=Mapyrus.worlds.scale

# Import polygons of imaginary vegetation.
#
dataset "textfile", "vegetation.dat", "comment=#"
while Mapyrus.fetch.more
do
	fetch
	let nCoords = $1
	let vegCode = $2

	# Add all coordinate for this polygon to path.
	#
	fetch
	clearpath
	move $1, $2
	let i = 1
	while i < nCoords
	do
		fetch
		draw $1, $2
		let i = i + 1
	done

	# Display polygon differently, depending on its vegetation class.
	#
	if vegCode == 1
	then
		savannah
	elif vegCode == 2
	then
		wheatfield
	elif vegCode == 3
	then
		barerock
	elif vegCode == 4
	then
		marsh
	elif vegCode == 5
	then
		marsh
	elif vegCode == 6
	then
		water
	endif

	# Show outline of polygon
	#
	color "black"
	linestyle 0.1
	stroke
done

newpage "eps", "mapview2legend.eps", 40, 50, "background=white lineantialiasing=true"
clearpath
let counter=0
while counter < Mapyrus.key.count
do
	move 2, 1 + counter * 8
	let counter=counter+1
done

font "Helvetica", 3
color "black"
legend 7

# Create a scalebar for the map.
#
newpage "eps", "mapview2scalebar.eps", 50, 15, "background=white lineantialiasing=true"
clearpath
scalebar scale, "m", 0, 0

# Draw north arrow for the map.
#
newpage "eps", "mapview2north.eps", 20, 20, "background=white"
clearpath
move 10, 10
nsew
