6837f95a8cc4ddda2c0e998b1570f9c2a98e91b7.svn-base 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404
  1. /**
  2. * gis地图辅助工具类
  3. * @author zmy
  4. * @version 1.0
  5. * @Date 2015-09-23
  6. */
  7. var ai = null;
  8. $(function(){ai = new AlertIframe();});
  9. GisUtil = function(){
  10. var _this = this ;
  11. /*---------------------------------------------定义路径start---------------------------------------------------*/
  12. var allPath = window.location.href;
  13. var indexPath = window.location.pathname;
  14. var index = allPath.indexOf(indexPath);
  15. //var pathEM = allPath.substring(0,index+1);
  16. //var pathCon = pathEM + indexPath.substring(1, 26);
  17. var path = allPath.substring(0,index);
  18. var pathIcon = path + $.pathname() + "/images/cockpit/gis/" ;
  19. /*---------------------------------------------定义路径end---------------------------------------------------*/
  20. /*---------------------------------------------查询框用部门JSON格式数据 start---------------------------------------------------*/
  21. var deptId = "" ;//部门信息id字符串
  22. var userInfo = null ;//用户信息
  23. var subDept = {} ;//部门信息
  24. var teamInfo = {} ;//队伍信息
  25. var simuMarkerId = null ;//模拟台风路径MarkerID
  26. var stArr = [];//台风历史路径setTimeout
  27. /*---------------------------------------------查询框用部门JSON格式数据 end---------------------------------------------------*/
  28. /*--------------------------------------------线类型 start------------------------------------------------------------*/
  29. var lineStyleDraw = {style:{"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.5,fillColor:[127,188,249,255]}};//手绘线样式
  30. var lineStyleShow = {"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.7,fillColor:[127,188,249,255]};//手绘线样式
  31. var lineStyleRow = {"strokeColor": [0,51,114,255],"strokeWeight":2,opacity:1,fillColor:[0,51,114,255]} ;//路径折线样式
  32. var lineStyleTrack = {"strokeColor": [190,0,46,255],"strokeWeight":3,opacity:1,fillColor:[108,159,65,255]} ;//轨迹回放
  33. var lineStyleDis = {"strokeColor": [190,0,46,255],"strokeWeight":3,opacity:1,fillColor:[190,0,46,255]} ;//轨迹描述
  34. var lineStyleSimulation = {"strokeWeight":2,opacity:1,fillColor:[190,0,46,255]};
  35. var simulationColor = {1:[0,128,0,255],2:[255,255,0,255],3:[255,165,0,255],4:[255,0,0,255],5:[255,192,203,255],6:[128,0,128,255]};
  36. var simulationMarker = {1:"st_tropic_lp",2:"st_tropic_strom",3:"st_tropic_strom_better",4:"st_typhoon",5:"st_violent_typhoon",6:"st_super_typhoon"};
  37. var simulationStrength = {1:"热带低压",2:"热带风暴",3:"强热带风暴",4:"台风",5:"强台风",6:"超强台风"};
  38. var simulationCircle = {sev:{style:{"strokeWeight":1,opacity:.3},color:[77,184,73,255]},
  39. ten:{style:{"strokeWeight":1,opacity:.5},color:[12,208,250,255]},
  40. tew:{style:{"strokeWeight":1,opacity:.9},color:[124,17,56,255]}};
  41. /*--------------------------------------------线类型 end------------------------------------------------------------*/
  42. /*------------------------------------------------应急资源图标存储start---------------------------------------------*/
  43. var lineArr = [] ; //存储线类型数组
  44. var polygonArr = [] ; //存储多边形类型数组
  45. var circleArr = [] ; //存储圆类型
  46. var rectangleArr = [] ;//矩形数组
  47. var originArr = [] ;//起点数组
  48. var siteArr = [] ;//地点
  49. var destinationArr = [] ;//终点
  50. var vehicleArr = [] ;//车辆
  51. var teamArr = [] ;//人员
  52. var lineXYArr = [] ; //存储线类型数组坐标
  53. var polygonXYArr = [] ; //存储多边形类型数组坐标
  54. var circleXYArr = [] ; //存储圆类型坐标
  55. var rectangleXYArr = [] ;//矩形数组坐标
  56. var originXYArr = [] ;//起点数组坐标
  57. var siteXYArr = [] ;//地点坐标
  58. var destinationXYArr = [] ;//终点坐标
  59. var vehicleXYArr = [] ;//车辆坐标
  60. var teamXYArr = [] ;//人员坐标
  61. var drawTypeIds = [] ;
  62. var pi = 0 ;
  63. var simulationPoint = [];
  64. var simuMarker = [];
  65. var simuLine = [];
  66. var psrList = {};
  67. var excelTitle = {"1":"所属单位","2":"电压等级","3":"设备名称","4":"所属设备"};
  68. var gisLengen = [];
  69. var erLengen = [{"name":"erso_house" , "describe":"仓库"},
  70. {"name":"erso_team" , "describe":"队伍"},
  71. {"name":"erso_goods" , "describe":"物资"},
  72. {"name":"origin" , "describe":"起点"},
  73. {"name":"destination" , "describe":"终点"},
  74. {"name":"er_adslabel" , "describe":"地点"},
  75. {"name":"temp_place" , "describe":"临时安置点"},
  76. {"name":"headquarters_place" , "describe":"指挥部"},
  77. {"name":"medicare_place" , "describe":"医疗救护点"},
  78. {"name":"other_place" , "describe":"其他"}];
  79. /*------------------------------------------------应急资源图标存储end-----------------------------------------------*/
  80. /*------------------------------------------------应急资源手绘图形用变量 start---------------------------------------------------*/
  81. var draw_value = {layName:"ersoLayDraw",flag:false,teamId:null,describeinfo:null,icon:null,drawLay:"ersoLayDraw",ls:lineStyleDraw};
  82. /*------------------------------------------------应急资源手绘图形用变量 start---------------------------------------------------*/
  83. /*---------------------------------------------图层的定位坐标组start---------------------------------------------------*/
  84. var mz_ewer = [] ;//应急预警与响应
  85. var mz_er = [] ;//应急资源
  86. /*---------------------------------------------图层的定位坐标组end---------------------------------------------------*/
  87. /*--------------------------------------------应急资源信息start----------------------------------------------------*/
  88. /**
  89. * 应急资源地市级资源标注图标信息
  90. */
  91. var erFlagPref = {} ;
  92. /**
  93. * 应急资源网省级资源标注图标信息
  94. */
  95. var erFlagProv = {} ;
  96. /*--------------------------------------------应急资源信息end---------------------------------------------------*/
  97. /*-------------------------------------------图层名start--------------------------------------------------------*/
  98. /**
  99. * 台风路径模拟绘制,点击后红点出现图层
  100. */
  101. var dtp_lay_point = {name:"dtpLayPoint",show:5, hidden:17,alpha:1,order:1} ;
  102. /**
  103. * 台风路径模拟绘制,折线图层
  104. */
  105. var dtp_lay_line = {name:"dtpLayLine",show:5, hidden:17,alpha:1,order:1} ;
  106. /**
  107. * 台风路径模拟绘制,七级风圈图层
  108. */
  109. var dtp_lay_seven_circle = {name:"dtpLaySeven",show:5, hidden:17,alpha:1,order:1} ;
  110. /**
  111. * 台风路径模拟绘制,十级风圈图层
  112. */
  113. var dtp_lay_ten_circle = {name:"dtpLayTen",show:5, hidden:17,alpha:1,order:1} ;
  114. /**
  115. * 台风路径模拟绘制,十二级风圈图层
  116. */
  117. var dtp_lay_twelve_circle = {name:"dtpLayTwelve",show:5, hidden:17,alpha:1,order:1} ;
  118. /**
  119. * 历史台风路径模拟绘制,点击后红点出现图层
  120. */
  121. var hdtp_lay_point = {name:"hdtpLayPoint",show:5, hidden:17,alpha:1,order:1} ;
  122. /**
  123. * 历史台风路径模拟绘制,折线图层
  124. */
  125. var hdtp_lay_line = {name:"hdtpLayLine",show:5, hidden:17,alpha:1,order:1} ;
  126. /**
  127. * 历史台风路径模拟绘制,七级风圈图层
  128. */
  129. var hdtp_lay_seven_circle = {name:"hdtpLaySeven",show:5, hidden:17,alpha:1,order:1} ;
  130. /**
  131. * 历史台风路径模拟绘制,十级风圈图层
  132. */
  133. var hdtp_lay_ten_circle = {name:"hdtpLayTen",show:5, hidden:17,alpha:1,order:1} ;
  134. /**
  135. * 历史台风路径模拟绘制,十二级风圈图层
  136. */
  137. var hdtp_lay_twelve_circle = {name:"hdtpLayTwelve",show:5, hidden:17,alpha:1,order:1} ;
  138. /**
  139. * 应急预警与响应图标,网省级图层4-6级显示
  140. */
  141. var ewer_lay_prov = {name:"ewerLayProv",show:4,hidden:7,alpha:1,order:1} ;
  142. /**
  143. * 应急预警与响应图标,网省级图层7-14级显示
  144. */
  145. var ewer_lay_pref = {name:"ewerLayPref",show:7,hidden:14,alpha:1,order:1} ;
  146. /**
  147. * 应急资源仓库图标,5-17级显示
  148. */
  149. var erso_lay_so = {name:"ersoLayLabel",show:4,hidden:17,alpha:1,order:1} ;
  150. /**
  151. * 应急资源绘图面板手画图层,5-21级显示
  152. */
  153. var erso_lay_draw = {name:"ersoLayDraw",show:5,hidden:21,alpha:1,order:1} ;
  154. /**
  155. * 应急资源绘图面板展示图层,5-21级显示
  156. */
  157. var erso_lay_show = {name:"ersoLayShowDraw",show:5,hidden:21,alpha:1,order:1} ;
  158. /**
  159. * 应急资源应急队伍定位图层,5-17级显示
  160. */
  161. var erso_lay_team = {name:"ersoLayTeam",show:5,hidden:21,alpha:1,order:1} ;
  162. /**
  163. * 应急资源应急队伍描述轨迹图层,5-17级显示
  164. */
  165. var erso_lay_track = {name:"ersoLayTrack",show:5,hidden:21,alpha:1,order:1} ;
  166. /**
  167. * 应急资源应急队伍描述轨迹图层,5-17级显示
  168. */
  169. var erso_team_playback = {name:"ersoLayPlayback",show:5,hidden:21,alpha:1,order:1} ;
  170. /**
  171. * 应急资源应急队伍分布图层(总计),网省级4-7显示
  172. */
  173. var erso_team_dist = {name:"ersoLayTeamDist",show:4,hidden:8,alpha:1,order:1} ;
  174. /**
  175. * 应急资源应急发电车加发电机分布图层,4-7级显示
  176. */
  177. var erso_car_dist = {name:"ersoLayCarDist",show:4,hidden:8,alpha:1,order:1} ;
  178. /**
  179. * 应急资源应急发电机分布图层,4-7级显示
  180. */
  181. var erso_dynamo_dist = {name:"ersoLayDynameDist",show:4,hidden:8,alpha:1,order:1} ;
  182. /**
  183. * 应急资源临时场所分布图层,7-17级显示
  184. */
  185. var erso_temp_space_dist = {name:"ersoLayTempSpaceDist",show:4,hidden:18,alpha:1,order:1} ;
  186. /**
  187. * 应急资源应急队伍分布图层,地市级7-17显示
  188. */
  189. var erso_team_dist_prev = {name:"ersoLayTeamDistPrev",show:8,hidden:18,alpha:1,order:1} ;
  190. /**
  191. * 应急资源应急发电车分布图层,地市级7-17级显示
  192. */
  193. var erso_car_dist_prev = {name:"ersoLayCarDistPrev",show:8,hidden:18,alpha:1,order:1} ;
  194. /**
  195. * 应急资源应急发电机分布图层,地市级7-17级显示
  196. */
  197. var erso_dynamo_dist_prev = {name:"ersoLayDynameDistPrev",show:8,hidden:18,alpha:1,order:1} ;
  198. /*-------------------------------------------图层名end--------------------------------------------------------*/
  199. /*=============================================方法start==============================================================*/
  200. /**
  201. * 获得表格显示的高度
  202. * @returns {Number} 返回表格数据的高度(不加头尾)
  203. */
  204. this.getGridHieght = function(){
  205. var pageHeight = $(document).height() - 30 - 24 ;
  206. $("#page").width('100%');
  207. $("#page").height(pageHeight);
  208. return pageHeight;
  209. };
  210. /*------------------------------------------- 获得表格显示的高度end--------------------------------------------------------*/
  211. /**
  212. * 得到当前登录用户信息
  213. * @returns {___anonymous6112_6113}
  214. */
  215. this.resolveUrl = function(){
  216. var encondeCondition=window.location.search;
  217. var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
  218. var conditionArr=condition.split("&");
  219. var condJson={};
  220. for(var item in conditionArr){
  221. var temArr=conditionArr[item].split("=");
  222. condJson[temArr[0]]=temArr[1];
  223. }
  224. userInfo = condJson;
  225. return condJson;
  226. };
  227. /*-------------------------------------------得到当前登录用户信息end----------------------------------------------------*/
  228. /**
  229. * 绘制台风模拟路径图层初始化()
  230. * @param
  231. * @version 1.0
  232. * @Date 2015-09-26
  233. */
  234. this.drawTyphoonPathInit = function(){
  235. _this.simulationPoint = [];
  236. _this.pi = 0 ;
  237. _this.simulationPoint = [];
  238. _this.simuMarker = [];
  239. _this.simuLine = [];
  240. addLayer(dtp_lay_point.name,dtp_lay_point.show,dtp_lay_point.hidden,dtp_lay_point.alpha,dtp_lay_point.order) ;//添加红点出现图层
  241. addLayer(dtp_lay_line.name,dtp_lay_line.show,dtp_lay_line.hidden,dtp_lay_line.alpha,dtp_lay_line.order) ;//添加折线图层
  242. _this.windResistingInit();
  243. addEvent("onGetPointEvent",getPointFun);
  244. addEvent('onMarkerClicked',showWindResisting);
  245. };
  246. /**
  247. * 绘制台风模拟路径风圈图层初始化
  248. */
  249. this.windResistingInit = function(){
  250. addLayer(dtp_lay_twelve_circle.name,dtp_lay_twelve_circle.show,dtp_lay_twelve_circle.hidden,dtp_lay_twelve_circle.alpha,dtp_lay_twelve_circle.order) ;//添加十二级风圈图层
  251. addLayer(dtp_lay_ten_circle.name,dtp_lay_ten_circle.show,dtp_lay_ten_circle.hidden,dtp_lay_ten_circle.alpha,dtp_lay_ten_circle.order) ;//添加十级风圈图层
  252. addLayer(dtp_lay_seven_circle.name,dtp_lay_seven_circle.show,dtp_lay_seven_circle.hidden,dtp_lay_seven_circle.alpha,dtp_lay_seven_circle.order) ;//添加七级风圈图层
  253. };
  254. /**
  255. * 查看模拟台风历史路径图层初始化
  256. */
  257. this.historyTyphoonPathInit = function(){
  258. _this.historyLayLoad();
  259. addEvent('onMarkerClicked',showWindResisting);
  260. };
  261. /**
  262. * 模拟台风历史路径图层加载
  263. */
  264. this.historyLayLoad = function(){
  265. addLayer(hdtp_lay_point.name,hdtp_lay_point.show,hdtp_lay_point.hidden,hdtp_lay_point.alpha,hdtp_lay_point.order) ;//添加红点出现图层
  266. addLayer(hdtp_lay_line.name,hdtp_lay_line.show,hdtp_lay_line.hidden,hdtp_lay_line.alpha,hdtp_lay_line.order) ;//添加折线图层
  267. _this.historyTyphoonCircleLoadLay();
  268. };
  269. /**
  270. * 查看历史台风模拟路径风圈图层初始化
  271. */
  272. this.historyTyphoonCircleLoadLay = function(){
  273. addLayer(hdtp_lay_twelve_circle.name,hdtp_lay_twelve_circle.show,hdtp_lay_twelve_circle.hidden,hdtp_lay_twelve_circle.alpha,hdtp_lay_twelve_circle.order) ;//添加十二级风圈图层
  274. addLayer(hdtp_lay_ten_circle.name,hdtp_lay_ten_circle.show,hdtp_lay_ten_circle.hidden,hdtp_lay_ten_circle.alpha,hdtp_lay_ten_circle.order) ;//添加十级风圈图层
  275. addLayer(hdtp_lay_seven_circle.name,hdtp_lay_seven_circle.show,hdtp_lay_seven_circle.hidden,hdtp_lay_seven_circle.alpha,hdtp_lay_seven_circle.order) ;//添加七级风圈图层
  276. };
  277. /**
  278. * 模拟台风历史路径图层删除
  279. */
  280. this.delHistoryLay = function(){
  281. delLayer(hdtp_lay_point.name);
  282. delLayer(hdtp_lay_line.name);
  283. delLayer(hdtp_lay_twelve_circle.name);
  284. delLayer(hdtp_lay_ten_circle.name);
  285. delLayer(hdtp_lay_seven_circle.name);
  286. };
  287. /*-------------------------------------------绘制台风模拟路径初始化end----------------------------------------------------*/
  288. /**
  289. * 添加历史模拟台风路径
  290. */
  291. this.addHistoryTyphoonPath = function(sid){
  292. _this.delHistoryLay();
  293. _this.historyLayLoad();
  294. var url = $.pathname() + "/ws/cockpit/CockpitService/getHistoryTyphoonPath" ;
  295. var i = 1;
  296. var res = [];
  297. res = _this.getJsonData(url,{sid:sid}) ;
  298. // for(var xy in res){
  299. for(var xy=0; xy<res.length; xy++){
  300. // i++;
  301. (function(){
  302. var j = i;
  303. var nextX,nextY;
  304. if(xy+1<res.length){
  305. nextX = res[xy+1].LONGITUDE;
  306. nextY = res[xy+1].LATITUDE;
  307. }else{
  308. nextX = res[xy].LONGITUDE;
  309. nextY = res[xy].LATITUDE;
  310. };
  311. var objLine = {"points":[{"x":res[xy].LONGITUDE,"y":res[xy].LATITUDE},
  312. {"x":nextX,"y":nextY}]};
  313. // var objLine = {"points":[{"x":res[xy].LONGITUDE,"y":res[xy].LATITUDE},
  314. // {"x":res[xy].nextX,"y":res[xy].nextY},]};
  315. var ls = {"strokeColor":simulationColor[res[xy].MAX_STRENGTH],
  316. "strokeWeight":2,opacity:1,fillColor:[190,0,46,255]};
  317. var pathLine = [{"layerName":hdtp_lay_line.name,"points":objLine,"lineStyle":ls}];
  318. var objMark = {};
  319. if(res[xy].addIcon=="true"){
  320. objMark = {"layerName":hdtp_lay_point.name,"posX":res[xy].LONGITUDE,
  321. "posY":res[xy].LATITUDE,icon:pathIcon+simulationMarker[res[xy].MAX_STRENGTH]+".png",
  322. "title":_this.getSimuPointDes(res[xy]),"clickable":true,
  323. "extraData":{sev:res[xy].SEVEN_RADIUS,ten:res[xy].TEN_RADIUS,tew:res[xy].TWELVE_RADIUS}};
  324. }else{
  325. objMark = {"layerName":hdtp_lay_point.name,"posX":res[xy].LONGITUDE,
  326. "posY":res[xy].LATITUDE,icon:null, "title":_this.getSimuPointDes(res[xy]),
  327. "clickable":true, "extraData":{"sev":res[xy].SEVEN_RADIUS,
  328. "ten":res[xy].TEN_RADIUS,"tew":res[xy].TWELVE_RADIUS}};
  329. }
  330. var param = {"radius":{"sev":res[xy].SEVEN_RADIUS,"ten":res[xy].TEN_RADIUS,"tew":res[xy].TWELVE_RADIUS},
  331. "point":{"posX":res[xy].LONGITUDE,"posY":res[xy].LATITUDE}};
  332. var st = setTimeout(function(){
  333. showPhoonCircle(param,true);
  334. addOneIco(objMark);
  335. addResourcePath(pathLine);
  336. },j*100);
  337. stArr.push(st);
  338. }());
  339. };
  340. };
  341. /**
  342. * 模拟台风点title提示信息生成
  343. * @param param
  344. * @returns {String}
  345. */
  346. this.getSimuPointDes = function(param){
  347. var res = "台风名称:" + $("#TYPHOON_NAME_CH").attr("value") + "\n" ;
  348. if(_this.verifyParams(param.CREATE_TIME)){
  349. res += "北京时间:" + param.CREATE_TIME + "\n";
  350. };
  351. res += "中心位置:" + _this.longLatMatrixing(param.LONGITUDE) + "E " + _this.longLatMatrixing(param.LATITUDE) + "E\n" +
  352. "风力等级:" + _this.getSimuStrength()[param.MAX_STRENGTH] + "\n" ;
  353. if(_this.verifyParams(param.MAX_SPEED)){
  354. res += "最大风速:" + param.MAX_SPEED + "米/秒\n" ;
  355. };
  356. if(_this.verifyParams(param.CENTRAL_PRESSURE)){
  357. res += "中心气压:" + param.CENTRAL_PRESSURE + "百帕\n" ;
  358. };
  359. if(_this.verifyParams(param.MOVEMENT_SPEED)){
  360. res += "移动速度:" + param.MOVEMENT_SPEED + "公里/小时\n" ;
  361. };
  362. res += "\n七级风圈:" + param.SEVEN_RADIUS + "公里\n" ;
  363. if(_this.verifyParams(param.TEN_RADIUS)){
  364. res += "十级风圈:" + param.TEN_RADIUS + "公里\n" ;
  365. };
  366. if(_this.verifyParams(param.TWELVE_RADIUS)){
  367. res += "十二级风圈:" + param.TWELVE_RADIUS + "公里\n" ;
  368. };
  369. return res ;
  370. };
  371. /**
  372. * 参数校验是否为空串,null值或undefined
  373. */
  374. this.verifyParams = function(param){
  375. if(param=="" || param==null || param==undefined || param=="null"){
  376. return false;
  377. }else{
  378. return true;
  379. }
  380. };
  381. /**
  382. * 通过坐标点求直线上的其它点
  383. * @param param: 坐标点:{x1:113,y1:23,x2:110,y2:20}
  384. */
  385. this.getPointStraightLine = function(param){
  386. var x1 = parseInt(param.x1);
  387. var x2 = parseInt(param.x2);
  388. var y1 = parseInt(param.y1);
  389. var y2 = parseInt(param.y2);
  390. if(parseInt(param.x1) > parseInt(param.x2)){
  391. var tem = parseInt(param.x1);
  392. x1 = parseInt(param.x2);
  393. x2 = tem;
  394. tem = parseInt(param.y1);
  395. y1 = parseInt(param.y2);
  396. y2 = tem;
  397. }
  398. var k = (y2-y1)/(x2-x1);
  399. var b = y1 - k*x1;
  400. var res = [];
  401. for(var i = x1; i < x2; i += .3){
  402. var pos = {x:i,y:k*i+b};
  403. res.push(pos);
  404. };
  405. return res;
  406. };
  407. /*-------------------------------------------台风模拟路径Marker点提示生成end----------------------------------------------------*/
  408. /**
  409. * 经纬度转换
  410. * @param pos
  411. * @returns {String}
  412. */
  413. this.longLatMatrixing = function(pos){
  414. var res = parseInt(pos) + "°";
  415. var minute = (pos - parseInt(pos)) * 60;
  416. var second = (minute - parseInt(minute)) * 60 ;
  417. res += parseInt(minute) + "′" + parseInt(second) + "″";
  418. return res;
  419. };
  420. /*-------------------------------------------经纬度转换end----------------------------------------------------*/
  421. /**
  422. * @param 应急资源图层初始化
  423. * @version 1.0
  424. * @Date 2015-09-26
  425. */
  426. this.ersoLay_init = function(){
  427. addEvent("onShapeDrawnCompleted",openDarwCallBack);
  428. addLayer(erso_lay_so.name,erso_lay_so.show,erso_lay_so.hidden,erso_lay_so.alpha,erso_lay_so.order) ;//添加资源图标图层(系统)
  429. addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;//添加自定义图标图层(绘图面板)
  430. addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;//添加自定义图标图层(绘图面板转换后)
  431. addLayer(erso_lay_team.name,erso_lay_team.show,erso_lay_team.hidden,erso_lay_team.alpha,erso_lay_team.order);//队伍定位
  432. addLayer(erso_lay_track.name,erso_lay_track.show,erso_lay_track.hidden,erso_lay_track.alpha,erso_lay_track.order);//队伍描述
  433. addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
  434. /*var pointProv = [] ;//网省级图标坐标组
  435. var pointPref = [] ;//地市级图标坐标组
  436. var point = [] ;
  437. var url = $.pathname() + "/ws/cockpit/CockpitService/queryMareHouse";
  438. erIcons = _this.getJsonData(url,null);
  439. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  440. _this.zoomToCoordList(point) ;
  441. pointPref = pointPref.concat(_this.poinXY(erIcons,"posX","posY")) ;
  442. erIcons = _this.addEwrAttr(erIcons,true,erso_lay_so.name) ;
  443. addResourceIco(erIcons) ;//添加应急资源仓库图标
  444. addEvent('onMarkerClicked',openHouseInfo);*/
  445. // _this.ersoPut();
  446. /*$("#411").click();
  447. $("#411").attr("relValue","0");
  448. getValue("411");
  449. $("#411").attr("relValue","1");*/
  450. };
  451. /**
  452. * 应急装备及队伍展示图层加载
  453. */
  454. this.ersoLay_er_dist_init = function(){
  455. addLayer(erso_team_dist.name,erso_team_dist.show,erso_team_dist.hidden,erso_team_dist.alpha,erso_team_dist.order);//应急队伍分布(网省级总计数)
  456. addLayer(erso_car_dist.name,erso_car_dist.show,erso_car_dist.hidden,erso_car_dist.alpha,erso_car_dist.order);//应急发电车分布
  457. addLayer(erso_dynamo_dist.name,erso_dynamo_dist.show,erso_dynamo_dist.hidden,erso_dynamo_dist.alpha,erso_dynamo_dist.order);//应急发电机分布
  458. addLayer(erso_temp_space_dist.name,erso_temp_space_dist.show,erso_temp_space_dist.hidden,erso_temp_space_dist.alpha,erso_temp_space_dist.order);//临时场所分布
  459. addLayer(erso_team_dist_prev.name,erso_team_dist_prev.show,erso_team_dist_prev.hidden,erso_team_dist_prev.alpha,erso_team_dist_prev.order);//应急队伍分布地市级
  460. addLayer(erso_car_dist_prev.name,erso_car_dist_prev.show,erso_car_dist_prev.hidden,erso_car_dist_prev.alpha,erso_car_dist_prev.order);//应急装备-发电车分布地市级
  461. addLayer(erso_dynamo_dist_prev.name,erso_dynamo_dist_prev.show,erso_dynamo_dist_prev.hidden,erso_dynamo_dist_prev.alpha,erso_dynamo_dist_prev.order);//应急装备-发电机分布地市级
  462. };
  463. /**
  464. * 应急资源 队伍分布图层添加
  465. */
  466. this.er_team_init = function(){
  467. addLayer(erso_team_dist.name,erso_team_dist.show,erso_team_dist.hidden,erso_team_dist.alpha,erso_team_dist.order);//应急队伍分布(网省级总计数)
  468. addLayer(erso_team_dist_prev.name,erso_team_dist_prev.show,erso_team_dist_prev.hidden,erso_team_dist_prev.alpha,erso_team_dist_prev.order);//应急队伍分布地市级
  469. $.post($.pathname()+ "/ws/Team/TeamService/getTeamInfo",{id : userInfo.dept_id},function (data){
  470. data = data.rows;
  471. data = data[data.length-1];
  472. data.dept_name = userInfo.dept_name;
  473. data.dept_id = userInfo.dept_id;
  474. gisMes.window.showTeamMes(data, true) ;
  475. showMes();
  476. },"json" );
  477. };
  478. /**
  479. * 应急资源 发电车分布图层添加
  480. */
  481. this.er_car_init = function(){
  482. addLayer(erso_car_dist.name,erso_car_dist.show,erso_car_dist.hidden,erso_car_dist.alpha,erso_car_dist.order);//应急发电车分布
  483. addLayer(erso_car_dist_prev.name,erso_car_dist_prev.show,erso_car_dist_prev.hidden,erso_car_dist_prev.alpha,erso_car_dist_prev.order);//应急装备-发电车分布地市级
  484. $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : userInfo.dept_id},function (data){
  485. data = data.rows;
  486. data = data[data.length-1];
  487. data.dept_name = userInfo.dept_name;
  488. data.dept_id = userInfo.dept_id;
  489. gisMes.window.showCarMes(data, true) ;
  490. showMes("car_mes");
  491. });
  492. };
  493. /**
  494. * 应急资源 发电机分布图层添加
  495. */
  496. this.er_gen_init = function(){
  497. addLayer(erso_dynamo_dist.name,erso_dynamo_dist.show,erso_dynamo_dist.hidden,erso_dynamo_dist.alpha,erso_dynamo_dist.order);//应急发电机分布
  498. addLayer(erso_dynamo_dist_prev.name,erso_dynamo_dist_prev.show,erso_dynamo_dist_prev.hidden,erso_dynamo_dist_prev.alpha,erso_dynamo_dist_prev.order);//应急装备-发电机分布地市级
  499. $.post($.pathname()+ "/ws/generator/GeneratorService/getGeneratorStatistics",{id : userInfo.dept_id},function (data){
  500. data = data.rows;
  501. data = data[data.length-1];
  502. data.dept_name = userInfo.dept_name;
  503. data.dept_id = userInfo.dept_id;
  504. gisMes.window.showDynMes(data, true) ;
  505. showMes("dyn_mes");
  506. },"json" );
  507. };
  508. /**
  509. * 应急资源 临时场所分布图层
  510. */
  511. this.er_place_init = function(){
  512. addLayer(erso_temp_space_dist.name,erso_temp_space_dist.show,erso_temp_space_dist.hidden,erso_temp_space_dist.alpha,erso_temp_space_dist.order);//临时场所分布
  513. };
  514. /**
  515. * 应急仓库分布图层
  516. */
  517. this.er_house_init = function(){
  518. };
  519. /*-------------------------------------------应急资源图层初始化end----------------------------------------------------*/
  520. /**
  521. * 加载应急资源 应急队伍分布图层
  522. */
  523. this.searchErTeam = function(unitId,searchType){
  524. var point = [];
  525. var params = {deptId:unitId, searchType:searchType};
  526. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
  527. var data = _this.addResoMarker(url, params, erso_team_dist.name) ;
  528. if(data){
  529. point = point.concat(data);
  530. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeamPrev" ;
  531. data = _this.addResoMarker(url, params, erso_team_dist_prev.name) ;
  532. };
  533. addEvent('onMarkerClicked',openEarlywarningnotice);
  534. if(point.length>4)
  535. _this.zoomToCoordList(point) ;
  536. };
  537. /**
  538. * 加载应急资源 发电车分布图层
  539. */
  540. this.searchErCar = function(unitId,searchType){
  541. var point = [];
  542. var params = {deptId:unitId, searchType:searchType};
  543. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
  544. var data = _this.addResoMarker(url, params, erso_car_dist.name) ;
  545. if(data){
  546. point = point.concat(data);
  547. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiCarPrev" ;
  548. _this.addResoMarker(url, params, erso_car_dist_prev.name) ;
  549. }else{
  550. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  551. ai.createAlert();
  552. };
  553. addEvent('onMarkerClicked',openEarlywarningnotice);
  554. if(point.length>4)
  555. _this.zoomToCoordList(point) ;
  556. };
  557. /**
  558. * 加载应急资源 发电机分布图层
  559. */
  560. this.searchErGen = function(unitId,searchType){
  561. var point = [];
  562. var params = {deptId:unitId, searchType:searchType};
  563. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen" ;
  564. var data = _this.addResoMarker(url, params, erso_dynamo_dist.name) ;
  565. if(data){
  566. point = point.concat(data);
  567. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiPrev" ;
  568. _this.addResoMarker(url, params, erso_dynamo_dist_prev.name) ;
  569. }else{
  570. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  571. ai.createAlert();
  572. };
  573. addEvent('onMarkerClicked',openEarlywarningnotice);
  574. if(point.length>4)
  575. _this.zoomToCoordList(point) ;
  576. };
  577. /**
  578. * 加载应急资源 临时场所分布图层
  579. */
  580. this.searchErPlace = function(unitId,placeType,searchType){
  581. var point = [];
  582. var params = {deptId:unitId, searchType:searchType, place_type:placeType};
  583. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTempSpace" ;
  584. data = _this.addResoMarker(url, params, erso_temp_space_dist.name) ;
  585. if(data){
  586. point = point.concat(data);
  587. }else{
  588. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  589. ai.createAlert();
  590. };
  591. addEvent('onMarkerClicked',openEarlywarningnotice);
  592. if(point.length>4)
  593. _this.zoomToCoordList(point) ;
  594. };
  595. /**
  596. * 加载应急资源仓库信息图层
  597. */
  598. this.searchErHouse = function(params){
  599. // var erso_lay_so = {name:"ersoLayLabel",show:7,hidden:17,alpha:1,order:1} ;
  600. var point = [];
  601. var url = $.pathname() + "/ws/cockpit/CockpitService/queryMareHouse";
  602. var erIcons = _this.getJsonData(url,params);
  603. if(erIcons){
  604. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  605. erIcons = _this.addEwrAttr(erIcons,true,erso_lay_so.name) ;
  606. _this.zoomToCoordList(point) ;
  607. addResourceIco(erIcons) ;//添加应急资源仓库图标
  608. }else{
  609. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  610. ai.createAlert();
  611. };
  612. // addEvent('onMarkerClicked',openEarlywarningnotice);
  613. addEvent('onMarkerClicked',openHouseInfo);
  614. };
  615. /**
  616. * 加载应急资源分布图标
  617. */
  618. this.searchErDist = function(type,unitId,placeType, searchType){
  619. var point = [] ;
  620. // var params = {deptId:unitId} ;
  621. var params = {deptId:unitId, searchType:searchType};
  622. var url = "" ;
  623. var layName = "" ;
  624. var data = [] ;
  625. var typeArr = type.split(",");
  626. /*var encondeCondition=window.location.search;
  627. var src = "";*/
  628. //261 代表查询队伍 262发电车 381临时场所
  629. for(var key in typeArr){
  630. if(typeArr[key]=="261"){
  631. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
  632. layName = erso_team_dist.name ;
  633. data = _this.addResoMarker(url, params, layName) ;
  634. if(data){
  635. point = point.concat(data);
  636. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeamPrev" ;
  637. layName = erso_team_dist_prev.name ;
  638. _this.addResoMarker(url, params, layName) ;
  639. /*src = "/nwyj/page/cockpit/echart_maticView/amResource/DuiWuHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=DuiWuHuiZongZt";
  640. _this.addChartWin(src,"100","330",null,null,"DuiWuHuiZongZt");
  641. src = "/nwyj/page/cockpit/echart_maticView/amResource/DuiWuRenYuanHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=DuiWuRenYuanHuiZongZt";
  642. _this.addChartWin(src,null,"330",null,"50","DuiWuRenYuanHuiZongZt");*/
  643. };
  644. };
  645. if(typeArr[key]=="262"){
  646. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
  647. layName = erso_car_dist.name ;
  648. data = _this.addResoMarker(url, params, layName) ;
  649. if(data){
  650. point = point.concat(data);
  651. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiPrev" ;
  652. layName = erso_dynamo_dist_prev.name ;
  653. _this.addResoMarker(url, params, layName) ;
  654. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiCarPrev" ;
  655. layName = erso_car_dist_prev.name ;
  656. _this.addResoMarker(url, params, layName) ;
  657. /*src = "/nwyj/page/cockpit/echart_maticView/amResource/FaDianJiHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=FaDianJiHuiZongZt";
  658. _this.addChartWin(src,"100",null,"25",null,"FaDianJiHuiZongZt");
  659. src = "/nwyj/page/cockpit/echart_maticView/amResource/FaDianCheHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=FaDianCheHuiZongZt";
  660. _this.addChartWin(src,null,null,"25","50","FaDianCheHuiZongZt");*/
  661. };
  662. };
  663. if(typeArr[key]=="381"){
  664. params.place_type = placeType;
  665. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTempSpace" ;
  666. layName = erso_temp_space_dist.name ;
  667. data = _this.addResoMarker(url, params, layName) ;
  668. if(data){ point = point.concat(data); };
  669. };
  670. };
  671. if(point.length > 2){
  672. _this.zoomToCoordList(point) ;
  673. } else if(point.length == 0) {
  674. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  675. ai.createAlert();
  676. };
  677. addEvent('onMarkerClicked',openEarlywarningnotice);
  678. };
  679. /**
  680. * 添加应急资源统计图(没有用到)
  681. */
  682. this.addChartWin = function(src,top,left,right,bottom,id){
  683. var $team_iframe = document.createElement("iframe");
  684. var w = $(document).width();
  685. w = (Number(w)-500)/2;
  686. var h = $(document).height();
  687. h = (Number(h)-150)/2;
  688. $team_iframe.src = src;
  689. $team_iframe.style.width = w + "px";
  690. $team_iframe.style.height = h + "px";
  691. $team_iframe.style.position = "fixed";
  692. if(top){ $team_iframe.style.top = top + "px"; };
  693. if(left){ $team_iframe.style.left = left + "px"; };
  694. if(right){ $team_iframe.style.right = right + "px"; };
  695. if(bottom){ $team_iframe.style.bottom = bottom + "px"; };
  696. $team_iframe.style.background ="red";
  697. $team_iframe.style.zIndex = 99;
  698. $team_iframe.id = id;
  699. $team_iframe.scrolling = "no";
  700. $team_iframe.style.border="none";
  701. $team_iframe.frameBorder = 0;
  702. $("body").append($team_iframe);
  703. };
  704. /**
  705. * 删除应急资源统计图
  706. */
  707. this.delChartWin = function(idArr){
  708. for(var key in idArr){
  709. $("#" + idArr[key]).remove();
  710. };
  711. };
  712. /**
  713. * 应急资源图标添加
  714. */
  715. this.addResoMarker = function(url, params, layName){
  716. var point = [] ;
  717. erIcons = _this.getJsonData(url,params);
  718. if(erIcons){
  719. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  720. erIcons = _this.addEwrAttr(erIcons,true,layName) ;
  721. addResourceIco(erIcons) ;//添加应急资源分布图标
  722. return point ;
  723. }else{
  724. return null;
  725. };
  726. };
  727. /**
  728. * 加载应急资源分布图标
  729. *//*
  730. this.searchErDist = function(type,unitId){
  731. var point = [] ;
  732. var params = {deptId:unitId} ;
  733. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
  734. var layName = erso_team_dist.name ;
  735. if(type==265){
  736. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
  737. layName = erso_car_dist.name ;
  738. }else if(type==266){
  739. url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen" ;
  740. layName = erso_dynamo_dist.name ;
  741. };
  742. erIcons = _this.getJsonData(url,params);
  743. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  744. erIcons = _this.addEwrAttr(erIcons,true,layName) ;
  745. addResourceIco(erIcons) ;//添加应急资源分布图标
  746. 添加应急资源队伍
  747. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam";
  748. erIcons = _this.getJsonData(url,null);
  749. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  750. erIcons = _this.addEwrAttr(erIcons,true,erso_team_dist.name) ;
  751. addResourceIco(erIcons) ;//添加应急队伍分布图标
  752. 添加应急资源发电车
  753. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar";
  754. erIcons = _this.getJsonData(url,null);
  755. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  756. erIcons = _this.addEwrAttr(erIcons,true,erso_car_dist.name) ;
  757. addResourceIco(erIcons) ;//添加应急资源发电车分布图标
  758. 添加应急资源发电机
  759. var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen";
  760. erIcons = _this.getJsonData(url,null);
  761. point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
  762. erIcons = _this.addEwrAttr(erIcons,true,erso_team_dist.name) ;
  763. addResourceIco(erIcons) ;//添加应急资源发电机分布图标
  764. _this.zoomToCoordList(point) ;
  765. };*/
  766. /*-------------------------------------------加载应急资源分布图标end----------------------------------------------------*/
  767. /**
  768. * 加载应急资源投入
  769. */
  770. this.ersoPut = function(paramsProv, paramsPref){
  771. var pointProv = [] ;//网省级图标坐标组
  772. var pointPref = [] ;//地市级图标坐标组
  773. var url ;
  774. if(paramsProv){
  775. url = $.pathname() + "/ws/cockpit/CockpitService/queryErMarker" ;//网省级应急资源标注查询
  776. erFlagProv = _this.getJsonData(url,paramsProv) ;
  777. }else{
  778. erFlagProv = {};
  779. }
  780. if(paramsPref){
  781. url = $.pathname() + "/ws/cockpit/CockpitService/queryErMarker" ;//地市级应急资源标注查询
  782. erFlagPref = _this.getJsonData(url,paramsPref) ;
  783. }else{
  784. erFlagPref = {};
  785. }
  786. if(erFlagPref){
  787. var posXArr = [] ;
  788. var posYArr = [] ;
  789. for(var key in erFlagPref){
  790. posXArr.push(erFlagPref[key]["x"]) ;
  791. posYArr.push(erFlagPref[key]["y"]) ;
  792. }
  793. var radiu = _this.zoomToExtent(posXArr,posYArr) ;
  794. var rad = _this.getErRadius(radiu) ;
  795. _this.drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;
  796. pointPref = pointPref.concat(_this.poinXY(erFlagPref,"x","y")) ;
  797. }
  798. if(erFlagProv){
  799. var posXArr = [] ;
  800. var posYArr = [] ;
  801. for(var key in erFlagProv){
  802. posXArr.push(erFlagProv[key]["x"]) ;
  803. posYArr.push(erFlagProv[key]["y"]) ;
  804. }
  805. var radiu = _this.zoomToExtent(posXArr,posYArr) ;
  806. var rad = _this.getErRadius(radiu) ;
  807. _this.drawResource(erFlagProv,0,rad["ra"],rad["ds"]) ;
  808. pointProv = pointProv.concat(_this.poinXY(erFlagProv,"x","y")) ;
  809. mz_er = pointProv ;
  810. // zoomToCoordList(pointProv) ;
  811. setZoomAndCenter(pointProv[0],pointProv[1],6);
  812. } else {
  813. _this.zoomToCoordList(pointPref) ;
  814. mz_er = pointPref ;
  815. } ;
  816. addEvent("onMapExtentChanged",mapChanged);
  817. };
  818. /*-------------------------------------------加载应急资源投入end----------------------------------------------------*/
  819. /**
  820. * 绘图工具栏初始化
  821. */
  822. this.erso_draw = function(){
  823. };
  824. /*-------------------------------------------绘图工具栏初始化end----------------------------------------------------*/
  825. /**
  826. * 应急预警与响应初始化
  827. */
  828. this.ewerLay_init = function(){
  829. // var date = allGetServerTime() ;
  830. // var beginTime = _this.getThreeMonthsAgo(_this.getNowFormatDate(date)) ;
  831. // var endTime = _this.getNowFormatDate(allGetServerTime()) ;
  832. var paramsProv = {
  833. // RELEASE_UNIT : subDept["prov"]+"",//单位
  834. USER_NAME : userInfo.real_name,
  835. USER_ID : userInfo.user_id,
  836. RELEASE_UNIT : _this.resolveUrl().dept_id,//单位
  837. WULEVEL : "'0','1'",
  838. RULEVEL : "'0','1'",
  839. SKEW : "0.3",
  840. // BEGINTIME : beginTime ,//开始时间
  841. // ENDTIME : endTime //截止时间
  842. } ;
  843. var paramsPref = {
  844. // RELEASE_UNIT : subDept["prov"]+"",//单位
  845. USER_NAME : userInfo.real_name,
  846. USER_ID : userInfo.user_id,
  847. RELEASE_UNIT : _this.resolveUrl().dept_id,
  848. WULEVEL : "'2','3','4'",
  849. RULEVEL : "'2','3','4'",
  850. SKEW : "0.03",
  851. // BEGINTIME : beginTime ,//开始时间
  852. // ENDTIME : endTime //截止时间
  853. } ;
  854. /*var paramsPrefEw = {
  855. //RELEASE_UNIT : subDept["pref"]+"",//单位
  856. USER_NAME : userInfo.real_name,
  857. USER_ID : userInfo.user_id,
  858. RELEASE_UNIT : _this.resolveUrl().dept_id,
  859. LEVEL : "35,36,37,38",//级别
  860. BEGINTIME : beginTime ,//开始时间
  861. ENDTIME : endTime //截止时间
  862. } ;
  863. var paramsPrefEr = {
  864. // RELEASE_UNIT : subDept["pref"]+"",//单位
  865. USER_NAME : userInfo.real_name,
  866. USER_ID : userInfo.user_id,
  867. RELEASE_UNIT : _this.resolveUrl().dept_id,
  868. LEVEL : "29,30,31,32",//级别
  869. BEGINTIME : beginTime ,//开始时间
  870. ENDTIME : endTime //截止时间
  871. } ;*/
  872. mz_ewer = _this.ewer_load(paramsProv,paramsPref);
  873. };
  874. /*--------------------------------应急预警与响应初始化end-------------------------------------------------*/
  875. /**
  876. * 加载应急预警与响应图层
  877. * @param
  878. * @version 1.0
  879. * @Date 2015-09-26
  880. */
  881. this.ewer_load_old = function(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr){
  882. gisLengen = [];
  883. //新建应急预警与响应图层
  884. addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
  885. addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
  886. var pointPre = [] ;
  887. var pointPro = [] ;
  888. var ewJsonData = {} ;
  889. var mp = [] ;
  890. var url ;
  891. if(paramsPrefEw){
  892. //查询应急预警图标(地市级)
  893. paramsPrefEw.skew = 0;
  894. url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
  895. ewJsonData = _this.getJsonData(url,paramsPrefEw) ;
  896. pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  897. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  898. _this.addGisLengen(ewJsonData);
  899. addResourceIco(ewJsonData);//添加图标
  900. }
  901. if(paramsPrefEr){
  902. //应急响应查询(地市级)
  903. paramsPrefEr.skew = 0.03;
  904. url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
  905. ewJsonData = _this.getJsonData(url,paramsPrefEr) ;
  906. pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  907. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  908. _this.addGisLengen(ewJsonData);
  909. addResourceIco(ewJsonData);//添加图标
  910. }
  911. if(paramsProvEw){
  912. //查询应急预警图标(网省级)
  913. paramsProvEw.skew = 0.5;
  914. var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
  915. ewJsonData = _this.getJsonData(url,paramsProvEw) ;
  916. pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  917. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
  918. _this.addGisLengen(ewJsonData);
  919. addResourceIco(ewJsonData);//添加图标
  920. };
  921. if(paramsProvEr){
  922. //应急响应查询(网省级)
  923. paramsProvEr.skew = 1;
  924. url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
  925. ewJsonData = _this.getJsonData(url,paramsProvEr) ;
  926. pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  927. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
  928. _this.addGisLengen(ewJsonData);
  929. addResourceIco(ewJsonData);//添加图标
  930. };
  931. if(pointPro.length != 0){
  932. if(pointPro.length > 4){
  933. mp = pointPro;
  934. _this.zoomToCoordList(pointPro);
  935. }else{
  936. setZoomLevel(6);
  937. }
  938. } else if(pointPre.length != 0){
  939. mp = pointPre;
  940. _this.zoomToCoordList(pointPre) ;
  941. } else if(pointPre.length==0 && pointPro.length ==0){
  942. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  943. ai.createAlert();
  944. };
  945. addEvent('onMarkerClicked',openEarlywarningnotice);
  946. return mp ;
  947. };
  948. /**
  949. * 加载应急预警与响应图层
  950. * @param
  951. * @version 1.0
  952. * @Date 2015-09-26
  953. */
  954. this.ewer_load_old_old = function(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr){
  955. gisLengen = [];
  956. //新建应急预警与响应图层
  957. addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
  958. addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
  959. var pointPre = [] ;
  960. var pointPro = [] ;
  961. var ewJsonData = {} ;
  962. var mp = [] ;
  963. var url ;
  964. if(paramsPrefEw){
  965. //查询应急预警图标(地市级)
  966. paramsPrefEw.skew = 0.03;
  967. url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
  968. ewJsonData = _this.getJsonData(url,paramsPrefEw) ;
  969. pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  970. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  971. _this.addGisLengen(ewJsonData);
  972. addResourceIco(ewJsonData);//添加图标
  973. }
  974. if(paramsPrefEr){
  975. //应急响应查询(地市级)
  976. paramsPrefEr.skew = 0.03;
  977. url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
  978. ewJsonData = _this.getJsonData(url,paramsPrefEr) ;
  979. pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  980. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  981. _this.addGisLengen(ewJsonData);
  982. addResourceIco(ewJsonData);//添加图标
  983. }
  984. if(pointPro.length != 0){
  985. if(pointPro.length > 4){
  986. mp = pointPro;
  987. _this.zoomToCoordList(pointPro);
  988. }else{
  989. setZoomLevel(6);
  990. }
  991. } else if(pointPre.length != 0){
  992. mp = pointPre;
  993. _this.zoomToCoordList(pointPre) ;
  994. } else if(pointPre.length==0 && pointPro.length ==0){
  995. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  996. ai.createAlert();
  997. };
  998. addEvent('onMarkerClicked',openEarlywarningnotice);
  999. return mp ;
  1000. };
  1001. /**
  1002. * 加载应急预警与响应图层
  1003. * @param
  1004. * @version 1.0
  1005. * @Date 2015-09-26
  1006. */
  1007. this.ewer_load = function(paramsProv,paramsPref){
  1008. gisLengen = [];
  1009. //新建应急预警与响应图层
  1010. addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
  1011. addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
  1012. var pointPre = [] ;
  1013. var pointPro = [] ;
  1014. var ewJsonData = {} ;
  1015. var mp = [] ;
  1016. var url ;
  1017. if(paramsProv){
  1018. //查询应急预警图标(网省级)
  1019. url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
  1020. ewJsonData = _this.getJsonData(url,paramsProv) ;
  1021. pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  1022. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
  1023. _this.addGisLengen(ewJsonData);
  1024. addResourceIco(ewJsonData);//添加图标
  1025. }
  1026. if(paramsPref){
  1027. //查询应急预警图标(地市级)
  1028. url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
  1029. ewJsonData = _this.getJsonData(url,paramsPref) ;
  1030. pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  1031. ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  1032. _this.addGisLengen(ewJsonData);
  1033. addResourceIco(ewJsonData);//添加图标
  1034. }
  1035. if(pointPro.length != 0){
  1036. if(pointPro.length > 4){
  1037. mp = pointPro;
  1038. _this.zoomToCoordList(pointPro);
  1039. }else{
  1040. setZoomLevel(6);
  1041. }
  1042. } else if(pointPre.length != 0){
  1043. mp = pointPre;
  1044. _this.zoomToCoordList(pointPre) ;
  1045. } else if(pointPre.length==0 && pointPro.length ==0){
  1046. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  1047. ai.createAlert();
  1048. };
  1049. addEvent('onMarkerClicked',openEarlywarningnotice);
  1050. return mp ;
  1051. };
  1052. /*--------------------------------应急预警与响应加载end-------------------------------------------------*/
  1053. this.addGisLengen = function(pd){
  1054. for(var key in pd){
  1055. var lengen = {name:pd[key].extraData.name,describe:pd[key].extraData.ICON_DESCRIBE};
  1056. gisLengen.push(lengen);
  1057. };
  1058. };
  1059. /**
  1060. * 应急预警与响应查询事件响应预警同时查出来
  1061. */
  1062. this.searchEwer_old = function(paramsEw,paramsEr,changeGridEw,changeGridEr){
  1063. _this.closeEwerLayer();
  1064. var pointPre = [] ;
  1065. //应急预警查询
  1066. var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
  1067. paramsEw.skew = 0;
  1068. pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEw,true,ewer_lay_pref.name)) ;
  1069. //应急响应查询(地市级)
  1070. url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
  1071. paramsEr.skew = 0.03;
  1072. pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEr,true,ewer_lay_pref.name)) ;
  1073. if(pointPre.length != 0){
  1074. _this.zoomToCoordList(pointPre) ;
  1075. } else {
  1076. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  1077. ai.createAlert();
  1078. }
  1079. addEvent('onMarkerClicked',openEarlywarningnotice);
  1080. if($("#ewerlenge").hasClass("tl_show")){
  1081. openLegend("#ewerlenge",_this.getGisLengen());
  1082. };
  1083. page_0.window.searchEw(changeGridEw) ;
  1084. page_1.window.searchEr(changeGridEr) ;
  1085. } ;
  1086. this.searchEwer = function(params,changeGridEw,changeGridEr){
  1087. _this.closeEwerLayer();
  1088. var pointPro = [] ;
  1089. var pointPre = [] ;
  1090. var mp = [] ;
  1091. var ewJsonData ;
  1092. //应急预警查询 (网省级)
  1093. // var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
  1094. var url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
  1095. params.SKEW = "0.3";
  1096. params.WULEVEL = "'0','1'";
  1097. params.RULEVEL = "'0','1'";
  1098. // ewJsonData = _this.getJsonData(url,params) ;
  1099. // pointPro = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  1100. // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
  1101. // _this.addGisLengen(ewJsonData);
  1102. // addResourceIco(ewJsonData);//添加图标
  1103. pointPro = pointPro.concat(_this.searchMarkerToEwer(url,params,true,ewer_lay_prov.name));
  1104. params.SKEW = "0.03";
  1105. params.WULEVEL = "'2','3','4'";
  1106. params.RULEVEL = "'2','3','4'";
  1107. pointPre = pointPre.concat(_this.searchMarkerToEwer(url,params,true,ewer_lay_pref.name)) ;
  1108. // ewJsonData = _this.getJsonData(url,params) ;
  1109. // pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
  1110. // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
  1111. // _this.addGisLengen(ewJsonData);
  1112. // addResourceIco(ewJsonData);//添加图标
  1113. //应急响应查询(地市级)
  1114. /*url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
  1115. paramsEr.skew = 0.03;
  1116. pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEr,true,ewer_lay_pref.name)) ;*/
  1117. if(pointPro.length != 0){
  1118. if(pointPro.length > 4){
  1119. mp = pointPro;
  1120. _this.zoomToCoordList(pointPro);
  1121. }else{
  1122. setZoomLevel(6);
  1123. }
  1124. } else if(pointPre.length != 0){
  1125. mp = pointPre;
  1126. _this.zoomToCoordList(pointPre) ;
  1127. } else if(pointPre.length==0 && pointPro.length ==0){
  1128. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  1129. ai.createAlert();
  1130. };
  1131. addEvent('onMarkerClicked',openEarlywarningnotice);
  1132. if($("#ewerlenge").hasClass("tl_show")){
  1133. openLegend("#ewerlenge",_this.getGisLengen());
  1134. };
  1135. page_0.window.searchEw(changeGridEw) ;
  1136. page_1.window.searchEr(changeGridEr) ;
  1137. return mp ;
  1138. } ;
  1139. /*--------------------------------应急预警与响应查询事件end-------------------------------------------------*/
  1140. /**
  1141. * @param 关闭显示应急预警与响应图层
  1142. * @version 1.0
  1143. * @Date 2015-09-26
  1144. */
  1145. this.closeEwerLayer = function(){
  1146. delLayer(ewer_lay_prov.name);
  1147. delLayer(ewer_lay_pref.name);
  1148. removeEvent("onMarkerClicked") ;
  1149. gisLengen = [];
  1150. };
  1151. /**
  1152. * 关闭台风模拟绘制图层
  1153. */
  1154. this.closeDrawTyphoonPath = function(){
  1155. delLayer(dtp_lay_point.name);
  1156. delLayer(dtp_lay_line.name);
  1157. delLayer(dtp_lay_seven_circle.name);
  1158. delLayer(dtp_lay_ten_circle.name);
  1159. delLayer(dtp_lay_twelve_circle.name);
  1160. };
  1161. /*--------------------------------取消显示应急预警与响应图层end-------------------------------------------------*/
  1162. /**
  1163. * @param 取消显示应急资源图层
  1164. * @version 1.0
  1165. * @Date 2015-09-26
  1166. */
  1167. this.closeErsource = function(){
  1168. // $("#erToolWin").hide();
  1169. _this.closeErMarker();
  1170. _this.closeErDist();
  1171. delLayer(erso_lay_so.name) ;
  1172. delLayer(erso_lay_show.name) ;
  1173. delLayer(erso_lay_team.name) ;
  1174. delLayer(erso_lay_track.name) ;
  1175. delLayer(erso_team_playback.name) ;
  1176. // delLayer(lay6) ;
  1177. addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
  1178. delShapes(erso_lay_draw.name) ;
  1179. removeEvent("onShapeDrawnCompleted") ;
  1180. removeEvent("onMarkerClicked") ;
  1181. removeEvent("onMapExtentChanged") ;
  1182. removeEvent("onGetPointEvent") ;
  1183. };
  1184. /*----------------------------------------------------------关闭应急资源图层------------------------------------------*/
  1185. /**
  1186. * 取消应急资源分布图层
  1187. */
  1188. this.closeErDist = function(){
  1189. delLayer(erso_team_dist.name) ;
  1190. delLayer(erso_car_dist.name) ;
  1191. delLayer(erso_dynamo_dist.name) ;
  1192. delLayer(erso_temp_space_dist.name) ;
  1193. delLayer(erso_team_dist_prev.name) ;
  1194. delLayer(erso_car_dist_prev.name) ;
  1195. delLayer(erso_dynamo_dist_prev.name) ;
  1196. };
  1197. /**
  1198. * 取消应急资源队伍分布图层
  1199. */
  1200. this.closeErTeam = function(){
  1201. delLayer(erso_team_dist.name) ;
  1202. delLayer(erso_team_dist_prev.name) ;
  1203. gisMes.window.hiddenMes("team_mes") ;
  1204. hiddenMes();
  1205. };
  1206. /**
  1207. * 取消应急资源发电车分布图层
  1208. */
  1209. this.closeErCar = function(){
  1210. delLayer(erso_car_dist.name) ;
  1211. delLayer(erso_car_dist_prev.name) ;
  1212. gisMes.window.hiddenMes("car_mes") ;
  1213. hiddenMes();
  1214. };
  1215. /**
  1216. * 取消应急资源发电机分布图层
  1217. */
  1218. this.closeErGen = function(){
  1219. delLayer(erso_dynamo_dist.name) ;
  1220. delLayer(erso_dynamo_dist_prev.name) ;
  1221. gisMes.window.hiddenMes("dyn_mes") ;
  1222. hiddenMes();
  1223. };
  1224. /**
  1225. * 取消应急资源临时场所分布图层
  1226. */
  1227. this.closeErPlace = function(){
  1228. delLayer(erso_temp_space_dist.name) ;
  1229. };
  1230. /**
  1231. *关闭应急资源资源标注图层
  1232. */
  1233. this.closeErMarker = function(){
  1234. delLayer("pref1") ;
  1235. delLayer("pref2") ;
  1236. delLayer("pref3") ;
  1237. delLayer("prov1") ;
  1238. delLayer("prov2") ;
  1239. delLayer("prov3") ;
  1240. };
  1241. /**
  1242. * 关闭应急队伍图层
  1243. */
  1244. this.closeTeam = function(){
  1245. delLayer(erso_lay_team.name);
  1246. delLayer(erso_lay_track.name);
  1247. delLayer(erso_team_playback.name);
  1248. };
  1249. /**
  1250. * 应急资源标各级显示半径
  1251. * @param zoomLevel
  1252. * @returns
  1253. */
  1254. this.getErRadius = function(zoomLevel){
  1255. var zl = Math.floor(zoomLevel) ;
  1256. var raiusDs = {5 :{ra:90000,ds:170}, 6 :{ra:40000,ds:80}, 7 :{ra:30000,ds:60},
  1257. 8 :{ra:12000,ds:25} , 9 :{ra:6000,ds:11} , 10:{ra:3000,ds:6} ,
  1258. 11:{ra:1500 ,ds:2.7}, 12:{ra:1000,ds:1.7}, 13:{ra:500,ds:0.9} ,
  1259. 14:{ra:300 ,ds:0.5}, 15:{ra:200 ,ds:0.3}, 16:{ra:90,ds:0.15} ,
  1260. 17:{ra:60 ,ds:0.1}} ;
  1261. return raiusDs[zl] ;
  1262. };
  1263. /*--------------------------------------------应急资源标各级显示半径end-------------------------------------------------*/
  1264. /**
  1265. * 应急资源的圆形标注 因为是用添加圆形方法画的标注,所以此标注会随着地图的放大缩小而改变,所以设置了它的显示级别为13到15
  1266. * @param erFlag: 一组资源标注信息json格式,x、y坐标以及三个标注的数量信息,顺序分别是:本地、外地和缺口
  1267. * @param level: 网省地县标识,0为网省级 1为地市级
  1268. * @param crad: 圆形半径
  1269. * @param bs: 圆与圆的差距
  1270. */
  1271. this.drawResource = function(erFlag,level,crad,bs){
  1272. var c1,c2,c3 = "";
  1273. if(level==0){//网省级
  1274. c1 = "prov1" ;
  1275. c2 = "prov2" ;
  1276. c3 = "prov3" ;
  1277. addLayer(c1,4,8,1,1);
  1278. addLayer(c2,4,8,1,1);
  1279. addLayer(c3,4,8,1,1);
  1280. } else { //地市级
  1281. c1 = "pref1" ;
  1282. c2 = "pref2" ;
  1283. c3 = "pref3" ;
  1284. addLayer(c1,7,14,1,1);
  1285. addLayer(c2,7,14,1,1);
  1286. addLayer(c3,7,14,1,1);
  1287. }
  1288. var circelStyleNative = _this.circelStyle([128,128,128,0],1,1,[93,152,226,255]) ;
  1289. var circelStyleOther = _this.circelStyle([128,128,128,0],1,1,[129,158,67,255]) ;
  1290. var circelStyleInsufficiency = _this.circelStyle([128,128,128,0],1,1,[255,5,5,255]);
  1291. var extraData = {} ;
  1292. for(var key in erFlag){
  1293. var ex = erFlag[key].x;
  1294. var ey = erFlag[key].y;
  1295. var rad = crad ;
  1296. //本地投入资源标注圆
  1297. var objc1 = {points:{x:ex,y:ey},radius:rad};
  1298. extraData = {"unit":erFlag[key]["unit"],"startDate":erFlag[key]["startDate"],"endDate":erFlag[key]["endDate"],"type":erFlag[key]["type"],"level":"Native"} ;
  1299. addCircle(c1,objc1,circelStyleNative,"extraData");
  1300. ex -= 0.0008 * bs ;
  1301. ey += 0.001 * bs ;
  1302. var objt1 = {points:{ x:ex,y:ey}};
  1303. var textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].native,fontSize:15,fillColor:[0,0,0,255]};
  1304. addText(c1,objt1,textStyle1,"备注");
  1305. //外地投入资源标注圆
  1306. ey += 0.0007 * bs ;
  1307. ex += 0.001 * bs ;
  1308. rad += 200 * bs ;
  1309. var objc2 = {points:{x:ex,y:ey},radius:rad};
  1310. extraData = {"unit":erFlag[key]["unit"],"startDate":erFlag[key]["startDate"],"endDate":erFlag[key]["endDate"],"type":erFlag[key]["type"],"level":"Other"} ;
  1311. addCircle(c2,objc2,circelStyleOther,extraData);
  1312. ey += 0.006 * bs ;
  1313. ex -= 0.001 * bs ;
  1314. var objt2 = {points:{x:ex,y:ey}};
  1315. textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].other,fontSize:15,fillColor:[0,0,0,255]};
  1316. addText(c2,objt2,textStyle1,"备注");
  1317. //缺口资源标注圆
  1318. ey -= 0.0044 * bs ;
  1319. ex += 0.001 * bs ;
  1320. rad += 200 * bs ;
  1321. var objc3 = {points:{x:ex,y:ey},radius:rad};
  1322. addCircle(c3,objc3,circelStyleInsufficiency);
  1323. ey += 0.008 * bs ;
  1324. ex -= 0.001 * bs ;
  1325. var objt3 = {points:{x:ex,y:ey}};
  1326. textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].insufficiency,fontSize:15,fillColor:[0,0,0,255]};
  1327. addText(c3,objt3,textStyle1,"备注");
  1328. };
  1329. };
  1330. /*--------------------------------------------应急资源标注三个圈添加end-------------------------------------------------*/
  1331. /**
  1332. * 通过参数返回要添加的圆形的style
  1333. * @param sColor:边的颜色 如:[255,255,255,0]
  1334. * @param sWeight:线条宽度或者多边形边线宽度 number
  1335. * @param op:填充透明度0-1
  1336. * @param fColor:填充颜色 如:[255, 165, 0, 255]
  1337. * @returns {___anonymous7663_7736}
  1338. */
  1339. this.circelStyle = function(sColor,sWeight,op,fColor){
  1340. var circelStyle = {"strokeColor": sColor,"strokeWeight":sWeight,opacity:op,fillColor:fColor};
  1341. return circelStyle ;
  1342. };
  1343. /*--------------------------------------------通过参数返回要添加的圆形的style end-------------------------------------------------*/
  1344. /**
  1345. * 历史轨迹回放
  1346. * @param params
  1347. */
  1348. this.roadHistoryOld = function(params){
  1349. var url = $.pathname() + "/ws/cockpit/CockpitService/queryTameLine" ;
  1350. var res = _this.getJsonData(url,params) ;
  1351. if(!res){
  1352. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
  1353. ai.createAlert();
  1354. return;
  1355. }
  1356. delLayer(erso_lay_track.name);
  1357. delLayer(erso_lay_team.name);
  1358. delLayer(erso_team_playback.name);
  1359. addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
  1360. url = $.pathname() + "/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
  1361. $(resStart).attr("sort","ASC") ;
  1362. var resStart = _this.getJsonData(url,params);
  1363. for(var key in res){
  1364. var markerId = _this.addAdsIcon(res[key]["points"][0]["x"],res[key]["points"][0]["y"],res[key]["teamId"],resStart,erso_team_playback.name) ;//添加图标
  1365. _this.tracingHistory(res[key],markerId, pathIcon + "ads_start.png",pathIcon + "team_prev.png",erso_team_playback.name,lineStyleTrack) ;
  1366. };
  1367. } ;
  1368. /**
  1369. * 历史轨迹回放
  1370. * @param params
  1371. */
  1372. this.roadHistory = function(params){
  1373. var url = $.pathname() + "/ws/cockpit/CockpitService/queryTameLineById" ;
  1374. var res = _this.getJsonData(url,params) ;
  1375. if(!res){
  1376. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
  1377. ai.createAlert();
  1378. return;
  1379. }
  1380. delLayer(erso_lay_track.name);
  1381. delLayer(erso_lay_team.name);
  1382. delLayer(erso_team_playback.name);
  1383. addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
  1384. url = $.pathname() + "/ws/cockpit/CockpitService/fixedPosition" ;
  1385. $(resStart).attr("sort","ASC") ;
  1386. var resStart = _this.getJsonData(url,params);
  1387. for(var key = 0; key < res.length; key++){
  1388. var markerId = _this.addAdsIcon(res[key]["points"][0]["x"],res[key]["points"][0]["y"],res[key]["teamId"],resStart,erso_team_playback.name) ;//添加图标
  1389. _this.tracingHistory(res[key],markerId, pathIcon + "ads_start.png",pathIcon + "team_prev.png",erso_team_playback.name,lineStyleTrack) ;
  1390. };
  1391. } ;
  1392. /*--------------------------------------------历史轨迹回放 end-------------------------------------------------*/
  1393. /**
  1394. * 轨迹回放添加图标
  1395. */
  1396. this.addAdsIcon = function(x,y,teamId,resStart,layTrac){
  1397. var markerId = "" ;
  1398. for(var key in resStart){
  1399. if(resStart[key]["extraData"]["teamid"] == teamId){
  1400. var tem = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "team_prev.png",clikable:true,"title":resStart[key]["title"]} ;
  1401. markerId = addOneIco(tem);
  1402. if(x == resStart[key]["posX"] && y == resStart[key]["posY"]){
  1403. //1.判断是不是起点,如果是起点则添加起点图标
  1404. var obj = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "ads_start.png",clickable:true} ;
  1405. addOneIco(obj) ;
  1406. } else {
  1407. //1.判断是不是起点,如果不是起点则添加地址图标
  1408. var obj = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "adslabel.png",clickable:true} ;
  1409. addOneIco(obj);
  1410. }
  1411. }
  1412. }
  1413. return markerId ;
  1414. };
  1415. /*--------------------------------------------轨迹回放添加图标 end-------------------------------------------------*/
  1416. /**
  1417. * 轨迹点生成
  1418. * @param e 一组坐标点,4个参数,x坐标 y坐标 afterX坐标 afterY坐标
  1419. * @param markerId 要闪动的Marker点ID
  1420. * @param iconStr 队伍开始图标(大概分两种:起点和地点)
  1421. * @param icon 展示在地图上的Marker图标
  1422. * @param layTrac 图层名
  1423. * @param ls 线样式
  1424. */
  1425. this.tracingHistory = function(e,markerId,iconStr,icon,layTrac,ls){
  1426. for(var xy = 0; xy < e["points"].length; xy++){
  1427. if(xy%10==0 && xy!=0){
  1428. var obj = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:pathIcon + "ads.png",clickable:false,
  1429. title:"队伍名称:" + e["teamName"] + "\n时间:"+e["points"][xy].uploadTime + "\n\n经度:" +
  1430. e["points"][xy].x + "\n纬度:" + e["points"][xy].y} ;
  1431. addOneIco(obj) ;
  1432. };
  1433. var er_points = {"points":[{"x":e["points"][xy].afterX,"y":e["points"][xy].afterY},
  1434. {"x":e["points"][xy].x,"y":e["points"][xy].y}]} ;
  1435. var erpath = [{"layerName":layTrac,"points":er_points,"lineStyle":ls}] ;
  1436. addResourcePath(erpath) ;//生成折线路径
  1437. } ;
  1438. var i = 0 ;
  1439. for(var xy in e["points"]){
  1440. i++;
  1441. (function(){
  1442. var ii=i;
  1443. var tem = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:icon,clikable:true,"title":e["inciName"]+":"+e["teamName"]} ;
  1444. setTimeout(function(){
  1445. updataMarkerByTeam(markerId,tem);
  1446. },ii*1000);
  1447. })();
  1448. } ;
  1449. } ;
  1450. /*--------------------------------------------轨迹点生成 end-------------------------------------------------*/
  1451. /**
  1452. * 得到日期类型时间yyyy-mm-dd hh:mm:ss
  1453. * @returns {String}
  1454. */
  1455. this.getNowFormatDate = function(date){
  1456. var month = date.getMonth() + 1 ;
  1457. if(month<10)
  1458. month = "0" + month ;
  1459. var day = date.getDate() ;
  1460. if(day<10)
  1461. day = "0" + day ;
  1462. var hours = date.getHours() ;
  1463. if(hours<10)
  1464. hours = "0" + hours ;
  1465. var minutes = date.getMinutes() ;
  1466. if(minutes<10)
  1467. minutes = "0" + minutes ;
  1468. var seonds = date.getSeconds() ;
  1469. if(seonds<10)
  1470. seonds = "0" + seonds ;
  1471. return date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seonds ;
  1472. } ;
  1473. /*--------------------------------得到日期类型时间yyyy-mm-dd hh:mm:ss end-------------------------------------------------*/
  1474. /**
  1475. * 得到3个月前的日期类型时间yyyy-mm-dd hh:mm:ss
  1476. * @returns {String}
  1477. */
  1478. this.getThreeMonthsAgo = function(date){
  1479. var now = new Date(date.replace(/\-/g,"/"));
  1480. var tmya =new Date( now.setMonth(now.getMonth() - 3));
  1481. return _this.getNowFormatDate(tmya) ;
  1482. } ;
  1483. /*--------------------------------得到3个月前的日期类型时间yyyy-mm-dd hh:mm:ss end-------------------------------------------------*/
  1484. /**
  1485. * XY定位,循环数据得到[x1,y1,x2,y2,x3,y3...]样式数组
  1486. * @param data 后台返回的结果
  1487. * @param x 坐标对应的经度key
  1488. * @param y 坐标对应的纬度key
  1489. * @returns {Array} 返回图标坐标数组
  1490. */
  1491. this.poinXY = function(data,x,y){
  1492. var poinArr = [] ;
  1493. for(var key in data){
  1494. var reg = new RegExp("^[0-9]+(.[0-9]+)?$");
  1495. if(reg.test(data[key][x]) && reg.test(data[key][y]) && out_of_china(data[key][x],data[key][y])){
  1496. poinArr.push(data[key][x]) ;
  1497. poinArr.push(data[key][y]) ;
  1498. };
  1499. // poinArr.push(data[key][x]) ;
  1500. // poinArr.push(data[key][y]) ;
  1501. }
  1502. return poinArr ;
  1503. };
  1504. /*---------------------------------------XY定位,循环数据得到[x1,y1,x2,y2,x3,y3...]样式数组 end -----------------------------------*/
  1505. /**
  1506. * 定位到指定区域
  1507. * @param posXArr X坐标数组
  1508. * @param posYArr Y坐标数组
  1509. * @returns 地图当前缩放等级
  1510. */
  1511. this.zoomToExtent = function(posXArr,posYArr){
  1512. var maxX = Math.max.apply(Math,posXArr) + 0.5;
  1513. var minX = Math.min.apply(Math,posXArr) - 0.5;
  1514. var maxY = Math.max.apply(Math,posYArr) + 0.5;
  1515. var minY = Math.min.apply(Math,posYArr) - 0.5;
  1516. var posXY = {minX:minX,minY:minY,maxX:maxX,maxY:maxY};
  1517. zoomToExtent(posXY) ;
  1518. return getCurrentZoomLevel() ;
  1519. };
  1520. /*---------------------------------------定位到指定区域end -----------------------------------*/
  1521. /**
  1522. * 定位到一组指定坐标(公用)
  1523. * @param cardlist为多组坐标,格式为[x1,y1,x2,y2,x3,y3...]
  1524. */
  1525. this.zoomToCoordList = function(coordList){
  1526. var posXArr = [];
  1527. var posYArr = [] ;
  1528. for(var i = 0 ; i < coordList.length; i++){
  1529. if(i%2==0){
  1530. posXArr.push(coordList[i]);
  1531. }else{
  1532. posYArr.push(coordList[i]);
  1533. }
  1534. }
  1535. var maxX = Math.max.apply(Math,posXArr) + 0.5;
  1536. var minX = Math.min.apply(Math,posXArr) - 0.5;
  1537. var maxY = Math.max.apply(Math,posYArr) + 0.5;
  1538. var minY = Math.min.apply(Math,posYArr) - 0.5;
  1539. var posXY = {minX:minX,minY:minY,maxX:maxX,maxY:maxY};
  1540. zoomToExtent(posXY);
  1541. } ;
  1542. /**
  1543. * 跟据XY坐标添加Marker
  1544. */
  1545. this.addMarkerXY = function(iconName,x,y,teamId,describeinfo){
  1546. switch (iconName){
  1547. case "team.png" : //队伍
  1548. teamArr.push("TEAM") ;
  1549. var value = {} ;
  1550. if(describeinfo){
  1551. value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"TEAMID\":\"" + teamId + "\",\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
  1552. } else {
  1553. value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"TEAMID\":\"" + teamId + "\"}]" ;
  1554. }
  1555. teamXYArr.push(value) ;
  1556. break;
  1557. case "adslabel.png" : //地点
  1558. siteArr.push("SITE") ;
  1559. var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
  1560. siteXYArr.push(value) ;
  1561. break ;
  1562. case "goods.png" : //物资
  1563. vehicleArr.push("VEHICLE") ;
  1564. var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
  1565. vehicleXYArr.push(value) ;
  1566. break ;
  1567. case "ads_start.png" : //起点
  1568. originArr.push("ORIGIN") ;
  1569. var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
  1570. originXYArr.push(value) ;
  1571. break ;
  1572. case "destination.png" : //终点
  1573. destinationArr.push("DESTINATION") ;
  1574. var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
  1575. destinationXYArr.push(value) ;
  1576. break ;
  1577. }
  1578. } ;
  1579. /*-------------------------------------------------跟据XY坐标添加Marker end------------------------------------------------------*/
  1580. /**
  1581. * 启动图形完成回调事件
  1582. * e["geometryType"] : 得到图形类型 线:1 多边形:2 圆:3 矩形: 4
  1583. */
  1584. this.openDarwCallBack = function(e){
  1585. var num = 0 ;
  1586. var value = "[" ;
  1587. for(var point in e["geoData"]["points"] ){
  1588. if(e["geoData"]["radius"]){
  1589. value += "{\"LONGITUDE\":" + e["geoData"]["points"][point]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][point]["y"] + ",\"NUM\":" + num + ",\"RADIUS\":" + e["geoData"]["radius"] + "},";
  1590. } else {
  1591. value += "{\"LONGITUDE\":" + e["geoData"]["points"][point]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][point]["y"] + ",\"NUM\":" + num + "},";
  1592. }
  1593. num ++ ;
  1594. } ;
  1595. value = value.substring(0, value.length-1) ;
  1596. value += "]" ;
  1597. if(e["geometryType"]==1){ //折线
  1598. lineArr.push("LINE") ;
  1599. lineXYArr.push(value) ;
  1600. // linePoints.push(e["geoData"]["points"]) ;
  1601. } ;
  1602. if(e["geometryType"]==2){ //多边形
  1603. polygonArr.push("POLYGON") ;
  1604. polygonXYArr.push(value) ;
  1605. // polygonPoints.push(e["geoData"]["points"]) ;
  1606. } ;
  1607. if(e["geometryType"]==3){ //圆形
  1608. circleArr.push("CIRCLE") ;
  1609. circleXYArr.push(value) ;
  1610. // circlePoints.push(e["geoData"]["points"]) ;
  1611. } ;
  1612. if(e["geometryType"]==4){ //矩形
  1613. var valueGeo = "[{\"LONGITUDE\":" + e["geoData"]["points"][0]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][1]["y"] + ",\"NUM\":0},";
  1614. valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][1]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][1]["y"] + ",\"NUM\":1},";
  1615. valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][1]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][0]["y"] + ",\"NUM\":2},";
  1616. valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][0]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][0]["y"] + ",\"NUM\":3}]";
  1617. rectangleArr.push("RECTANGLE") ;
  1618. rectangleXYArr.push(valueGeo) ;
  1619. // rectanglePoints.push(e["geoData"]["points"]) ;
  1620. } ;
  1621. } ;
  1622. /*--------------------------------------------------启动图形完成回调事件 end---------------------------------------------------------*/
  1623. /**
  1624. * 添加自定义标注
  1625. */
  1626. this.addMarkerToUserDefined = function(f,flg){
  1627. draw_value.ls = lineStyleDraw;
  1628. draw_value.layName = erso_lay_draw.name ;
  1629. if(f=='but6'){
  1630. if(flg){
  1631. var userInfo = _this.resolveUrl() ;
  1632. var url = $.pathname() + "/page/cockpit/webgis/toolTeam.jsp?fd_id=" + userInfo["dept_id"] ;
  1633. ai.createIframe(400, 270, url);
  1634. }
  1635. draw_value.teamId = teamInfo.fd_id ;
  1636. draw_value.describeinfo = teamInfo.name ;
  1637. var descri = teamInfo.teamDesc ;
  1638. if(descri){
  1639. draw_value.describeinfo += "(" + descri + ")" ;
  1640. }
  1641. draw_value.icon = pathIcon + "team.png" ;//队伍
  1642. } else if(f=='but7'){
  1643. draw_value.describeinfo = "地点" ;
  1644. draw_value.icon = pathIcon + "adslabel.png" ;//地点
  1645. } else if(f=='but8'){
  1646. var url = $.pathname() + "/page/cockpit/dialog/emergencySupplies.jsp" ;
  1647. draw_value.describeinfo = showModalDialog(url,window,"scroll:yes;status:no;dialogWidth:400px;dialogHeight:270px") ;
  1648. if(draw_value.describeinfo==undefined){ draw_value.describeinfo = ""; }
  1649. draw_value.icon = pathIcon + "goods.png" ;//物资
  1650. } else if(f=='but9'){
  1651. draw_value.describeinfo = "起点" ;
  1652. draw_value.icon = pathIcon + "ads_start.png" ;//起点
  1653. // icon = path + "/nwyj/images/cockpit/11.gif" ;//起点
  1654. } else if(f=='but10'){
  1655. draw_value.describeinfo = "终点" ;
  1656. draw_value.icon = pathIcon + "destination.png" ;//终点
  1657. };
  1658. if(!draw_value.flag){
  1659. addEvent("onGetPointEvent",callBackAddMarker);
  1660. draw_value.flag = true;
  1661. };
  1662. if(f=='but6'&&(!flg)){
  1663. startGetPoint();
  1664. }else if(f!='but6'){
  1665. startGetPoint();
  1666. }
  1667. };
  1668. /*------------------------------------------------添加自定义标注 end-------------------------------------------------------------*/
  1669. /**
  1670. * 保存自定义图形按钮事件
  1671. */
  1672. this.saveDraw = function(inciResult){
  1673. if(lineArr.length != 0 || polygonArr.length != 0 || circleArr != 0 || rectangleArr != 0 || originArr != 0 ||
  1674. siteArr != 0 || destinationArr != 0 || vehicleArr != 0 || teamArr != 0){
  1675. // var inciResult = saveIncident() ;
  1676. // drawTypeIds
  1677. // var a = drawTypeIds.join(",") ;
  1678. if(lineArr.length != 0){
  1679. var lineResult = _this.saveType(inciResult,lineArr) ;
  1680. // var lineXYResultJson = _this.saveXY(lineResult,lineXYArr) ;//保存折线类坐标
  1681. _this.saveXY(lineResult,lineXYArr) ;//保存折线类坐标
  1682. drawTypeIds = drawTypeIds.concat(lineResult) ;
  1683. lineArr = [] ;
  1684. lineXYArr = [] ;
  1685. // trunDrawLine(lineResult) ;
  1686. }
  1687. if(polygonArr.length != 0){
  1688. var polygonResult = _this.saveType(inciResult,polygonArr) ;
  1689. // var polygonXYResultJson = _this.saveXY(polygonResult,polygonXYArr) ;//保存多边形类坐标
  1690. _this.saveXY(polygonResult,polygonXYArr) ;//保存多边形类坐标
  1691. drawTypeIds = drawTypeIds.concat(polygonResult) ;
  1692. polygonArr = [] ;
  1693. polygonXYArr = [] ;
  1694. }
  1695. if(circleArr.length != 0){
  1696. var circleResult = _this.saveType(inciResult,circleArr) ;
  1697. // var circleXYResultJson = _this.saveXY(circleResult,circleXYArr) ;//保存圆形类坐标
  1698. _this.saveXY(circleResult,circleXYArr) ;//保存圆形类坐标
  1699. // for(var key in circleXYResultJson){alert(circleXYResultJson[key]); }
  1700. drawTypeIds = drawTypeIds.concat(circleResult) ;
  1701. circleArr = [] ;
  1702. circleXYArr = [] ;
  1703. }
  1704. if(rectangleArr.length != 0){
  1705. var rectangleResult = _this.saveType(inciResult,rectangleArr) ;
  1706. // var rectangleXYResultJson = _this.saveXY(rectangleResult,rectangleXYArr) ;//保存矩形类坐标
  1707. _this.saveXY(rectangleResult,rectangleXYArr) ;//保存矩形类坐标
  1708. drawTypeIds = drawTypeIds.concat(rectangleResult) ;
  1709. rectangleArr = [] ;
  1710. rectangleXYArr = [] ;
  1711. }
  1712. if(originArr.length != 0){
  1713. var rectangleResult = _this.saveType(inciResult,originArr) ;
  1714. // var rectangleXYResultJson = _this.saveXY(rectangleResult,originXYArr) ;//保存起点类坐标
  1715. _this.saveXY(rectangleResult,originXYArr) ;//保存起点类坐标
  1716. drawTypeIds = drawTypeIds.concat(rectangleResult) ;
  1717. originArr = [] ;
  1718. originXYArr = [] ;
  1719. }
  1720. if(siteArr.length != 0){
  1721. var siteResult = _this.saveType(inciResult,siteArr) ;
  1722. // var siteXYResult = _this.saveXY(siteResult,siteXYArr) ;//保存地点类坐标
  1723. _this.saveXY(siteResult,siteXYArr) ;//保存地点类坐标
  1724. drawTypeIds = drawTypeIds.concat(siteResult) ;
  1725. siteArr = [] ;
  1726. siteXYArr = [] ;
  1727. }
  1728. if(destinationArr.length != 0){
  1729. var destinationResult = _this.saveType(inciResult,destinationArr) ;
  1730. // var destinationXYResultJson = _this.saveXY(destinationResult,destinationXYArr) ;//保存终点类坐标
  1731. _this.saveXY(destinationResult,destinationXYArr) ;//保存终点类坐标
  1732. drawTypeIds = drawTypeIds.concat(destinationResult) ;
  1733. destinationArr = [] ;
  1734. destinationXYArr = [] ;
  1735. }
  1736. if(vehicleArr.length != 0){
  1737. var vehicleResult = _this.saveType(inciResult,vehicleArr) ;
  1738. // var vehicleXYResult = _this.saveXY(vehicleResult,vehicleXYArr) ;//保存车辆类坐标
  1739. _this.saveXY(vehicleResult,vehicleXYArr) ;//保存车辆类坐标
  1740. drawTypeIds = drawTypeIds.concat(vehicleResult) ;
  1741. vehicleArr = [] ;
  1742. vehicleXYArr = [] ;
  1743. }
  1744. if(teamArr.length != 0){
  1745. var teamResult = _this.saveType(inciResult,teamArr) ;
  1746. // var teamXYResult = _this.saveXY(teamResult,teamXYArr) ;//保存队伍类坐标
  1747. _this.saveXY(teamResult,teamXYArr) ;//保存队伍类坐标
  1748. drawTypeIds = drawTypeIds.concat(teamResult) ;
  1749. teamArr = [] ;
  1750. teamXYArr = [] ;
  1751. } ;
  1752. ai.setMes(320, 186, 200, 500, "系统提示", "保存成功!");
  1753. ai.createAlert();
  1754. } else {
  1755. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据可以保存!");
  1756. ai.createAlert();
  1757. } ;
  1758. } ;
  1759. /*-------------------------------------------------保存自定义图形按钮事件 end ------------------------------------------------------------*/
  1760. /**
  1761. * 保存参数信息
  1762. * @param inciResult 事件ID
  1763. * @returns {Array} 返回FD_ID
  1764. */
  1765. this.saveType = function(inciResult,drowArr){
  1766. var par = "[" ;
  1767. var userInfoByTop = _this.resolveUrl() ;
  1768. for(var key in drowArr){
  1769. par += '{"INNECTID":"' + inciResult +'","DROWTYPE":"'+drowArr[key]+'","USER_ID":"' + userInfoByTop["user_id"] + '"},';
  1770. } ;
  1771. par = par.substring(0, par.length-1) ;
  1772. par += "]" ;
  1773. url = $.pathname() + "/ws/cockpit/CockpitService/addDrawType" ;//批量添加自定义线形图到参数信息存储表
  1774. params = { DATA : par } ;
  1775. // $.post(url,params,function(data){
  1776. // return data ;
  1777. // }, "text") ;
  1778. return _this.getArrData(url,params) ;//得到线型FD_ID
  1779. } ;
  1780. /*-------------------------------------------------保存参数信息 end ------------------------------------------------------------*/
  1781. /**
  1782. * 保存图形的坐标点
  1783. * @param lineResult
  1784. * @returns {Array}
  1785. */
  1786. this.saveXY = function(lineResult, xyArr){
  1787. var jsonStr = "[" ;
  1788. var exchangeStr = "" ;
  1789. for(var i = 0 ; i < lineResult.length ; i++){//根据得到到图型FD_ID保存线形坐标数据
  1790. var exchangeJson = JSON.parse(xyArr[i]) ;
  1791. for(var sk in exchangeJson){
  1792. exchangeJson[sk] = _this.addJsonAttribute(exchangeJson[sk],"FIGUREID",lineResult[i]);
  1793. exchangeStr = JSON.stringify(exchangeJson[sk]) ;
  1794. jsonStr += exchangeStr ;
  1795. jsonStr += "," ;
  1796. } ;
  1797. } ;
  1798. jsonStr = jsonStr.substring(0, jsonStr.length - 1) ;
  1799. jsonStr += "]" ;
  1800. url = $.pathname() + "/ws/cockpit/CockpitService/addDrawXY" ;//批量添加自定义线形图到参数信息存储表
  1801. params = { DATA : jsonStr } ;
  1802. return _this.getArrData(url,params) ;
  1803. } ;
  1804. /*------------------------------------------------保存图形的坐标点 end ------------------------------------------------------------*/
  1805. /**
  1806. * 清除用户自定义图形
  1807. */
  1808. this.clearDrawUserDefined = function(){
  1809. clearlay("ersoLayDraw");
  1810. _this.clearDrawByUserArr() ;
  1811. /*if(drawTypeIds.length != 0){
  1812. var url = $.pathname() + "/ws/cockpit/CockpitService/delDrawUserDefined" ;//批量删除用户自定义绘制图形
  1813. var params = drawTypeIds.join(",") ;
  1814. $.post(url,params,function(data){
  1815. if(data){
  1816. clearlay("ersoLayDraw");
  1817. ai.setMes(320, 186, 200, 500, "系统提示", "保存后删除成功!");
  1818. ai.createAlert();
  1819. clearlay(erso_lay_show.name);
  1820. }
  1821. },"text") ;
  1822. drawTypeIds = [] ;
  1823. } else {
  1824. clearlay("ersoLayDraw");
  1825. _this.clearDrawByUserArr() ;
  1826. ai.setMes(320, 186, 200, 500, "系统提示", "未保存图形删除成功!");
  1827. ai.createAlert();
  1828. }*/
  1829. };
  1830. /*------------------------------------------------清除用户自定义图形 end ------------------------------------------------------------*/
  1831. /**
  1832. * 清除用户自定义图形
  1833. */
  1834. this.clearDrawByUserArr = function(){
  1835. lineArr = [] ; //存储线类型数组
  1836. polygonArr = [] ; //存储多边形类型数组
  1837. circleArr = [] ; //存储圆类型
  1838. rectangleArr = [] ;//矩形数组
  1839. originArr = [] ;//起点数组
  1840. siteArr = [] ;//地点
  1841. destinationArr = [] ;//终点
  1842. vehicleArr = [] ;//车辆
  1843. teamArr = [] ;//人员
  1844. lineXYArr = [] ; //存储线类型数组坐标
  1845. polygonXYArr = [] ; //存储多边形类型数组坐标
  1846. circleXYArr = [] ; //存储圆类型坐标
  1847. rectangleXYArr = [] ;//矩形数组坐标
  1848. originXYArr = [] ;//起点数组坐标
  1849. siteXYArr = [] ;//地点坐标
  1850. destinationXYArr = [] ;//终点坐标
  1851. vehicleXYArr = [] ;//车辆坐标
  1852. teamXYArr = [] ;//人员坐标
  1853. drawTypeIds = [] ;
  1854. };
  1855. /*------------------------------------------------清除用户自定义图形 end ------------------------------------------------------------*/
  1856. /**
  1857. * 按类型查询用户自定义图形信息
  1858. */
  1859. this.searchDrawByUserInfo = function(inicId){
  1860. _this.isDelDrawLay(inicId) ;
  1861. addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;//添加自定义图标图层(绘图面板转换后)
  1862. /*var userInfoByTop = _this.resolveUrl() ;
  1863. var params = {} ;
  1864. var res = {} ;
  1865. var flg = true;
  1866. var url = $.pathname() + "/ws/cockpit/CockpitService/queryDrawByUser" ;
  1867. params = {"inicId":inicId,"type":"LINE","userId":userInfoByTop["user_id"]} ;//线
  1868. res = _this.getJsonData(url,params) ;
  1869. if(res){
  1870. _this.addUserDrawByLine(res) ;
  1871. flg = false;
  1872. }
  1873. params = {"inicId":inicId,"type":"POLYGON","userId":userInfoByTop["user_id"]} ;//多边形
  1874. res = _this.getJsonData(url,params) ;
  1875. if(res){
  1876. _this.addUserDrawByPolygon(res) ;
  1877. flg = false;
  1878. };
  1879. params = {"inicId":inicId,"type":"CIRCLE","userId":userInfoByTop["user_id"]} ;//圆形
  1880. res = _this.getJsonData(url,params) ;
  1881. if(res){
  1882. _this.addUserDrawByCircle(res) ;
  1883. flg = false;
  1884. }
  1885. params = {"inicId":inicId,"type":"RECTANGLE","userId":userInfoByTop["user_id"]} ;//矩形
  1886. res = _this.getJsonData(url,params) ;
  1887. if(res){
  1888. _this.addUserDrawByPolygon(res) ;
  1889. flg = false;
  1890. }
  1891. url = $.pathname() + "/ws/cockpit/CockpitService/queryDrawByUserMarker" ;
  1892. params = {"inicId":inicId,"type":"SITE","userId":userInfoByTop["user_id"]} ;//地点
  1893. res = _this.getJsonData(url,params) ;
  1894. if(res){
  1895. res = _this.addEwrAttr(res,true,erso_lay_show.name);
  1896. var objKV = _this.addUserDrawByIcon(res) ;
  1897. addRightDraw(objKV);
  1898. flg = false;
  1899. };
  1900. params = {"inicId":inicId,"type":"ORIGIN","userId":userInfoByTop["user_id"]} ;//起点
  1901. res = _this.getJsonData(url,params) ;
  1902. if(res){
  1903. res = _this.addEwrAttr(res,false,erso_lay_show.name) ;
  1904. var objKV = _this.addUserDrawByIcon(res) ;
  1905. addRightDraw(objKV);
  1906. // addResourceIco(res) ;
  1907. flg = false;
  1908. }
  1909. params = {"inicId":inicId,"type":"DESTINATION","userId":userInfoByTop["user_id"]} ;//终点
  1910. res = _this.getJsonData(url,params) ;
  1911. if(res){
  1912. res = _this.addEwrAttr(res,false,erso_lay_show.name) ;
  1913. var objKV = _this.addUserDrawByIcon(res) ;
  1914. addRightDraw(objKV);
  1915. // addResourceIco(res) ;
  1916. flg = false;
  1917. }
  1918. params = {"inicId":inicId,"type":"TEAM","userId":userInfoByTop["user_id"]} ;//队伍
  1919. res = _this.getJsonData(url,params) ;
  1920. if(res){
  1921. res = _this.addEwrAttr(res,true,erso_lay_show.name) ;
  1922. var objKV = _this.addUserDrawByIcon(res) ;
  1923. addRightDraw(objKV);
  1924. // addResourceIco(res) ;
  1925. flg = false;
  1926. }
  1927. params = {"inicId":inicId,"type":"VEHICLE","userId":userInfoByTop["user_id"]} ;//物资
  1928. res = _this.getJsonData(url,params) ;
  1929. if(res){
  1930. res = _this.addEwrAttr(res,true,erso_lay_show.name) ;
  1931. var objKV = _this.addUserDrawByIcon(res) ;
  1932. addRightDraw(objKV);
  1933. // addResourceIco(res) ;
  1934. flg = false;
  1935. }
  1936. if(flg){
  1937. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据!");
  1938. ai.createAlert();
  1939. }*/
  1940. // addRightClick() ;
  1941. };
  1942. /*--------------------------------------------按类型查询用户自定义图形信息 end-------------------------------------------------------------*/
  1943. /**
  1944. * 添加手绘折线
  1945. * @param drawLineResArr
  1946. */
  1947. this.addUserDrawByLine = function(drawResArr){
  1948. var pointDraw = [] ;
  1949. for(var key in drawResArr){
  1950. pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
  1951. }
  1952. var objKV = _this.addLineByUserDraw(pointDraw) ;
  1953. addRightDraw(objKV);
  1954. };
  1955. /*--------------------------------------------添加手绘折线 end-----------------------------------------------------*/
  1956. /**
  1957. * 添加手绘多边形
  1958. * @param drawLineResArr
  1959. */
  1960. this.addUserDrawByPolygon = function(drawResArr){
  1961. var pointDraw = [] ;
  1962. for(var key in drawResArr){
  1963. pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
  1964. }
  1965. var objKV = _this.addPolygonByUserDraw(pointDraw) ;
  1966. addRightDraw(objKV);
  1967. };
  1968. /**
  1969. * 添加手绘圆形
  1970. * @param drawResArr
  1971. */
  1972. this.addUserDrawByCircle = function (drawResArr){
  1973. var pointDraw = [] ;
  1974. for(var key in drawResArr){
  1975. pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"],"radius":drawResArr[key]["radius"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
  1976. }
  1977. var objKV = _this.addCircleByUserDraw(pointDraw) ;
  1978. addRightDraw(objKV);
  1979. };
  1980. /*-------------------------------------------添加手绘圆形 end-------------------------------------------------*/
  1981. /**
  1982. * 批量添加折线,返回ID与FD_ID健值对
  1983. * @param polygonArr
  1984. */
  1985. this.addLineByUserDraw = function(polygonArr){
  1986. var drawKV = {} ;
  1987. for(var transfer in polygonArr){
  1988. var pId = addPolyLine(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
  1989. drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
  1990. };
  1991. return drawKV ;
  1992. };
  1993. /*------------------------------------------- 批量添加折线,返回ID与FD_ID健值对 end-------------------------------------------------*/
  1994. /**
  1995. * 批量添加多边形,返回ID与FD_ID健值对
  1996. * @param polygonArr
  1997. */
  1998. this.addPolygonByUserDraw = function(polygonArr){
  1999. var drawKV = {} ;
  2000. for(var transfer in polygonArr){
  2001. var pId = addPolygon(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
  2002. drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
  2003. };
  2004. return drawKV ;
  2005. };
  2006. /*------------------------------------------- 批量添加多边形,返回ID与FD_ID健值对 end-------------------------------------------------*/
  2007. /**
  2008. * 批量添加图标,返回ID与FD_ID健值对
  2009. * @param
  2010. */
  2011. this.addUserDrawByIcon = function(polygonArr){
  2012. var drawKV = {} ;
  2013. for(var transfer in polygonArr){
  2014. var pId = addMarker(polygonArr[transfer]) ;
  2015. drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]["inciId"]);
  2016. };
  2017. return drawKV ;
  2018. } ;
  2019. /*-------------------------------------------批量添加图标,返回ID与FD_ID健值对 end-------------------------------------------------*/
  2020. /**
  2021. * 添加用户自定义圆返回ID与FD_ID健值对
  2022. * @param circleArr
  2023. * @returns {___anonymous64930_64931}
  2024. */
  2025. this.addCircleByUserDraw = function(circleArr){
  2026. var drawKV = {} ;
  2027. for(var transfer in circleArr){
  2028. var obj = {
  2029. points:{x:circleArr[transfer]["points"]["points"][0]["x"], y:circleArr[transfer]["points"]["points"][0]["y"]},
  2030. radius:circleArr[transfer]["points"]["radius"]
  2031. } ;
  2032. var circleId = addCircle(circleArr[transfer]["layerName"],obj,circleArr[transfer]["lineStyle"],circleArr[transfer]["extraData"]) ;
  2033. drawKV = _this.addJsonAttribute(drawKV,circleId,circleArr[transfer]["extraData"]);
  2034. };
  2035. return drawKV ;
  2036. };
  2037. /*-------------------------------------------添加用户自定义圆返回ID与FD_ID健值对 end-------------------------------------------------*/
  2038. /**
  2039. * 删除自定义绘图图层图形
  2040. */
  2041. this.isDelDrawLay = function(inicId){
  2042. if(lineArr.length != 0 || polygonArr.length != 0 || circleArr != 0 || rectangleArr != 0 || originArr != 0 ||
  2043. siteArr != 0 || destinationArr != 0 || vehicleArr != 0 || teamArr != 0){
  2044. if(confirm("有未保存的图形,单击确定保存后再查看")){
  2045. _this.saveDraw(inicId) ;
  2046. _this.delDrawLay() ;
  2047. } else {
  2048. _this.delDrawLay() ;
  2049. }
  2050. } else {
  2051. _this.delDrawLay() ;
  2052. }
  2053. };
  2054. /*--------------------------------------------按类型查询用户自定义图形信息 end-------------------------------------------------------------*/
  2055. /**
  2056. * 删除用户自定义图形图层
  2057. */
  2058. this.delDrawLay = function(){
  2059. addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
  2060. addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;
  2061. clearlay(erso_lay_draw.name) ;
  2062. clearlay(erso_lay_show.name) ;
  2063. addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
  2064. };
  2065. /**
  2066. * 应急预警和响应图标查询
  2067. * @param url 查询路径
  2068. * @param params 查询条件
  2069. * @param flg 图标是否可点击Boolean
  2070. * @param lay 显示图层
  2071. * @returns {Array} 返回图标坐标数组
  2072. */
  2073. this.searchMarkerToEwer = function(url,params,flg,lay){
  2074. var ewJsonData = _this.getJsonData(url,params) ;
  2075. var poinArr = _this.poinXY(ewJsonData, "posX", "posY");
  2076. ewJsonData = _this.addEwrAttr(ewJsonData,flg,lay) ;
  2077. addResourceIco(ewJsonData);//添加图标
  2078. _this.addGisLengen(ewJsonData);
  2079. return poinArr ;
  2080. };
  2081. /*------------------------------------------------应急预警和响应图标查询end---------------------------------------*/
  2082. /**
  2083. * 应急预警与响应标注json格式其它参数
  2084. * @param jsonStr 从数据库中读取出来的json属性
  2085. * @param clickable 图标是否可以点击
  2086. * @param lay 图层名
  2087. */
  2088. this.addEwrAttr = function(jsonStr,clickable,lay){
  2089. for(var key in jsonStr){
  2090. jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"clickable",clickable);
  2091. jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"layerName",lay);
  2092. jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"icon",pathIcon + jsonStr[key]["extraData"]["name"] + ".png");
  2093. }
  2094. return jsonStr ;
  2095. };
  2096. /*---------------------------------------------应急预警与响应标注json格式其它参数end----------------------------------------------*/
  2097. /**
  2098. * json格式添加属性
  2099. * @param jsonStr
  2100. */
  2101. this.addJsonAttribute = function(jsonStr,key,value){
  2102. $(jsonStr).attr(key,value) ;
  2103. return jsonStr ;
  2104. };
  2105. /*---------------------------------------------json格式添加属性end----------------------------------------------*/
  2106. this.delLastChar = function(str){
  2107. if(str != "" || str != undefined || str != null){
  2108. str = str.substring(0,str.length-1);
  2109. return str;
  2110. }
  2111. return "";
  2112. };
  2113. /*---------------------------------------------字符串删除最后一个字符end-----------------------------------------------*/
  2114. /**
  2115. * 得到单个sql精确查询条件
  2116. * @param colum
  2117. * @param value
  2118. * @return
  2119. */
  2120. this.getOneSqlWhere = function(colum, value){
  2121. var valueArr = value.split(",") ;
  2122. var result = " and (" ;
  2123. for(var i = 0 ; i < valueArr.length ; i++){
  2124. result += ( colum + " = '" + valueArr[i] + "' or ") ;
  2125. }
  2126. result = result.substring(0, result.length - 3) ;
  2127. result += ")" ;
  2128. return result ;
  2129. } ;
  2130. /*--------------------------------------------- 得到单个sql精确查询条件end----------------------------------------------*/
  2131. /**
  2132. * 得到单个sql模糊查询条件
  2133. * @param colum
  2134. * @param value
  2135. * @return
  2136. */
  2137. this.getOneSqlWhereLike = function(colum,value){
  2138. var valueArr = value.split(",") ;
  2139. var result = " and (" ;
  2140. for(var i = 0 ; i < valueArr.length ; i++){
  2141. result += ( colum + " like '%" + valueArr[i] + "%' or ") ;
  2142. }
  2143. result = result.substring(0, result.length-3) ;
  2144. result += ")" ;
  2145. return result ;
  2146. } ;
  2147. /*---------------------------------------------得到单个sql模糊查询条件end----------------------------------------------*/
  2148. /**
  2149. * 得到json格式请求
  2150. */
  2151. this.getJsonData = function(url,params){
  2152. $("#leftceladows").showLoading();
  2153. var result={} ;
  2154. $.ajax({
  2155. async:false,
  2156. url : url,
  2157. type : 'post',
  2158. timeout : 60000,
  2159. data : params,
  2160. dataType : 'json',
  2161. success : function(data) {
  2162. result = data ;
  2163. $("body").eq(0).hideLoading();
  2164. return data ;
  2165. },
  2166. error : function(e) {
  2167. $.messager.alert('操作失败', '访问服务失败!', 'error');
  2168. console.log("URL:"+url);
  2169. }
  2170. });
  2171. $("#leftceladows").hideLoading();
  2172. return result ;
  2173. };
  2174. /*-----------------------------------得到json格式请求 end-----------------------------------------------------------------*/
  2175. /**
  2176. * ajax请求 返回数据为字符串并封装为数组用
  2177. */
  2178. this.getArrData = function(url,params){
  2179. var newData = [] ;
  2180. $.ajax({
  2181. async:false,
  2182. url : url,
  2183. type : 'post',
  2184. timeout : 0,
  2185. data : params,
  2186. dataType : 'text',
  2187. success : function(data) {
  2188. newData = data.split(",") ;
  2189. return newData ;
  2190. },
  2191. error : function(e) {
  2192. $.messager.alert('操作失败', '访问服务失败!', 'error');
  2193. console.log("URL:"+url);
  2194. }
  2195. });
  2196. return newData ;
  2197. };
  2198. /*-----------------------------------得到数组格式请求 end-----------------------------------------------------------------*/
  2199. /**
  2200. * axaj请求(返回字符串数据)
  2201. */
  2202. this.getStrData = function(url,params){
  2203. var str = "" ;
  2204. $.ajax({
  2205. async:false,
  2206. url : url,
  2207. type : 'post',
  2208. timeout : 0,
  2209. data : params,
  2210. dataType : 'text',
  2211. success : function(data) {
  2212. str = data ;
  2213. },
  2214. error : function(e) {
  2215. $.messager.alert('操作失败', '访问服务失败!', 'error');
  2216. console.log("URL:"+url);
  2217. }
  2218. });
  2219. return str ;
  2220. };
  2221. /*-----------------------------------axaj请求(返回字符串数据) end-----------------------------------------------------------------*/
  2222. /**
  2223. * 前台导出Excel
  2224. */
  2225. this.expor_excel = function(devIDList,flag){
  2226. // $("#leftceladows").showLoading();
  2227. // $("#leftceladows").hideLoading();
  2228. $("#leftceladows").showLoading();
  2229. var oXL = new ActiveXObject("Excel.Application"); //创建应该对象
  2230. var oWB = oXL.Workbooks.Add();//新建一个Excel工作簿
  2231. for(var key in devIDList){
  2232. // var oSheet = oWB.ActiveSheet;//指定要写入内容的工作表为活动工作表
  2233. var oSheet = oWB.Sheets.Add();
  2234. var psrIDS = devIDList[key].psrName;
  2235. var psrType = devIDList[key].psrType;
  2236. oSheet.name = psrList[psrType];
  2237. for(var j=1; j<5; j++){
  2238. oSheet.Cells(1,j).NumberFormatLocal = "@";//将单元格的格式定义为文本
  2239. oSheet.Cells(1,j).Font.Bold = true;//加粗
  2240. oSheet.Cells(1,j).Font.Size = 12;//字体大小
  2241. oSheet.Cells(1,j).value = excelTitle[j.toString()];//向单元格写入值
  2242. oSheet.Cells(1,j).Borders.Weight = 2;
  2243. oSheet.Cells(1,j).HorizontalAlignment = 3;//水平对齐方式枚举* (1-常规,2-靠左,3-居中,4-靠右,5-填充 6-两端对齐,7-跨列居中,8-分散对齐)
  2244. // oSheet.Cells(1,j).VerticalAlignment = 2;//垂直对齐方式枚举*(1-靠上,2-居中,3-靠下,4-两端对齐,5-分散对齐)
  2245. oSheet.Cells(1,j).ColumnWidth = 22;
  2246. // oSheet.Cells(1,j).RowHeight = 18;
  2247. };
  2248. for(var i=0; i<psrIDS.length; i++){
  2249. for(var j=1; j<5; j++){
  2250. oSheet.Cells(i+2,j).NumberFormatLocal = "@";//将单元格的格式定义为文本
  2251. oSheet.Cells(i+2,j).Font.Size = 10;//字体大小
  2252. if(j==3){
  2253. oSheet.Cells(i+2,j).value = psrIDS[i];//向单元格写入值
  2254. }else{
  2255. oSheet.Cells(i+2,j).value = "";//向单元格写入值
  2256. };
  2257. oSheet.Cells(i+2,j).Borders.Weight = 2;
  2258. oSheet.Cells(i+2,j).HorizontalAlignment = 3;//水平对齐方式枚举* (1-常规,2-靠左,3-居中,4-靠右,5-填充 6-两端对齐,7-跨列居中,8-分散对齐)
  2259. // oSheet.Cells(i+2,j).VerticalAlignment = 2;//垂直对齐方式枚举*(1-靠上,2-居中,3-靠下,4-两端对齐,5-分散对齐)
  2260. oSheet.Cells(i+2,j).ColumnWidth = 22;
  2261. oSheet.Cells(i+2,j).RowHeight = 12;
  2262. };
  2263. };
  2264. };
  2265. oXL.Visible = true;
  2266. $("#leftceladows").hideLoading();
  2267. $("#expor_tool").animate({ width: "0" }, 1000);
  2268. // if(ai.createExporAlert()){
  2269. // ==
  2270. // }
  2271. if(flag){
  2272. var fname;
  2273. try {
  2274. fname = oXL.Application.GetSaveAsFilename("受台风影响设备列表.xls", "Excel Spreadsheets (*.xls), *.xls");
  2275. } catch (e) { print("导出失败! " + e);
  2276. } finally {
  2277. oWB.SaveAs(fname);
  2278. oWB.Close(savechanges = false);
  2279. oXL.Quit();
  2280. oXL = null;
  2281. // idTmr = window.setInterval("Cleanup();", 1);
  2282. }
  2283. return true;
  2284. }else{
  2285. //alert("取消");
  2286. return false;
  2287. }
  2288. oXL.UserControl = true;
  2289. oXL=null;
  2290. };
  2291. /*-----------------------------------导出Excel end-----------------------------------------------------------------*/
  2292. this.expor_word = function(exporWord,flag){
  2293. $("#leftceladows").showLoading();
  2294. var WordFile = new ActiveXObject("Word.Application");
  2295. WordFile.Application.Visible = true;
  2296. WordFile.Application.Documents.Add();
  2297. WordFile.Selection.PageSetup.LeftMargin = 50;
  2298. WordFile.Selection.PageSetup.RightMargin = 50;
  2299. WordFile.Selection.ParagraphFormat.Alignment = 1; //对齐方式 0:左对齐 1:居中 2:右对齐
  2300. WordFile.Selection.Font.size = 32;
  2301. WordFile.Selection.Font.Bold = true; //打开粗体
  2302. WordFile.Selection.Font.Name = "楷体_GB2312";
  2303. WordFile.Selection.Font.ColorIndex = 6;// 1:黑色 2:蓝色 3:豆沙绿 4:翠绿 5:紫 6:红色
  2304. WordFile.Selection.TypeText ("电 网 受 影 响 情 况");
  2305. WordFile.Selection.TypeParagraph ();
  2306. WordFile.Selection.ParagraphFormat.Alignment = 0; //对齐方式
  2307. WordFile.Selection.Font.ColorIndex = 1;
  2308. WordFile.Selection.Font.size = 16;
  2309. WordFile.Selection.Font.Bold = false; //关闭粗体
  2310. WordFile.Selection.Font.Name = "黑体";
  2311. for(var key in exporWord){
  2312. WordFile.Selection.TypeText (" " + exporWord[key]);
  2313. WordFile.Selection.TypeParagraph ();
  2314. };
  2315. WordFile.Application.WindowState = 1;
  2316. WordFile.Application.Visible = true;
  2317. $("#leftceladows").hideLoading();
  2318. $("#expor_word_tool").animate({ width: "0" }, 1000);
  2319. if(flag){
  2320. var fname;
  2321. try {
  2322. // fname = WordFile.Application.SaveAs("受台风影响设备.doc", "Word Spreadsheets (*.doc), *.doc");
  2323. } catch (e) { print("导出失败! " + e);
  2324. } finally {
  2325. WordFile.Application.SaveAs("受台风影响设备.doc");
  2326. WordFile.Application.Close(savechanges = false);
  2327. WordFile.Quit();
  2328. WordFile = null;
  2329. // idTmr = window.setInterval("Cleanup();", 1);
  2330. }
  2331. return true;
  2332. }else{ return false; }
  2333. WordFile = null;
  2334. };
  2335. /*-----------------------------------导出Excel end-----------------------------------------------------------------*/
  2336. this.getWordText = function(devIDList){
  2337. var textArr = [];
  2338. for(var key in devIDList){
  2339. textArr.push(psrList[devIDList[key].psrType] + ":"+ devIDList[key].psrIDS.length);
  2340. };
  2341. return textArr;
  2342. };
  2343. /**
  2344. * 信息填写错误,气泡提示
  2345. */
  2346. this.valid = function($dom,str){
  2347. $($dom).css({"border": "1px solid red"});
  2348. var offset = $($dom).offset();
  2349. $($dom).attr("valid",false);
  2350. $($dom).bind("mouseover",function(){
  2351. var $bubbox = document.createElement("div");
  2352. $bubbox.id = "bubbox";
  2353. $("body").append($bubbox);
  2354. $("#bubbox").addClass("bubble-box").css({"left":offset.left,"top":offset.top-$("#bubbox").height()});
  2355. $($bubbox).append("<span class='test'>* " + str + "</span>");
  2356. });
  2357. $($dom).bind("mouseout",function(){
  2358. $("#bubbox").remove();
  2359. });
  2360. };
  2361. /**
  2362. * 信息填写正确,解除气泡提示
  2363. */
  2364. this.unvalid = function($dom){
  2365. $($dom).attr("valid",true);
  2366. $($dom).unbind("mouseover");
  2367. $($dom).unbind("mouseout");
  2368. $($dom).css({"border":"none"});
  2369. };
  2370. /*-----------------------------------气泡提示信息 end-----------------------------------------------------------------*/
  2371. /*---------------------------------加载图层----------------------------------------------------------*/
  2372. /**
  2373. * @param 根据获取的每一个ID去加载图层
  2374. * @version 1.0
  2375. * @Date 2015-09-26
  2376. */
  2377. this.loadlayer = function(menuID){
  2378. if(tokens==null || pasrids==null){
  2379. // ai.setMes(320, 186, 200, 500, "系统提示", "请您登录地图后在使用");
  2380. // ai.createAlert();
  2381. return false;
  2382. }else{
  2383. switch(menuID){
  2384. //日常气象 图层
  2385. case "11":
  2386. Dailyweather(true);
  2387. return true;
  2388. //台风图层
  2389. case "12":
  2390. Typhoon(true);
  2391. return true;
  2392. //台风模拟路径
  2393. case "121":
  2394. _this.drawTyphoonPathInit();
  2395. return true;
  2396. //历史模拟台风
  2397. case "122":
  2398. historyTyphoonSearch();
  2399. _this.historyTyphoonPathInit();
  2400. return true;
  2401. //暴雨图层
  2402. case "13":
  2403. // Rainstorm();
  2404. ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
  2405. ai.createAlert();
  2406. return false ;
  2407. //冰灾图层
  2408. case "14":
  2409. // IceDamage();
  2410. ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
  2411. ai.createAlert();
  2412. return false ;
  2413. //应急预警与响应
  2414. case "21":
  2415. _this.ewerLay_init();
  2416. return true ;
  2417. //应急资源图层
  2418. case "41":
  2419. ai.addSummaryIframe();
  2420. _this.ersoLay_init();
  2421. return true ;
  2422. //应急资源队伍分布
  2423. case "413":
  2424. _this.er_team_init();
  2425. _this.searchErTeam(userInfo.dept_id,"0");
  2426. return true ;
  2427. //应急资源发电车分布
  2428. case "414":
  2429. _this.er_car_init();
  2430. _this.searchErCar(userInfo.dept_id,"0");
  2431. return true ;
  2432. //应急资源发电机分布
  2433. case "415":
  2434. _this.er_gen_init();
  2435. _this.searchErGen(userInfo.dept_id,"0");
  2436. return true ;
  2437. //应急资临时安置点分布
  2438. case "416":
  2439. _this.er_place_init();
  2440. _this.searchErPlace(userInfo.dept_id,"18,19,20,21","0");
  2441. return true ;
  2442. //应急资源仓库分布
  2443. case "417":
  2444. _this.er_house_init();
  2445. _this.searchErHouse({hb:"A",ht:"1",hl:"1",gt:"1,2,3,4,5,6"});
  2446. return true ;
  2447. //应急资源分布
  2448. case "410":
  2449. _this.ersoLay_er_dist_init();
  2450. _this.searchErDist("261,262,381",userInfo.dept_id,"18,19,20,21","0");
  2451. return true ;
  2452. //应急资源投入
  2453. case "411":
  2454. // var paramsProv ;
  2455. // var paramsPref ;
  2456. // var date = allGetServerTime() ;
  2457. // var beginTime = _this.getThreeMonthsAgo(_this.getNowFormatDate(date)) ;
  2458. // var endTime = _this.getNowFormatDate(allGetServerTime()) ;
  2459. //
  2460. // paramsProv = {classid : 265, unitId : subDept["prov"]+"", startDate : beginTime, endDate : endTime} ;
  2461. // paramsPref = {classid : 265, unitId : subDept["pref"]+"", startDate : beginTime, endDate : endTime} ;
  2462. //
  2463. // _this.ersoPut(paramsProv, paramsPref);
  2464. var inicID = $("#inic").attr("relValue") ;
  2465. _this.searchDrawByUserInfo(inicID) ;
  2466. return true ;
  2467. //绘图工具
  2468. case "412":
  2469. locationPosition();
  2470. return true ;
  2471. //应急队伍列表
  2472. case "423":
  2473. return true ;
  2474. case "61":
  2475. // EquipmentLoss();
  2476. ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
  2477. ai.createAlert();
  2478. return false ;
  2479. //用户停电图层
  2480. case "71":
  2481. // UserOutage();
  2482. ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
  2483. ai.createAlert();
  2484. return false ;
  2485. //电网资源工具图层
  2486. case "81":
  2487. return true ;
  2488. }
  2489. }
  2490. };
  2491. /*---------------------------------------------------------------删除图层---------------------------------------------*/
  2492. /**
  2493. * @param 根据获取的每一个ID删除
  2494. * @version 1.0
  2495. * @Date 2015-09-28
  2496. */
  2497. this.removeallmarkers = function(id){
  2498. switch(id){
  2499. //日常气象 图层
  2500. case "11":
  2501. Dailyweather(false);
  2502. break ;
  2503. //台风图层
  2504. case "12":
  2505. Typhoon(false);
  2506. break ;
  2507. case "121":
  2508. _this.closeDrawTyphoonPath();
  2509. return true;
  2510. //历史模拟台风
  2511. case "122":
  2512. _this.delHistoryLay();
  2513. removeHistoryTyphoonWin();
  2514. break;
  2515. //暴雨图层
  2516. case "13":
  2517. //alert("删除13");
  2518. break ;
  2519. //冰灾图层
  2520. case "14":
  2521. //alert("删除14");
  2522. break ;
  2523. //地震图层
  2524. case "15":
  2525. //alert("删除15");
  2526. break ;
  2527. //山火图层
  2528. case "16":
  2529. //alert("删除16");
  2530. break ;
  2531. //应急预警与响应图层
  2532. case "21":
  2533. _this.closeEwerLayer();
  2534. break ;
  2535. //应急资源图层
  2536. case "41":
  2537. $("#gisMes").remove();
  2538. _this.closeErsource();
  2539. // var idArr = ["DuiWuHuiZongZt","DuiWuRenYuanHuiZongZt","FaDianJiHuiZongZt","FaDianCheHuiZongZt","TeamChar","EduiChar","alertChar"];
  2540. var idArr = ["alertChar"];
  2541. _this.delChartWin(idArr);
  2542. removeDrawWin();
  2543. break ;
  2544. //应急资源队伍分布
  2545. case "413":
  2546. _this.closeErTeam();
  2547. break ;
  2548. //应急资源发电车分布
  2549. case "414":
  2550. _this.closeErCar();
  2551. break ;
  2552. //应急资源发电车分布
  2553. case "415":
  2554. _this.closeErGen();
  2555. break ;
  2556. //应急资源发电车分布
  2557. case "416":
  2558. _this.closeErPlace();
  2559. break ;
  2560. case "417":
  2561. delLayer(erso_lay_so.name) ;
  2562. break ;
  2563. case "410":
  2564. _this.closeErDist();
  2565. // var idArr = ["DuiWuHuiZongZt","DuiWuRenYuanHuiZongZt","FaDianJiHuiZongZt","FaDianCheHuiZongZt","TeamChar","EduiChar","alertChar"];
  2566. var idArr = ["alertChar"];
  2567. _this.delChartWin(idArr);
  2568. removeDrawWin();
  2569. break ;
  2570. //绘图工具
  2571. case "411":
  2572. delLayer(erso_lay_show.name);
  2573. delLayer(erso_lay_draw.name);
  2574. return true ;
  2575. //应急队伍列表
  2576. case "412":
  2577. _this.closeTeam();
  2578. return true ;
  2579. //设备损失图层
  2580. case "61":
  2581. break ;
  2582. //用户停电图层
  2583. case "71":
  2584. break ;
  2585. }
  2586. };
  2587. /*-------------------------------各图层所需要的图层名返回 start----------------------------------------*/
  2588. /**
  2589. * 得到绘制台风添加红点出现图层信息,5-17级显示
  2590. */
  2591. this.getDtpLayPoint = function(){ return dtp_lay_point; };
  2592. /**
  2593. * 得到绘制台风添加折线图层信息,5-17级显示
  2594. */
  2595. this.getDtpLayLine = function(){ return dtp_lay_line; };
  2596. /**
  2597. * 得到绘制台风添加七级风圈图层信息,5-17级显示
  2598. */
  2599. this.getDtpLaySevenCircle = function(){ return dtp_lay_seven_circle; };
  2600. /**
  2601. * 得到绘制台风添加十级风圈图层信息,5-17级显示
  2602. */
  2603. this.getDtpLayTenCircle = function(){ return dtp_lay_ten_circle; };
  2604. /**
  2605. * 得到绘制台风添加十二级风圈图层信息,5-17级显示
  2606. */
  2607. this.getDtpLayTwelveCircle = function(){ return dtp_lay_twelve_circle; };
  2608. /**
  2609. * 得到绘制历史模拟台风Marker点出现图层信息,5-17级显示
  2610. */
  2611. this.getHdtpLayPoint = function(){ return hdtp_lay_point; };
  2612. /**
  2613. * 得到绘制历史模拟台风折线图层信息,5-17级显示
  2614. */
  2615. this.getHdtpLayLine = function(){ return hdtp_lay_line; };
  2616. /**
  2617. * 得到绘制历史模拟台风添加七级风圈图层信息,5-17级显示
  2618. */
  2619. this.getHdtpLaySevenCircle = function(){ return hdtp_lay_seven_circle; };
  2620. /**
  2621. * 得到绘制历史模拟台风添加十级风圈图层信息,5-17级显示
  2622. */
  2623. this.getHdtpLayTenCircle = function(){ return hdtp_lay_ten_circle; };
  2624. /**
  2625. * 得到绘制历史模拟台风添加十二级风圈图层信息,5-17级显示
  2626. */
  2627. this.getHdtpLayTwelveCircle = function(){ return hdtp_lay_twelve_circle; };
  2628. /**
  2629. * 应急预警与响应图标,网省级图层4-6级显示
  2630. */
  2631. this.getEwerLayProv = function(){ return ewer_lay_prov; };
  2632. /**
  2633. * 应急预警与响应图标,网省级图层7-14级显示
  2634. */
  2635. this.getEwerLayPref = function(){ return ewer_lay_pref; };
  2636. /**
  2637. * 应急资源手绘图层
  2638. */
  2639. this.getDrawValue = function(){ return draw_value; };
  2640. /**
  2641. * 绘图图层手绘添加图层
  2642. */
  2643. this.getDrawLay = function(){ return erso_lay_draw; };
  2644. /**
  2645. * 绘图图层查看图层
  2646. */
  2647. this.getShowLay = function(){ return erso_lay_show; };
  2648. /**
  2649. * 线类型
  2650. * l_draw:手绘线样式
  2651. * l_row:路径折线样式
  2652. * l_track:轨迹回放线样式
  2653. * l_dis:轨迹描述线样式
  2654. */
  2655. this.getLineStyle = function(){
  2656. var lsd = {l_draw:lineStyleDraw,l_row:lineStyleRow,l_track:lineStyleTrack,l_dis:lineStyleDis};
  2657. return lsd;
  2658. };
  2659. /**
  2660. * 队伍定位图层
  2661. */
  2662. this.getErsoLayTeam = function(){ return erso_lay_team; };
  2663. /**
  2664. * 队伍描述轨迹
  2665. */
  2666. this.getErsoLayTrack = function(){ return erso_lay_track; };
  2667. /**
  2668. * 得到队伍轨迹回放图层信息
  2669. */
  2670. this.getErsoTeamPlayback = function(){ return erso_team_playback; };
  2671. /*-------------------------------各图层所需要的图层名返回 end----------------------------------------*/
  2672. /*-------------------------------设置返回各图层的定位坐标组 start----------------------------------------*/
  2673. /**
  2674. * 应急预警与响应图层的定位坐标组
  2675. */
  2676. this.getEwerMz = function(){ return mz_ewer; };
  2677. /**
  2678. * 设置应急预警与响应图层的定位坐标组
  2679. */
  2680. this.setEwerMz = function(posXY){ mz_ewer = posXY; };
  2681. /**
  2682. * 应急资源图层的定位坐标组
  2683. */
  2684. this.getErMz = function(){ return mz_er; };
  2685. /**
  2686. * 设置应急资源图层的定位坐标组
  2687. */
  2688. this.setErMz = function(posXY){ mz_er = posXY; };
  2689. /**
  2690. * 应急资源的临时场所图标
  2691. */
  2692. this.getTempSpace = function(){return erso_temp_space_dist; };
  2693. /*-------------------------------设置返回各图层的定位坐标组 end----------------------------------------*/
  2694. /*-------------------------------设置返回各图层的定位坐标组 start----------------------------------------*/
  2695. /**
  2696. * 当前部门字符串格式数据返回
  2697. */
  2698. this.getDeptId = function(){ return deptId; };
  2699. /**
  2700. * 当前部门字符串格式数据设置
  2701. */
  2702. this.setDeptId = function(params){ deptId = params; };
  2703. /**
  2704. * 返回路径,用于Marker点添加用
  2705. */
  2706. this.getGisIconPath = function(){ return pathIcon; };
  2707. /*-------------------------------设置返回各图层的定位坐标组 end----------------------------------------*/
  2708. /*-------------------------------设置返回系统用户信息 start----------------------------------------*/
  2709. /**
  2710. * 登录用户信息数据返回
  2711. */
  2712. this.getUserInfo = function(){ return userInfo; };
  2713. /**
  2714. * 登录用户信息数据设置
  2715. */
  2716. this.setUserInfo = function(params){ userInfo = params; };
  2717. /**
  2718. * 登录用户信息数据返回
  2719. */
  2720. this.getSubDept = function(){ return subDept; };
  2721. /**
  2722. * 登录用户信息数据设置
  2723. */
  2724. this.setSubDept = function(params){ subDept = params; };
  2725. /*-------------------------------设置返回系统用户信息 end----------------------------------------*/
  2726. /*-------------------------------返回资源标注信息 start----------------------------------------*/
  2727. /**
  2728. * 应急资源地市级资源标注图标信息返回erFlagPref
  2729. */
  2730. this.getErFlagPref = function(){ return erFlagPref; };
  2731. /**
  2732. * 应急资源网省级资源标注图标信息返回erFlagProv
  2733. */
  2734. this.getErFlagProv = function(){ return erFlagProv; };
  2735. /**
  2736. * 设置应急资源地市级资源标注图标信息erFlagPref
  2737. */
  2738. this.setErFlagPref = function(params){ erFlagPref = params; };
  2739. /**
  2740. * 设置应急资源网省级资源标注图标信息erFlagProv
  2741. */
  2742. this.setErFlagProv = function(params){ erFlagProv = params; };
  2743. /*-------------------------------返回资源标注信息 end----------------------------------------*/
  2744. /*-------------------------------返回图标信息 start----------------------------------------*/
  2745. /**
  2746. * 返回图标名称
  2747. * ads:地点图标
  2748. * team:队伍图标
  2749. * startAds:地点图标
  2750. */
  2751. this.getIcons = function(){
  2752. return {ads:pathIcon + "adslabel.png",team:pathIcon + "team.png", startAds:pathIcon + "ads_start.png"} ;
  2753. };
  2754. /*-------------------------------返回图标信息 end----------------------------------------*/
  2755. /*-------------------------------设置得到队伍信息 start----------------------------------------*/
  2756. /**
  2757. * 得到队伍信息(应急资源绘图时保存)
  2758. */
  2759. this.getTeamInfo = function(){
  2760. return teamInfo ;
  2761. };
  2762. /**
  2763. * 设置队伍信息(应急资源绘图时保存)
  2764. */
  2765. this.setTeamInfo = function(params){
  2766. teamInfo = params ;
  2767. };
  2768. /*-------------------------------设置得到队伍信息 end----------------------------------------*/
  2769. /**
  2770. * 得到模拟台风路顺利计数
  2771. */
  2772. this.getPi = function(){ return _this.pi ; };
  2773. /**
  2774. * 设置模拟台风路径计数
  2775. */
  2776. this.setPi = function(params){ _this.pi = params ; };
  2777. /**
  2778. * 重置模拟台风路径计数及点位置记录数组
  2779. */
  2780. this.resPisp = function(){
  2781. _this.pi = 0;
  2782. _this.simulationPoint = [];
  2783. };
  2784. /**
  2785. * 模拟台风路径计数加1
  2786. */
  2787. this.piPlusOne = function(){ _this.pi++; };
  2788. /**
  2789. * 台风模拟路径点数组添加
  2790. */
  2791. this.addSimulationPoint = function(param){ _this.simulationPoint.push(param); };
  2792. /**
  2793. * 返回台风模拟路径点数组
  2794. */
  2795. this.getSimulationPoint = function(){ return _this.simulationPoint; };
  2796. /**
  2797. * 返回模拟台风绘制给Style
  2798. */
  2799. this.getSimulineStyle = function(){ return lineStyleSimulation; };
  2800. /**
  2801. * 返回模拟台风绘制线的颜色JSON
  2802. * 1:热带低压(绿色)
  2803. * 2:热带风暴(黄色)
  2804. * 3:强热带风暴(橙色)
  2805. * 4:台风(红色)
  2806. * 5:强台风(粉色)
  2807. * 6:超强台风(紫色)
  2808. */
  2809. this.getSimuColor = function(){ return simulationColor; };
  2810. /**
  2811. * 返回模拟台风点图标,与线颜色对应
  2812. */
  2813. this.getSimuMark = function(){ return simulationMarker; };
  2814. /**
  2815. * 设置模拟台风MarkID用于填写完信息后修改用
  2816. */
  2817. this.setSimuUpdateMark = function(param){ _this.simuMarkerId = param; };
  2818. /**
  2819. * 返回模拟台风MarkID用于修改
  2820. */
  2821. this.getSimuUpdateMark = function(){ return _this.simuMarkerId; };
  2822. /**
  2823. * 返回模拟台风风力等级,用于模拟台风的marker提示用
  2824. */
  2825. this.getSimuStrength = function(){ return simulationStrength; };
  2826. /**
  2827. * 添加模拟台风绘制Marker点ID
  2828. */
  2829. this.addSimuMarker = function(param){_this.simuMarker.push(param); };
  2830. /**
  2831. * 添加模拟台风绘制线ID
  2832. */
  2833. this.addSimuLine = function(param){ _this.simuLine.push(param); };
  2834. /**
  2835. * 得到当前模拟台风的MarkerID以及LineID
  2836. */
  2837. this.getSimuCurrentID = function(){ return {markerID:_this.simuMarker,lineID:_this.simuLine}; };
  2838. this.resetSimCurrent = function(){
  2839. _this.simuMarker = [];
  2840. _this.simuLine = [];
  2841. };
  2842. /**
  2843. * 得到模拟台风风圈圆数据
  2844. */
  2845. this.getSimuCircleStyle = function(){ return simulationCircle; };
  2846. /**
  2847. * 反回台风模拟路径生成时的setTimeout数组
  2848. */
  2849. this.getSetTimeoutArr = function(){ return stArr; };
  2850. /**
  2851. * 返回应急资源网省级发电车装备图层数据
  2852. */
  2853. this.getErEduiLay = function(){ return erso_car_dist; };
  2854. /**
  2855. * 返回应急资源网省级发电机装备图层数据
  2856. */
  2857. this.getErEduiDynamoLay = function(){ return erso_dynamo_dist; };
  2858. /**
  2859. * 返回应急资源网省级队伍图层数据
  2860. */
  2861. this.getErTeamLay = function(){ return erso_team_dist; };
  2862. /**
  2863. * 返回应急资源地市级发电车图层数据
  2864. */
  2865. this.getEduiCarPrevLay = function(){ return erso_car_dist_prev; };
  2866. /**
  2867. * 返回应急资源地市级发电机图层数据
  2868. */
  2869. this.getEduiDynamoPrevLay = function(){ return erso_dynamo_dist_prev; };
  2870. /**
  2871. * 返回应急资源地市级队伍图层数据
  2872. */
  2873. this.getErTeamPrevLay = function(){ return erso_team_dist_prev; };
  2874. /**
  2875. * 返回仓库图层数据
  2876. */
  2877. this.getErHouse = function(){ return erso_lay_so; };
  2878. /**
  2879. * 设置设备类型电压等级kV
  2880. */
  2881. this.setPsrList = function(psrLayerInfoList){
  2882. for(var key in psrLayerInfoList){
  2883. var psrKey = psrLayerInfoList[key].LayerID;
  2884. var psrVal = psrLayerInfoList[key].LayerName;
  2885. psrList[psrKey] = psrVal;
  2886. };
  2887. };
  2888. this.getPsrList = function(){ return psrList; };
  2889. this.getGisLengen = function(){
  2890. var res = [gisLengen[0]];
  2891. for(var i = 0; i < gisLengen.length; i++){
  2892. var repeat = false;
  2893. for(var j = 0; j < res.length; j++){
  2894. if(gisLengen[i].name == res[j].name){
  2895. repeat = true;
  2896. break;
  2897. }
  2898. }
  2899. if(!repeat) res.push(gisLengen[i]);
  2900. };
  2901. return res;
  2902. };
  2903. this.getErGisLengen = function(){
  2904. return erLengen;
  2905. };
  2906. };
  2907. /* ========================================================地图辅助工具类结束==================================================*/