Forum Moderators: coopster
The school map for one school appears twice
[example.com...]
All other school maps are coming up perfectly which uses the same logic.
Can anyone of you suggest what could be the problem?
[example.com...]
Thanks in advance,
Sarath.
[edited by: jatar_k at 4:31 pm (utc) on May 5, 2005]
[edit reason] no urls thanks [/edit]
<?if($longitude && $latitude){?>
<tr>
<?
$mapfile = "school_maps/zoom5/" . $school_id . "_map.gif";
$scalefile = "school_maps/zoom5/" . $school_id . "_scale.gif";
$name = ucwords($name);
$altname = urlencode($name);
if(! file_exists($mapfile) &&! file_exists($scalefile)){
$mapurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif? off=streets,counties&on=cities,states,GRID& murl=http://tiger.census.gov/tigerwww/mission2& lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350&iwd=475&mark= $longitude,$latitude,redstar,$altname;");
//print $mapurl . "<br>";
$scaleurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif? legend=on&lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350&iwd=475& mark=$longitude,$latitude,redstar,$altname;");
$img=GrabImage($mapurl, $school_id . "_map");
$img=GrabImage($scaleurl, $school_id . "_scale");
}
?>
<td colspan=3 valign="center" align="middle"><img src="<?=$mapfile?>" alt="Map showing location of <?=$name?>" border="0"></td></tr>
<tr><td colspan=3><img src="scale.gif" alt="Map legend" border="0"></td></tr>
<?}?>
[edited by: jatar_k at 4:32 pm (utc) on May 5, 2005]
[edit reason] fixed sidescroll [/edit]
Here is the modified code
<?if(!file_exists($mapfile) &&!file_exists($scalefile)){?>
<tr><td class="header" colspan=3>School Map:<A name="schoolmap"></A></td></tr>
<tr>
<?
$mapfile = "school_maps/zoom5/" . $school_id . "_map.gif";
$scalefile = "school_maps/zoom5/" . $school_id . "_scale.gif";
$name = ucwords($name);
$altname = urlencode($name);
if(! file_exists($mapfile) &&! file_exists($scalefile)){
$mapurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif?off=streets,counties& on=cities,states,GRID&murl=http://tiger.census.gov/tigerwww/mission2& lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350&iwd=475& mark=$longitude,$latitude,redstar,$altname;");
//print $mapurl . "<br>";
$scaleurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif?legend=on& lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350& iwd=475&mark=$longitude,$latitude,redstar,$altname;");
$img=GrabImage($mapurl, $school_id . "_map");
$img=GrabImage($scaleurl, $school_id . "_scale");
}
?>
<td colspan=3 valign="center" align="middle"><img src="<?=$mapfile?>" alt="Map showing location of <?=$name?>" border="0"></td></tr>
<tr><td colspan=3><img src="scale.gif" alt="Map legend" border="0"></td></tr>
<?}?>
[edited by: jatar_k at 6:21 pm (utc) on May 5, 2005]
[edit reason] fixed url and sidescroll [/edit]
<?if($longitude && $latitude){?>
<tr><td class="header" colspan=3>School Map:<A name="schoolmap"></A></td></tr>
<tr>
<?
$mapfile = "school_maps/zoom5/" . $school_id . "_map.gif";
$scalefile = "school_maps/zoom5/" . $school_id . "_scale.gif";
$name = ucwords($name);
$altname = urlencode($name);
if(!file_exists($mapfile) &&!file_exists($scalefile)){
$mapurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif?off=streets,counties&on=cities,states,GRID&murl=http://tiger.census.gov/tigerwww/mission2&lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350&iwd=475&mark=$longitude,$latitude,redstar,$altname;");
//print $mapurl . "<br>";
$scaleurl = ("http://tiger.census.gov/cgi-bin/mapgen/.gif?legend=on&lat=$latitude&lon=$longitude&wid=$wid&ht=$ht&iht=350&iwd=475&mark=$longitude,$latitude,redstar,$altname;");
$img=GrabImage($mapurl, $school_id . "_map");
$img=GrabImage($scaleurl, $school_id . "_scale");
}
?>
<td colspan=3 valign="center" align="middle"><img src="<?=$mapfile?>" alt="Map showing location of <?=$name?>" border="0"></td></tr>
<tr><td colspan=3><img src="scale.gif" alt="Map legend" border="0"></td></tr>
<?}?>