Zoom to custom extent - PHP

William Bronsema wbronsema at DMSOLUTIONS.CA
Wed Jan 26 07:29:44 EST 2005


Kevin,

The javascript error is not preventing your map from zooming, something else
is.  There is likely some other PHP code that is resetting the extents after
your quick zoom code.

The javascript error you are getting occurs because the function you listed
cannot find the hidden textbox called "QueryString".  Did you happen to
remove it or move it outside of the form called "main"?

Send me your app off-list and I will take a quick look.

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:52 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] Zoom to custom extent - PHP
>
> I've implemented the code, and now I'm even convinced it should work.  But
> no such luck yet.  The debugging works just as it should, but when it
> should 'quick zoom now', the map still draws to the project's max extents.
> However, I do receive a windows js error box indicating a problem in the
> app.phmtl file:
>
> 'document.main.QueryString.value' is null or not an object.
>
>
> Here is my javascript from the .phtml file:
>
> <script language="javascript">
> window.resizeTo(1024,768);
> /**
>  * This function runs after the form is done loading
>  **/
> function doneLoading()
> {
>     // show the query results page if query
>     if ( document.main.QueryString.value != "" )
>     {
>         // complete the string
>         document.main.QueryString.value = "?PrevStateKey=" +
> document.main.PrevStateKey.value + "&INPUT_COORD=" +
> document.main.INPUT_COORD.value;
>
>         // calculate the center
>         if (document.all)
>             var xMax = screen.width, yMax = screen.height;
>         else if (document.layers)
>             var xMax = window.outerWidth, yMax = window.outerHeight;
>         else
>             //var xMax = 640, yMax=480;
>   var xMax = 800, yMax=600;
>         var xOffset = (xMax - 510)/2, yOffset = (yMax - 390)/2;
>
> //QUERY RESULTS WINDOW
>         // load the processing page
>         mapquery = window.open('query.phtml' +
> document.main.QueryString.value,'mapquery','scrollbars=yes,resizable=yes,w
> id
> th=800,height=600,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',
> le
> ft='+xOffset+'');
>
>         // give it focus
>         mapquery.focus();
>
>     }
>
>     // exit
>     return;
> }
>
> </script>
>
>
> Could this somehow be preventing my php code from working?



More information about the mapserver-users mailing list