Zoom to custom extent - PHP

Kristjan Annus kristjan at TARKVARASTUUDIO.EE
Fri Jan 21 02:39:18 EST 2005


Hi Kevin.

This JavaScript looks correct, and the problem is on the
code in the server side. You have to do something with this

ViewRegion values in PHP. $map->setextent(...) for
example.


Kristjan

>I'm trying to create a simple drop down list with a few place names, so
>that users can click on a name and the map will automatically zoom to a
>custom extent.
>However, I'm having some trouble with this.  When I click on the place
>name, the whole page just reloads and does not zoom to the extent.  Any
>help would be appreciated.
>I'm using PHP 4.3.4 and MapServer 4.2 (built with MapLab 2.2)
>
>Code (in my 'contents.php' file):
>
><SCRIPT LANGUAGE="JavaScript">
>
>function CustomView()
>{
>    if (document.forms[0].ViewRegion.selectedIndex != 0 &&
>        document.forms[0].ViewRegion.selectedIndex !=1)
>    document.forms[0].submit();
>}
>
></SCRIPT>
>
>and
>
><SELECT NAME="ViewRegion"  onChange="CustomView()">
>         <OPTION>Quick View - Under Development</OPTION>
>                <OPTION VALUE="7121000,828000,7600000,1120000">Lake Ontario
>Region</OPTION>
>                <OPTION VALUE="7200000,833270,7291840,894520">Niagara (ON)
></OPTION>
></SELECT >
>
>



More information about the mapserver-users mailing list