Zoom to custom extent - PHP

William Bronsema wbronsema at DMSOLUTIONS.CA
Tue Jan 25 14:21:19 EST 2005


Kevin,

Everything looks to be in order.  Yes, this *should* be all you need.  Be
sure that the "ViewRegion" list is inside the form tags (i.e. between <form>
and </form>).

As well, you can modify the code to give you some feedback on what is
happening:

i.e.

 // check if quick zoom is requested
 if ( isset( $http_form_vars['ViewRegion'] ) &&
strlen($http_form_vars['ViewRegion'] ) > 0 )
 {
        // debug
        echo 'quick zoom now.....';

     // separate values
     $adExtents = explode( ',', $http_form_vars['ViewRegion'] );

     // set extent
     $oMapSession->oMap->setExtent( $adExtents[0],
$adExtents[1],$adExtents[2], $adExtents[3] );
 }
else
{
    echo 'no quick zoom';
}

If you run that, you should see the appropriate message based on what you
are doing.

Regards,
Bill

________________________________________________
William A. Bronsema, C.E.T.
Applications and Software Development,
DM Solutions Group Inc.



> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Kevin Grootendorst
> Sent: January 25, 2005 2:11 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] Zoom to custom extent - PHP
>
> Bill,
> Thanks for the direction.  I'm still a little stuck.  Just to clarify, I
> have the following code:
>
> ----------
> In my app_contents.php file:
>
> <SELECT NAME="ViewRegion">
> <OPTION VALUE="7120999 827999 7599999 1119999">Lake Ontario</OPTION>
> <OPTION VALUE="7200000 833270 7291840 894520">Niagara (ON)</OPTION>
> <OPTION VALUE="7150000 878000 7210000 880000">Hamilton-Wentworth</OPTION>
> </SELECT >
>
> ----------
> In my app.php file:
>
> (the code that you provided)
> // check if quick zoom is requested
> if ( isset( $http_form_vars['ViewRegion'] ) && strlen($http_form_vars
> ['ViewRegion'] ) > 0 )
> {
>     // separate values
>     $adExtents = explode( ',', $http_form_vars['ViewRegion'] );
>
>     // set extent
>     $oMapSession->oMap->setExtent( $adExtents[0], $adExtents[1],$adExtents
> [2], $adExtents[3] );
> }
> -----------
>
> This isn't quite working yet, but is this really all the code I'll need?
> Should my drop-down box be set as a form?
> Thanks again for your help - this has been very frustrating.
>
> Kevin



More information about the mapserver-users mailing list