More tweaks to get the map working. At the moment, the clickable area is off because it's not scaled like the actual image is. I'll have to work on that next.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@34 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -1,24 +1,46 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<DIV>
|
||||
<?php
|
||||
echo $html->image(array('controller' => 'maps',
|
||||
'action' => 'map',
|
||||
$info['map_id']),
|
||||
array('alt' => 'Site Map',
|
||||
'class' => 'imagemap',
|
||||
'usemap' => '#mapimg'));
|
||||
?>
|
||||
<DIV class="map">
|
||||
<MAP name="mapzones"><?php
|
||||
{// for indentation purposes
|
||||
// Go through each unit, adding a clickable region for the unit
|
||||
foreach ($info['units'] AS $unit){
|
||||
echo(' <area shape="rect"' .
|
||||
' coords="' .
|
||||
$unit['left'] . ',' .
|
||||
$unit['right'] . ',' .
|
||||
$unit['top'] . ',' .
|
||||
$unit['bottom'] .
|
||||
'" href="' .
|
||||
$html->url(array('controller' => 'units',
|
||||
'action' => 'view',
|
||||
$unit['id'])) .
|
||||
'" alt="' .
|
||||
$unit['name'] .
|
||||
'">' . "\n");
|
||||
}
|
||||
}// for indentation purposes
|
||||
?>
|
||||
|
||||
</MAP>
|
||||
<?php
|
||||
echo $html->image(array('controller' => 'maps',
|
||||
'action' => 'map',
|
||||
$info['map_id']),
|
||||
array('alt' => 'Site Map',
|
||||
'class' => 'map',
|
||||
'usemap' => '#mapzones'));
|
||||
?>
|
||||
|
||||
</DIV>
|
||||
|
||||
<DIV>
|
||||
<DIV class="legend">
|
||||
<?php
|
||||
/*
|
||||
$html->image(array('controller' => 'maps',
|
||||
'action' => 'legend',
|
||||
$map['Map']['id']),
|
||||
array('alt' => 'Site Map Legend'));
|
||||
*/
|
||||
echo $html->image(array('controller' => 'maps',
|
||||
'action' => 'legend',
|
||||
$info['map_id']),
|
||||
array('alt' => 'Site Map Legend',
|
||||
'class' => 'map'));
|
||||
?>
|
||||
</DIV>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user