<br><font size=2 face="sans-serif">Hello,</font>
<br><font size=2 face="sans-serif">I'm building an application where a
user can 'switch' between .map files using a dropdown/combo box, and use
the same 'template.html' file.</font>
<br>
<br><font size=2 face="sans-serif">I've modified the index.html to accept
user input via a combo box (user selects what project .map file they want
to view), and have the .map load in the template.</font>
<br><font size=2 face="sans-serif">I can view the first project without
any problem. However, when I select the second project, it loads
fine, but it seems to maintain the coordinate system and extents of the
first project.</font>
<br><font size=2 face="sans-serif">Since they have 2 very different coordinate
systems and extents, I'm unable to view the second project.</font>
<br>
<br><font size=2 face="sans-serif">Any body have any suggestions? I
feel it has to do with the section around $oApp = new SampleApp();,
where the app is made. Maybe these need to be reset somehow?</font>
<br><font size=2 face="sans-serif">Below is my index.phtml file.</font>
<br><font size=2 face="sans-serif">Thanks in advance.</font>
<br>
<br><font size=2 face="sans-serif"><html></font>
<br><font size=2 face="sans-serif"><head></font>
<br><font size=2 face="sans-serif"><script language="javascript"></font>
<br><font size=2 face="sans-serif">window.resizeTo(1028,768); </font>
<br><font size=2 face="sans-serif"></script></font>
<br><font size=2 face="sans-serif"></head></font>
<br><font size=2 face="sans-serif"><body></font>
<br><font size=2 face="sans-serif"><?php</font>
<br>
<br><font size=2 face="sans-serif">//set up combo box and retain user selection</font>
<br><font size=2 face="sans-serif">$values = array('Barbados','Pelee');
</font>
<br><font size=2 face="sans-serif"> echo ' </font>
<br><font size=2 face="sans-serif"> <form method="post"
action="'.$_SERVER['PHP_SELF'].'"> </font>
<br><font size=2 face="sans-serif"> <select
name="Project_Selection">'; </font>
<br><font size=2 face="sans-serif"> for($x = 0; $x < count($values);
$x++) </font>
<br><font size=2 face="sans-serif"> { </font>
<br><font size=2 face="sans-serif"> //
write "selected" if the value matches the one posted </font>
<br><font size=2 face="sans-serif"> if($values[$x]
== $_POST['Project_Selection']) </font>
<br><font size=2 face="sans-serif"> {
</font>
<br><font size=2 face="sans-serif">
$selected = ' selected'; </font>
<br><font size=2 face="sans-serif"> }else{
</font>
<br><font size=2 face="sans-serif">
$selected = ''; </font>
<br><font size=2 face="sans-serif"> }
</font>
<br><font size=2 face="sans-serif"> //
print the option </font>
<br><font size=2 face="sans-serif"> echo
' </font>
<br><font size=2 face="sans-serif"> <option
value="'.$values[$x].'"'.$selected.'>'.$values[$x].'</option>';
</font>
<br><font size=2 face="sans-serif"> } </font>
<br><font size=2 face="sans-serif"> echo ' </font>
<br><font size=2 face="sans-serif"> </select>
</font>
<br><font size=2 face="sans-serif"> <input
type="submit" value="Go!">
';</font>
<br><font size=2 face="sans-serif"> //</form>'; </font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">/*</font>
<br><font size=2 face="sans-serif"> * this is a sample of a minimal
application script required to</font>
<br><font size=2 face="sans-serif"> * get a chameleon application
running with a template and a</font>
<br><font size=2 face="sans-serif"> * local map file. Most applications
should actually just</font>
<br><font size=2 face="sans-serif"> * copy this file and modify the
template and mapfile</font>
<br><font size=2 face="sans-serif"> * parts and should not need to
do a lot more here.</font>
<br><font size=2 face="sans-serif"> */</font>
<br>
<br><font size=2 face="sans-serif">$project_choice = $_POST['Project_Selection'];</font>
<br>
<br><font size=2 face="sans-serif">//echo "$project_choice";</font>
<br>
<br><font size=2 face="sans-serif">$gszAppPath = dirname(__FILE__);</font>
<br>
<br><font size=2 face="sans-serif">include( "../../htdocs/chameleon.php"
);</font>
<br>
<br><font size=2 face="sans-serif">$szTemplate = dirname(__FILE__)."/GIS_template.html";</font>
<br><font size=2 face="sans-serif">//$szTemplate = dirname(__FILE__)."/$project_choice.html";</font>
<br><font size=2 face="sans-serif">$szMapFile = dirname(__FILE__)."/../map/$project_choice.map";</font>
<br>
<br><font size=2 face="sans-serif">class SampleApp extends Chameleon</font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif"> function SampleApp()</font>
<br><font size=2 face="sans-serif"> {</font>
<br><font size=2 face="sans-serif"> parent::Chameleon();</font>
<br><font size=2 face="sans-serif"> $this->moMapSession
= new MapSession_RW;</font>
<br><font size=2 face="sans-serif"> $this->moMapSession->setTempDir(
getSessionSavePath());</font>
<br><font size=2 face="sans-serif"> }</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">// add some sort of reset?</font>
<br>
<br><font size=2 face="sans-serif">$oApp = new SampleApp();</font>
<br><font size=2 face="sans-serif">$oApp->registerSkin( 'skins/sample'
);</font>
<br><font size=2 face="sans-serif">$oApp->CWCInitialize( $szTemplate,
$szMapFile );</font>
<br><font size=2 face="sans-serif">$oApp->CWCExecute();</font>
<br>
<br><font size=2 face="sans-serif">echo '</form>'; </font>
<br><font size=2 face="sans-serif">?></font>
<br><font size=2 face="sans-serif"></body></font>
<br><font size=2 face="sans-serif"></html></font>
<br><font size=2 face="sans-serif"><br>
</font>
<br><font size=2 face="sans-serif">Using Chameleon 2.2, MapServer 4.4,
PHP 4.3.7</font>
<br>
<br><font size=2 face="sans-serif">Kevin</font>