I open a new window from the current window to display maps.
Several maps of different sizes can be displayed. The function is given the
size of the map and adjusts the window size accordingly.
If a new window is already open, the new map sizes are ignored and the new
map is is either too small for the existing "new" window or too big, which
is a more serious problem!
I've tried to fix this by closing the new window if it is already open using
the code below, but to no avail. It seems the typeof(MapWindo w) is always
undefined. The function is in a .js file. Is it all right to declare global
variables in a .js file?
Any help much appreciated.
var MapWindow;
function OpenMapWindow(s rc, vwidth, vheight)
{
if(typeof(MapWi ndow) != "undefined" && MapWindow.close d == false)
{
MapWindow.close ();
}
MapWindow = window.open(src , "NewWindow" , "width=" + vwidth + ",height=" +
vheight +
",left=100,top= 100,resizable=n o,toolbar=no,sc rollbars=no,men ubar=no");
MapWindow.focus ();
}
Several maps of different sizes can be displayed. The function is given the
size of the map and adjusts the window size accordingly.
If a new window is already open, the new map sizes are ignored and the new
map is is either too small for the existing "new" window or too big, which
is a more serious problem!
I've tried to fix this by closing the new window if it is already open using
the code below, but to no avail. It seems the typeof(MapWindo w) is always
undefined. The function is in a .js file. Is it all right to declare global
variables in a .js file?
Any help much appreciated.
var MapWindow;
function OpenMapWindow(s rc, vwidth, vheight)
{
if(typeof(MapWi ndow) != "undefined" && MapWindow.close d == false)
{
MapWindow.close ();
}
MapWindow = window.open(src , "NewWindow" , "width=" + vwidth + ",height=" +
vheight +
",left=100,top= 100,resizable=n o,toolbar=no,sc rollbars=no,men ubar=no");
MapWindow.focus ();
}
Comment