Zoom to custom extent - PHP
Kevin Grootendorst
kgrootendorst at BAIRD.COM
Tue Jan 25 11:51:56 PST 2005
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,wid
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