#!/bin/csh -f
echo "Content-type: text/html"
echo ""
source build-opt-env
cd ${USETEMPDIR}

unsetenv PATH_INFO

if ( "${SUBSELS}x" == "x" ) then
  set DISPFULL=${OBJECT}
  set CALLFULL=${OBJECT}
else
  set DISPFULL="${OBJECT}(${DISPSS})"
  set CALLFULL="${OBJECT}(${SUBSELS_QS})"
endif

set CUROPT=(`cat mapopt`)

cat <<XXstuffXX
<html><head><title>Map locations - JGOFS software</title></head>
<body>
<h1>Map locations - JGOFS</h1>
<b>Current object is:  $DISPFULL</b></br>
<hr noshade>
<p>
<font size="3">
<a href="/jg/cleanplot${OBJECT}.mapoptjg?${SUBSELS}">
Select this link, if the form looks incomplete</a>.
</font>

<p>
<form action="/jg/plotmap$CALLFULL" method="POST">
<p>
<select name="proj">
XXstuffXX

${OPTHOME}/bin/nawkscr $CUROPT[1] << XXSTUFFXX
mercator 
equicylinder
areacylinder 
gnomic 
equiplanar 
areaplanar 
stereographic 
sinusoidal 
hammer 
peters 
lambert
orthographic
XXSTUFFXX

cat <<XXstuffXX
</select>

<b>Projection type</b> (default: $CUROPT[1]) 
<a href="/jg/projections"><b>Projection type definitions</b></a>
<p>

<select name="sym">
XXstuffXX

${OPTHOME}/bin/nawkscr $CUROPT[7] <<XXSTUFFXX
line
+
o
x
+(connected)
o(connected)
x(connected)
XXSTUFFXX

cat <<XXstuffXX
</select> 
<b>Symbol for stations</b> (default: $CUROPT[7])<p>
<p>

<select name="siz" value="$CUROPT[8]">
<option>1
<option>2
<option>3
<option>4
<option>5
</select><b>Symbol size</b> (default: $CUROPT[8])<br>
[2 is normal]
<p>

<select name="mag" value="$CUROPT[5]">
<option>1
<option>2
<option>3
<option>4
<option>5
<option>6
<option>7
<option>8
<option>9
</select> <b>Magnification</b> (default: $CUROPT[5])<br>
[scale factor for map 1=full globe, 5 for regional map]
<p>

<input name="grid" type="text" size=5 value="$CUROPT[6]"> 
<b>Grid Lines</b> (default: $CUROPT[6])<br>
[lon,lat spacing of grid OR lonmin,latmin,lonmax,latmax OR lonmin,latmin,lonmax,latmax,deltalon,deltalat]: <p>

<input name="cent_lat" type="text" size=2 value="$CUROPT[2]">  
<b>Central latitude</b> (default: $CUROPT[2])<br>
 [sets latitude of center point - use 0 for Mercator] <p>

<input name="shift_lat" type="text" size=2 value="$CUROPT[4]"> 

<b>Shift latitude</b> (default: $CUROPT[4])<br> 
[shifts specified latitude to center of graph - 
use this to do a Mercator projection with the map center not
at the equator] <p>

<input name="cent_lon" type="text" size=3 value="$CUROPT[3]"> 
<b>Central longitude</b> (default: $CUROPT[3])<br> 
[sets longitude of center point] <br>
<hr>
<br>
<input type="submit" value="Make the Map"> 
if the selected options are satisfactory.
</form>
XXstuffXX

