• Russ Fish's avatar
    Add MapQuest-style pan and zoom controls to the floormap.php3 page, and · aa7d57a9
    Russ Fish authored
    generally improve the clarity and appearance of the maps.  The scale factor
    buttons numbered 1-5 actually correspond to scale factors of 1, 1.5, 2, 2.5,
    and 3.
    
    Notice that the floorimages table in the database now has an integer "scale"
    column to distinguish the cached zoomed-in images with a suffix "-[1-5].jpg" .
    
    I use jpeg files instead of the png files that were used before.  They look as
    good or better, and are a third the size.  Panning around at a given zoom
    factor just involves cropping out a different rectangle of the scaled-up
    images.
    
    The 0311X064_[1-4]fl.pdf floor map files we got from Michael Kay started
    out life in Adobe Illustrator.  Although GhostScript/gv crash while
    trying to draw the pdf files, extracting them into PostScript files in
    Acrobat on Coke allows GhostScript to render them flawlessly.
    
    I started out using gs to render jpeg files in the shell, and then
    found that ImageMagick uses the same GhostScript renderer, and nicely
    handles cropping, drawing and annotations, and format conversion as well.
    
    The PostScript rendering gets slow at higher zoom factors.  So I cache the
    zoomed floor images, scaled up by rendering the PostScript files at a finer
    dot-pitch (density) in GhostScript, and then cropping out the right rectangle
    to register them properly.
    
    For readability, and to avoid having the thin lines and bitmap fonts used in
    some parts of the PostScript map from falling between the pixel cracks, I
    actually render at twice the pixel density and filter down to the final image
    with a gaussian -sharpen option to keep it from looking blurry.
    
    ImageMagick is callable from both the shell and as the Image::Magick package
    in Perl.  I converted the Perl logic in floormap.in to use Image::Magick
    instead of the GD graphics library, resulting in anti-aliased (smoothed)
    drawing of the wireless node dots and labels on floor maps for a better
    appearance.  Then I added optional scaling and centering arguments which
    select the proper cached zoomed-in image, and drive the logic for cropping and
    drawing.
    
    I modified the floormap.php3 file to wrap an input form around a set of zoom
    control buttons and the floormap image.  The zoom buttons set the scale
    argument to the Perl floormap script called on the server.  The floor map
    image itself is wrapped in a graphical submit button, so clicking on it
    returns the mouse coordinates within the image, which are then sent to the
    centering argument of the Perl script.
    aa7d57a9
Name
Last commit
Last update
account Loading commit data...
apache Loading commit data...
assign Loading commit data...
autoconf Loading commit data...
capture Loading commit data...
cdrom Loading commit data...
db Loading commit data...
delay/linux Loading commit data...
dhcpd Loading commit data...
discvr Loading commit data...
doc Loading commit data...
event Loading commit data...
hw_config Loading commit data...
hyperviewer Loading commit data...
install Loading commit data...
ipod Loading commit data...
lib Loading commit data...
os Loading commit data...
patches Loading commit data...
pxe Loading commit data...
rc.d Loading commit data...
rpms Loading commit data...
security Loading commit data...
sensors Loading commit data...
sql Loading commit data...
ssl Loading commit data...
sysadmin Loading commit data...
tbsetup Loading commit data...
testsuite Loading commit data...
tip Loading commit data...
tmcd Loading commit data...
tools Loading commit data...
utils Loading commit data...
vis Loading commit data...
www Loading commit data...
xmlrpc Loading commit data...
BUGS Loading commit data...
GNUmakefile.in Loading commit data...
GNUmakerules Loading commit data...
GPL-COPYING Loading commit data...
LICENSE Loading commit data...
Makeconf.in Loading commit data...
README Loading commit data...
TODO Loading commit data...
TODO.plab Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
defs-aerolab Loading commit data...
defs-barb-emulab Loading commit data...
defs-barb-mini Loading commit data...
defs-calfeld-emulab Loading commit data...
defs-davidand-emulab Loading commit data...
defs-default Loading commit data...
defs-duerig-emulab Loading commit data...
defs-example Loading commit data...
defs-gatech Loading commit data...
defs-kwebb-emulab Loading commit data...
defs-mini Loading commit data...
defs-newbold-emulab Loading commit data...
defs-newbold-macdb Loading commit data...
defs-newbold-mini Loading commit data...
defs-rchriste-emulab Loading commit data...
defs-ricci-emulab Loading commit data...
defs-ricci-mini Loading commit data...
defs-shash-emulab Loading commit data...
defs-shash-mini Loading commit data...
defs-stoller-emulab Loading commit data...
defs-stoller-home Loading commit data...
defs-stoller-mini Loading commit data...
defs-uky Loading commit data...
defs-wide Loading commit data...