[ka-Map-users] viewport width undefined

Scott Melby melby at turnkey-technology.com
Wed Mar 8 15:20:58 EST 2006


Hello -

I have recently installed ka-map using ms4w on my Win2k professional box 
and got it to serve my maps etc. perfectly.  I really like it!  However, 
now I am having some trouble moving it to a Win 2003 server box.  The 
symptom I am seeing is that I get a JS error from kaMap.js "Error: 
Invalid Argument".  Debugging the JS shows that I am in zoomToExtents() 
which was called from selectMap() which was called from the JS returned 
from init.php.  The issue is at the following line of code

this.theInsideLayer.style.left = -1*(vpLeft - this.xOrigin) + "px";
and the problem is that vpLeft is NaN (not a number) which stems from 
the fact that this.viewportWidth is also NaN.

I have done the following in an attempt to debug this
1) Verified that calling mapserver on that server directly via a URL 
returns a valid map.
2) Verified that calling init.php in the browser returns "reasonable 
looking" code.
3) Verified that php can create files in the configured ka-cache 
directory by creating a php page that creates a file and invoking it 
from a browser.

Here is some other potentially helpful information on this issue
init.php from working server returns
/*init*/aszScales=new 
Array(2000000,1500000,1000000,750000,500000,100000,50000,25000,10000);var 
map = new _map( 'pams', 'PAMS', 0, 5, 
aszScales);map.setDefaultExtents(-80.815,39.59,-74.4,42.397);map.setBackgroundColor('rgb(255,255,255)');map.addLayer(new 
_layer( '__base__', true, 100, 'png',false, new 
Array(1,1,1,1,1,1,1,1,1)));map.resolution = 72;this.addMap( map 
);this.tileWidth=300;this.tileHeight=300;this.server = 
'http://cheyenne.turnkey-technology.com:88/kamap/';this.tileURL = 
'tile.php';this.selectMap('pams');

init.php from broken server returns
/*init*/aszScales=new 
Array(2000000,1500000,1000000,750000,500000,100000,50000,25000,10000);var 
map = new _map( 'pams', 'PAMS', 0, 3, 
aszScales);map.setDefaultExtents(-252600,-148033.591,274400,165545.107);map.setBackgroundColor('rgb(255,255,255)');map.addLayer(new 
_layer( '__base__', true, 100, 'gif',false, new 
Array(0,0,0,0,0,0,0,0,0)));map.resolution = 72;this.addMap( map 
);this.tileWidth=300;this.tileHeight=300;this.server = 
'http://dev.keystoneresearchmap.org\/';this.tileURL = 
'tile.php';this.selectMap('pams');

We never see any tiles getting created in the tmp directory.

Any help is greatly appreciated.  I am sure this is a rookie config 
error :(

Thanks
Scott





More information about the ka-Map-users mailing list