aimsPrint.js
上传用户:gzuoyue
上传日期:2022-07-08
资源大小:177k
文件大小:4k
源码类别:

GIS编程

开发平台:

ASP/ASPX

  1. // aimsPrint.js
  2. /*
  3. *  JavaScript template file for ArcIMS HTML Viewer
  4. * dependent on aimsXML.js, ArcIMSparam.js, aimsCommon.js, aimsMap.js,
  5. * aimsLayers.js, aimsDHTML.js
  6. * aimsClick.js, aimsNavigation.js,
  7. * aimsLegend.js
  8. */
  9. aimsPrintPresent=true;
  10. var printTitle = titleList[4];
  11. var printMapURL="";
  12. var printOVURL="";
  13. var printLegURL="";
  14. var legVis2=false;
  15. /*
  16. ***************************************************************************************
  17. Print functions 
  18. ***************************************************************************************
  19. */
  20. // display print form
  21. function printIt() {
  22. hideLayer("measureBox");
  23. if (useTextFrame) {
  24. parent.TextFrame.document.location = "printform.htm";
  25. } else {
  26. var Win1 = open("printform.htm","PrintFormWindow","width=575,height=150,scrollbars=yes,resizable=yes");
  27. }
  28. }
  29. // create web page for printing
  30. // first get Map
  31. function getPrintMap(title) {
  32. showRetrieveMap();
  33. printTitle=title;
  34. var tempWidth = iWidth;
  35. var tempHeight = iHeight;
  36. iWidth=450;
  37. iHeight=450;
  38. legVis2=legendVisible;
  39. if (aimsLegendPresent) legendVisible=true;
  40. var theString = writeXML();
  41. iWidth=tempWidth;
  42. iHeight = tempHeight;
  43. legendVisible = legVis2;
  44. sendToServer(imsURL,theString,101);
  45. tempWidth=null;
  46. tempHeight=null;
  47. theString=null;
  48. }
  49. // second, get OVMap
  50. function getPrintOV() {
  51. var tempWidth = i2Width;
  52. var tempHeight = i2Height;
  53. i2Width=190;
  54. i2Height=150;
  55. var tempDraw=drawOVExtentBox;
  56. drawOVExtentBox=true;
  57. var theString = writeOVXML();
  58. drawOVExtentBox=tempDraw;
  59. i2Width=tempWidth;
  60. i2Height = tempHeight;
  61. sendToServer(imsOVURL,theString,102);
  62. tempWidth=null;
  63. tempHeight=null;
  64. theString=null;
  65. }
  66. // third, get Legend
  67. function getPrintLegend() {
  68. //  waiting for Legend tags
  69. if (printLegURL=="") printLegURL = "images/nolegend.gif";
  70. writePrintPage();
  71. }
  72. // fourth, write the web page
  73. function writePrintPage() {
  74. var Win1 = open("","PrintPage");
  75. //Win1.document.open();
  76. Win1.document.writeln('<html><meta http-equiv="Content-Type" content="text/html; charset=' + charSet + '">');
  77. Win1.document.writeln('<meta http-equiv="imagetoolbar" content="false">');
  78. Win1.document.writeln('<head><title>' + titleList[5] + '</title>');
  79. Win1.document.writeln('</head>');
  80. Win1.document.writeln('<body BGCOLOR="White" TEXT="Black" LEFTMARGIN=0 TOPMARGIN=0>');
  81. Win1.document.writeln('<FONT FACE="Arial"><B>');
  82. Win1.document.writeln('<TABLE WIDTH="650" BORDER="2" CELLSPACING="0" CELLPADDING="0" NOWRAP>');
  83. Win1.document.writeln(' <TR>');
  84. Win1.document.writeln(' <TH COLSPAN="2">' + printTitle + '</TH>');
  85. Win1.document.writeln(' </TR>');
  86. Win1.document.writeln(' <TR>');
  87. Win1.document.write(' <TD WIDTH="450" HEIGHT="450"');
  88. if (hasOVMap) Win1.document.write(' ROWSPAN="2"');
  89. Win1.document.writeln('>');
  90. Win1.document.writeln(' <IMG SRC="' + printMapURL + '" WIDTH=450 HEIGHT=450 HSPACE=0 VSPACE=0 BORDER=0 ALT="">');
  91. Win1.document.writeln(' </TD>');
  92. if (hasOVMap) {
  93. Win1.document.writeln(' <TD HEIGHT="150" ALIGN="CENTER">');
  94. Win1.document.writeln(' <IMG SRC="' + printOVURL + '" WIDTH=190 HEIGHT=150 HSPACE=0 VSPACE=0 BORDER=0 ALT="">');
  95. Win1.document.writeln(' </TD>');
  96. }
  97. Win1.document.writeln(' </TR>');
  98. Win1.document.writeln(' <TR>');
  99. Win1.document.writeln(' <TD ALIGN="CENTER" VALIGN="TOP">');
  100. Win1.document.writeln(' <IMG SRC="' + printLegURL + '" HSPACE=0 VSPACE=0 BORDER=0 ALT="">');
  101. Win1.document.writeln(' </TD>');
  102. Win1.document.writeln(' </TR>');
  103. Win1.document.writeln('</TABLE>');
  104. Win1.document.writeln('</B></FONT>');
  105. //Win1.document.writeln('</body></html>');
  106. Win1.document.close();
  107. legendVisible=legVis2;
  108. Win1=null;
  109. hideRetrieveMap();
  110. }