Next: Going Further Up: Under the Hood Previous: The sniffle Interpreter

Camera Pan-Tilt Controller

When a client-end user clicks on a ``button'' of the pan-tilt control panel imagemap, the Web client submits the coordinates of the image pixel which was clicked to the IMAGEMAP.EXE program on the server using the GET method. The first coordinate (``'') represents the distance from the left border of the image that was clicked and the second (``'') refers to distance from the top edge. The IMAGEMAP.EXE program checks the appropriate map file to decide what to do. Here's the map file:


default /webrti/default.htm
 
rect /cgi-win/webrti.exe?commandstring=source+u&rf=pantilt.htm  136,88  168,120
rect /cgi-win/webrti.exe?commandstring=source+d&rf=pantilt.htm  136,168 168,200
rect /cgi-win/webrti.exe?commandstring=source+l&rf=pantilt.htm  96,128  128,160
rect /cgi-win/webrti.exe?commandstring=source+r&rf=pantilt.htm  176,128 208,160
 
rect /cgi-win/webrti.exe?commandstring=source+bu&rf=pantilt.htm 136,48  168,80
rect /cgi-win/webrti.exe?commandstring=source+bd&rf=pantilt.htm 136,208 168,240
rect /cgi-win/webrti.exe?commandstring=source+bl&rf=pantilt.htm 56,128  88,160
rect /cgi-win/webrti.exe?commandstring=source+br&rf=pantilt.htm 216,128 248,160

If the coordinates submitted by the client do not fall within any of the rectangles defined in this file, a default message (essentially ``you missed'') is retured from the file specified on the first line of the map file above. But if they fall within the rectangle with upper-right coordinates 176,128 and lower-right coordinates 208,160 the IMAGEMAP.EXE program activates WEBRTI.EXE and passes to it a query string. The query string, commandstring=source+r&rf=pantilt.htm, contains two key-value pairs. The first tells WEBRTI.EXE to execute the batch of commands contained in file R.RTI. The second tells WEBRTI.EXE to return file PANTILT.HTM to the client instead of the usual diagnostic output. This means that the client gets back the same camera-control form that he/she started with, which is better than having the control panel disappear every time it's clicked.

Some details are omitted from the discussion above. For the full story on using clickable imagemaps with the WinHTTPD server, read the documentation that accompanies the server.


tpkelly@cs.CS.Princeton.EDU
Thu Sep 14 02:35:48 EDT 1995