Zoom to custom extent - PHP

Kevin Grootendorst kgrootendorst at BAIRD.COM
Wed Jan 26 11:36:12 EST 2005


Hi Bill,
The quick zoom seems to be working now, but the ROSA tools do not respond,
nor does the legend/layer list.  I moved the code in the 'contents.php'
to 'higher up' in the file (no longer at bottom).  Once I select the region
from the dropdown list, and click refresh, the map zooms to where it
should.  However, the list defaults back to the first option.  It would
also be nice to implement an 'onchange' event, so that I don't have to use
the refresh button to zoom to the region (I'm wondering when things do
work, if adding a layer and refreshing will automatically zoom to the first
extent in the 'View Region' drop down list).

Kevin


On Wed, 26 Jan 2005 07:29:44 -0500, William Bronsema
<wbronsema at DMSOLUTIONS.CA> wrote:

>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