QueryComplete.js 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. *查询完毕
  3. */
  4. dojo.connect("QueryObjectByWhereCompHandle", QueryObjectCompHandle);
  5. dojo.connect("QueryObjectByWhereFaultHandle", QueryObjectFaultHandle);
  6. function QueryObjectCompHandle(resultFeatures,token){
  7. // alert (resultFeatures.displayFieldName+token);
  8. if(!resultFeatures.hasOwnProperty("features") || resultFeatures.features.length == 0){
  9. alert( "无相关查询数据!");
  10. }
  11. else {
  12. var results = resultFeatures.features;
  13. var showFeaturesArray = new Array();
  14. var defaultPointSymbol = GetSymbol_SimpleMarkerSymbol();
  15. switch (token){
  16. case "Query":{
  17. searchProjectResultByMap = convertMapQueryResultToArray(results);
  18. var whereStr = getWhereInConditionByArray(searchProjectResultByMap,"OBJECTID");
  19. SearchWhere = whereStr;
  20. QueryProjectInfo(1,whereStr,500000,"QueryAll");
  21. // if(bool_pagination == false)
  22. // dyCretateTableByArray("table_result",searchProjectResultByMap,["项目名称","项目阶段"],["项目","状态"]);
  23. // dojo.forEach(results, function (graphic, i){
  24. // switch (graphic.geometry.type){
  25. // case "point":{
  26. // if (graphic.attributes.项目阶段 == "1")
  27. // graphic.setSymbol(symbol_point_qianqi);
  28. // else if (graphic.attributes.项目阶段 == "2")
  29. // graphic.setSymbol(symbol_point_zaijian);
  30. // else if (graphic.attributes.项目阶段 == "3")
  31. // graphic.setSymbol(symbol_point_jungong);
  32. // }
  33. // }
  34. // graphicShow = graphic;
  35. // showFeaturesArray.push(graphic);
  36. // });
  37. // dojo.connect(GraphicsLayer_myLayer ,"onMouseOver",function(evt){
  38. // showInfoWind(evt);
  39. // });
  40. // dojo.connect(GraphicsLayer_myLayer ,"onClick",function(evt){
  41. // showInfoClick(evt);
  42. // });
  43. // map.infoWindow.on("maximize",infowWindowSetMax);
  44. // map.infoWindow.on("restore",infoWindowSetMin);
  45. // map.infoWindow.on("hide",closeEvent);
  46. // AddObjectToMap(map,GraphicsLayer_myLayer,showFeaturesArray,true,false,100,false);
  47. break;
  48. }
  49. case "QueryPaginationCount":{
  50. searchProjectResultByMap = convertMapQueryResultToArray(results);
  51. document.getElementById("total_count").innerHTML = searchProjectResultByMap.length;
  52. var whereStr = getWhereInConditionByArray(searchProjectResultByMap,"OBJECTID");
  53. SearchWhere = whereStr;
  54. QueryProjectInfo(1,whereStr);
  55. break;
  56. }
  57. case "QuerySelectDp":{
  58. var select_component = document.getElementById("combo_district");
  59. dyCreateSelectOption(results,select_component);
  60. break;
  61. }
  62. case "QueryProjects":{
  63. dojo.forEach(results, function (graphic, i){
  64. switch (graphic.geometry.type){
  65. case "point":{
  66. graphic.setSymbol(defaultPointSymbol);
  67. }
  68. }
  69. graphicShow = graphic;
  70. showFeaturesArray.push(graphic);
  71. });
  72. AddObjectToMap(map,GraphicsLayer_myLayer,showFeaturesArray,true,boolZoom,100,true);
  73. showInfowWindowBreif(showFeaturesArray[0]);
  74. }
  75. }
  76. }
  77. }
  78. function QueryObjectFaultHandle(errorInfo,token){
  79. alert( "查询不成功!");
  80. }