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

GIS编程

开发平台:

ASP/ASPX

  1. // aimsCustom.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. */
  8. // global variables
  9. aimsCustomPresent=true;
  10. // change these to send XML response to custom function.
  11. // use numbers >= 1000 and match in useCustomFunction()
  12. // defaults are defined in aimsXML.js and use standard functions
  13. // xml response mode for selection
  14. selectXMLMode = 6;
  15. // xml response mode for identify
  16. identifyXMLMode = 7;
  17. // xml response mode for query
  18. queryXMLMode = 8;
  19. // xml response mode for find
  20. findXMLMode = 14;
  21. // xml response mode hyperlink
  22. hyperlinkXMLMode = 15;
  23. // custom function for handling clicks 
  24. //  flow redirected here when
  25. // toolMode set to >=1000
  26. function customMapTool(e) {
  27. if (toolMode == 1001) {
  28. // insert code here
  29. return false;
  30. }
  31. if (toolMode == 1002) {
  32. // insert code here
  33. }
  34. }
  35. // send  XML response to custom function
  36. // flow  redirected here when
  37. // XMLMode >=1000
  38. function useCustomFunction(theReply) {
  39. if (XMLMode==1001) {
  40. setCustomLayerFieldsend(theReply);
  41. } else if (XMLMode==1002) {
  42. // insert code here
  43. } else {
  44. alert(msgList[55] + XMLMode + msgList[56]);
  45. }
  46. hideLayer("LoadData");
  47. }
  48. // add custom stuff to Map XML request. . . between selection and geocode
  49. function addCustomToMap1(){
  50. var customString = "";
  51. if (mCustomLayer.bCustomLayer){
  52. // customString = mCustomLayer.getCustomLayerString();
  53. //全部临时图层的属性
  54. customString += getCustonmsWorkSpace();
  55. if (CustonmsLayerAddNum!=0){
  56. var _CusStr = '';
  57. var _old = mCustomLayer.getCustomLayerString();
  58. //alert(LayerVisible.join('n'));
  59. for (var ji=CustonmsLayerBegin[0];ji<LayerVisible.length;ji++){
  60. CustonmsLayerVisible[ji] = LayerVisible[ji+serverLayerCount];
  61. }
  62. //alert(CustonmsLayerVisible.join('n'));
  63. for (var iK=0;iK<CustonmsLayerAddNum;iK++){
  64. _CusStr = '';
  65. //alert(CustonmsLayerBegin[iK]+'n'+CustonmsLayerEnd[iK])
  66. for (var i=CustonmsLayerBegin[iK];i<CustonmsLayerEnd[iK]+1;i++) {
  67. if (CustonmsLayerVisible[i]==1){
  68. _CusStr += 'true,';
  69. }else{
  70. _CusStr += 'false,';
  71. }
  72. }
  73. //alert(CustonmsLayerVisible.join('n'));
  74. mCustomLayer.setCustomLayerString(CustonmsLayerString[iK]);
  75. //alert(CustonmsLayerBegin[iK]+'n'+CustonmsLayerEnd[iK]+'n'+CustonmsLayerString[iK]+'n'+_CusStr);
  76. mCustomLayer.setLayerVisible(_CusStr);
  77. CustonmsLayerString[iK] = mCustomLayer.getCustomLayerString();
  78. customString += getCustonmsLayerList(CustonmsLayerString[iK])//CustonmsLayerString[iK];
  79. //alert(customString);
  80. }
  81. mCustomLayer.setCustomLayerString(_old);
  82. //完毕
  83. }else{
  84. customString = mCustomLayer.getCustomLayerString();
  85. }
  86. }
  87. return customString;
  88. }
  89. // add custom stuff to Map XML request. . . between clickpoints and copyright
  90. function addCustomToMap2(){
  91. var customString = "";
  92. return customString;
  93. }
  94. // add custom stuff to Map XML request. . . under modeOnMap
  95. function addCustomToMap3(){
  96. var customString = "";
  97. /*
  98. customString += '<LAYER type="ACETATE" name="theMode">n';
  99. customString += '<OBJECT units="PIXEL">n<TEXT coords="5 ' + (iHeight-10) + '" label="This is a test">n';
  100. customString += '<TEXTMARKERSYMBOL fontstyle="BOLD" fontsize="12" font="ARIAL" fontcolor="255,255,255" ';
  101. customString += 'threed="TRUE" glowing="'128,0,255" />n</TEXT>n</OBJECT>';
  102. customString += 'n</LAYER>n';
  103. alert(customString);
  104. */
  105. return customString;
  106. }
  107. // add custom stuff to Map XML request. . . on top of everything
  108. function addCustomToMap4(){
  109. var customString = "";
  110. return customString;
  111. }
  112. // extract layers to download
  113. function extractIt() {
  114. hideLayer("measureBox");
  115. alert(msgList[51]);
  116. }