AddLayer.js 94 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104
  1. import {myBridge,previewMapBridge} from "./map";
  2. import {getProxyToken, getServiceToken} from "@/service/service-apply";
  3. const buildingLayerList = ['三维白膜','全市售后公房','保障房白膜'] //地表普通白膜列表
  4. const undergroundBuildingLayerList = [
  5. '地下构筑物(三维)','地下管点-嘉定','地下管点-奉贤','地下管点-宝山',
  6. '地下管点-崇明','地下管点-徐汇','地下管点-普陀','地下管点-杨浦',
  7. '地下管点-松江','地下管点-浦东','地下管点-虹口','地下管点-金山',
  8. '地下管点-长宁','地下管点-闵行','地下管点-青浦','地下管点-静安',
  9. '地下管点-黄浦','地下管线-嘉定','地下管线-奉贤','地下管线-宝山',
  10. '地下管线-崇明','地下管线-徐汇','地下管线-普陀','地下管线-杨浦',
  11. '地下管线-松江','地下管线-浦东','地下管线-虹口','地下管线-金山',
  12. '地下管线-长宁','地下管线-闵行','地下管线-青浦','地下管线-静安',
  13. '地下管线-黄浦', '地铁区间', '高架(地上,梁柱路面)', '高架(地下,承台桩基)',
  14. '地质模型(除崇明区)','水文地质模型(除崇明区)','①0吹填土','⑿粉质粘土',
  15. '⑧粉质粘土','⑥粉质粘土','⑤3粉质粘土','⑤2砂质粉土','⑾粉细砂','⑨粉细砂',
  16. '⑦1砂质粉土','⑤1粉质粘土','③3淤泥质粘性土','①3新近沉积土(江滩土)','⑩粉质粘土','⑦2粉砂',
  17. '④2粉砂','④1淤泥质粘土','③2粉砂','③1淤泥质粘性土','②3砂质粉土','②1粉质粘土',
  18. '①1填土'
  19. ]
  20. //地下白膜列表
  21. const Object3DLayerList = [
  22. '外环内精模交通_路面',
  23. '外环内精模_场地','外环内_建筑','外环内精模_其他','外环内精模_设施','外环内精模交通_无路面',
  24. '外环内精模_水面','外环内精模_植被'
  25. ] //地下白膜列表
  26. const BIMLayerList = [
  27. '外环地质',
  28. '春塔路900弄保障房_2C','春塔路900弄保障房_3C_PC模型','春塔路900弄保障房_3C_幕墙模型','春塔路900弄保障房_3C_建筑模型','春塔路900弄保障房_3C_结构模型',
  29. '春塔路900弄保障房_1C_幕墙模型','春塔路900弄保障房_1C_建筑模型','春塔路900弄保障房_1C_排水模型','春塔路900弄保障房_1C_暖通模型','春塔路900弄保障房_1C_电模型','春塔路900弄保障房_1C_结构模型',
  30. '春塔路900弄保障房_4C_幕墙模型','春塔路900弄保障房_4C_建筑模型','春塔路900弄保障房_4C_结构模型','春塔路900弄保障房_5C_幕墙模型','春塔路900弄保障房_5C_建筑模型','春塔路900弄保障房_5C_结构模型',
  31. '朱家角车站'
  32. ] //地下白膜列表
  33. const subLayerList = [
  34. '物业小区','小区绿化'
  35. ] //地下白膜列表
  36. const underHeight = { //下沉高度
  37. mode:"absolute-height",
  38. offset:-3.5
  39. }
  40. const overHeight = { //下沉高度
  41. mode:"absolute-height",
  42. offset:2
  43. }
  44. const underStationHeight = { //下沉高度
  45. mode:"absolute-height",
  46. offset:-19.5
  47. }
  48. //获取
  49. function getPipeRenderer(object) {
  50. let originRender = {
  51. type: "unique-value",
  52. field: "TypeName",
  53. defaultSymbol: getPipeSymbol(""),
  54. uniqueValueInfos: [{
  55. value: "电力",
  56. symbol: getPipeSymbol("电力")
  57. }, {
  58. value: "通信",
  59. symbol: getPipeSymbol("通信")
  60. }, {
  61. value: "给水",
  62. symbol: getPipeSymbol("给水")
  63. }, {
  64. value: "排水",
  65. symbol: getPipeSymbol("排水")
  66. }, {
  67. value: "燃气",
  68. symbol: getPipeSymbol("燃气")
  69. }, {
  70. value: "热力",
  71. symbol: getPipeSymbol("热力")
  72. }, {
  73. value: "工业",
  74. symbol: getPipeSymbol("工业")
  75. }, {
  76. value: "其它",
  77. symbol: getPipeSymbol("其它")
  78. },{
  79. value: "其它",
  80. symbol: getPipeSymbol("其它")
  81. }, {
  82. value: "长输管线",
  83. symbol: getPipeSymbol("长输管线")
  84. }]
  85. };
  86. if(object){
  87. originRender.uniqueValueInfos.forEach((item)=>{
  88. if(object.TypeName == item.value){
  89. item.symbol.symbolLayers[0].edges.color = object.borderColor;
  90. item.symbol.symbolLayers[0].material.color = object.bgColor;
  91. }
  92. })
  93. }
  94. return originRender
  95. }
  96. //获取Symbol
  97. function getPipeSymbol(type) {
  98. return {
  99. type: "mesh-3d",
  100. symbolLayers: [{
  101. type: "fill",
  102. material: {
  103. color: getPipeColor(type)
  104. },
  105. edges: {
  106. type: "solid",
  107. color: [0,0,0]
  108. }
  109. }]
  110. };
  111. }
  112. // 测试,管线,符号
  113. function getPipeColor(type) {
  114. switch (type) {
  115. case "电力": return [255,0,0];
  116. case "通信": return [0,255,0];
  117. case "给水": return [0,0,255];
  118. case "排水": return [153,0,0];
  119. case "燃气": return [255, 0, 255];
  120. case "热力": return [255, 102, 0];
  121. case "工业": return [113, 113, 113];
  122. case "其它":
  123. case "长输管线":
  124. default:
  125. return [178, 178, 178];
  126. }
  127. }
  128. //获取
  129. function getPipeRendererDark(object) {
  130. let originRender = {
  131. type: "unique-value",
  132. field: "TypeName",
  133. defaultSymbol: getPipeSymbolDark(""),
  134. uniqueValueInfos: [{
  135. value: "电力",
  136. symbol: getPipeSymbolDark("电力")
  137. }, {
  138. value: "通信",
  139. symbol: getPipeSymbolDark("通信")
  140. }, {
  141. value: "给水",
  142. symbol: getPipeSymbolDark("给水")
  143. }, {
  144. value: "排水",
  145. symbol: getPipeSymbolDark("排水")
  146. }, {
  147. value: "燃气",
  148. symbol: getPipeSymbolDark("燃气")
  149. }, {
  150. value: "热力",
  151. symbol: getPipeSymbolDark("热力")
  152. }, {
  153. value: "工业",
  154. symbol: getPipeSymbolDark("工业")
  155. }, {
  156. value: "其它",
  157. symbol: getPipeSymbolDark("其它")
  158. },{
  159. value: "其它",
  160. symbol: getPipeSymbolDark("其它")
  161. }, {
  162. value: "长输管线",
  163. symbol: getPipeSymbolDark("长输管线")
  164. }]
  165. };
  166. if(object){
  167. originRender.uniqueValueInfos.forEach((item)=>{
  168. if(object.TypeName == item.value){
  169. item.symbol.symbolLayers[0].edges.color = object.borderColor;
  170. item.symbol.symbolLayers[0].material.color = object.bgColor;
  171. }
  172. })
  173. }
  174. return originRender
  175. }
  176. //获取Symbol
  177. function getPipeSymbolDark(type) {
  178. return {
  179. type: "mesh-3d",
  180. symbolLayers: [{
  181. type: "fill",
  182. material: {
  183. color: getPipeColorDrak(type)
  184. },
  185. edges: {
  186. type: "solid",
  187. color: [0,0,0]
  188. }
  189. }]
  190. };
  191. }
  192. // 测试,管线,符号
  193. function getPipeColorDrak(type) {
  194. const darken = (color, factor = 0.1) => color.map(c => Math.floor(c * factor));
  195. switch (type) {
  196. case "电力": return darken([255,0,0]);
  197. case "通信": return darken([0,255,0]);
  198. case "给水": return darken([0,0,255]);
  199. case "排水": return darken([153,0,0]);
  200. case "燃气": return darken([255, 0, 255]);
  201. case "热力": return darken([255, 102, 0]);
  202. case "工业": return darken([113, 113, 113]);
  203. case "其它":
  204. case "长输管线":
  205. default:
  206. return darken([178, 178, 178]);
  207. }
  208. }
  209. // 白膜颜色配置
  210. const locationRenderer = {
  211. type: "simple",
  212. symbol: {
  213. type: "mesh-3d",
  214. symbolLayers: [{
  215. type: "fill",
  216. material: {
  217. color: [255, 255, 255, 0.7],
  218. colorMixMode: "tint"
  219. },
  220. edges: {
  221. type: 'solid',
  222. color: [0, 0, 0, 0.8],
  223. size: 1
  224. }
  225. }]
  226. }
  227. };
  228. // 高架颜色配置
  229. const locationRenderer_GJ = {
  230. type: "simple",
  231. symbol: {
  232. type: "mesh-3d",
  233. symbolLayers: [{
  234. type: "fill",
  235. material: {
  236. color: [255, 239, 213, 1],
  237. colorMixMode: "tint"
  238. },
  239. edges: {
  240. type: 'solid',
  241. color: [255, 239, 213, 1],
  242. size: 1
  243. }
  244. }]
  245. }
  246. };
  247. // 桩基颜色配置
  248. const locationRenderer_ZJ = {
  249. type: "simple",
  250. symbol: {
  251. type: "mesh-3d",
  252. symbolLayers: [{
  253. type: "fill",
  254. material: {
  255. color: [255, 239, 213, 1],
  256. colorMixMode: "tint"
  257. },
  258. edges: {
  259. type: 'solid',
  260. color: [255, 239, 213, 1],
  261. size: 1
  262. }
  263. }]
  264. }
  265. };
  266. export function invokeParams(ActionName, params) {
  267. getServiceToken().then(res =>{
  268. let token = res.msg[0].Rows[0].token;
  269. myBridge.bridgeContent.Invoke({
  270. 'ActionName': ActionName,
  271. "Parameters": {
  272. token: token,
  273. ...params
  274. }
  275. })
  276. })
  277. }
  278. //地图预览的时候地图方法
  279. export function previewInvokeParams(ActionName, params) {
  280. getServiceToken().then(res =>{
  281. let token = res.msg[0].Rows[0].token;
  282. previewMapBridge.bridgeContent.Invoke({
  283. 'ActionName': ActionName,
  284. "Parameters": {
  285. token: token,
  286. ...params
  287. }
  288. })
  289. })
  290. }
  291. async function returnProxyUrl(url){
  292. let arr = url.split('/');
  293. let username = '';
  294. let password = '';
  295. if(arr.indexOf('MapProxyApi') !== -1){ //不需要授权服务
  296. for(let i=0;i<arr.length;i++){
  297. if(arr[i] ==='getSceneServer'){
  298. username = arr[i+1];
  299. password = arr[i+2];
  300. const response = await getProxyToken(username,password);
  301. if(response.length > 0){
  302. arr.splice(i-1, 4);
  303. return arr.join('/')+'/MapServiceProxy/'+response;
  304. }
  305. }
  306. }
  307. }else{
  308. return url
  309. }
  310. }
  311. export function AddPreviewSingleLayer(params){
  312. if(params.token){
  313. params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
  314. }
  315. let wkid = "0" // 0 代表上海城建 1:代表3857
  316. if(params.wkid){
  317. if(params.type == "动态地图" && params.wkid =="1"){
  318. params.type = "dynamic"
  319. }
  320. if(params.type == "切片地图" && params.wkid =="1"){
  321. params.type = "tile"
  322. }
  323. }
  324. if(params.type=="scene"){
  325. previewInvokeParams('AddSingleLayer', {
  326. "id": params.id,
  327. "title": params.title,
  328. "visible": params.visible,
  329. "opacity": 1,
  330. "url": params.url,
  331. "type": "scene",
  332. "mapID": params.mapID
  333. })
  334. }
  335. else if(params.type=="dynamic"){
  336. previewInvokeParams('AddSingleLayer', {
  337. "id": params.id,
  338. "title": params.title,
  339. "visible": params.visible,
  340. "opacity": 1,
  341. "url": params.url,
  342. "sublayers": [
  343. {
  344. "id": 0
  345. }
  346. ],
  347. "type": "dynamic",
  348. "mapID": params.mapID
  349. })
  350. }
  351. else if(params.type=="tile"){
  352. previewInvokeParams('AddSingleLayer', {
  353. "id": params.id,
  354. "title": params.title,
  355. "visible": params.visible,
  356. "opacity": 1,
  357. "url": params.url,
  358. "type": "tile",
  359. "mapID": params.mapID
  360. })
  361. }else if(params.type=="动态地图"){
  362. previewInvokeParams('AddSingleLayer', {
  363. "id": params.id,
  364. "title": params.title,
  365. "visible": params.visible,
  366. "opacity": params.opacity === undefined?1:params.opacity,
  367. "url": params.url,
  368. "type": "shc_map",
  369. "mapID": params.mapID
  370. })
  371. }else if(params.type=="切片地图"){
  372. let size = [256,256];
  373. let origin = {
  374. "x": -9080400.0,
  375. "y": 10002300
  376. };
  377. switch (params.title) {
  378. case '公众地图':
  379. previewInvokeParams('AddSingleLayer',
  380. {
  381. "id": params.id,
  382. "title": params.title,
  383. "visible": params.visible,
  384. "opacity": 1,
  385. "url": params.url,
  386. "type": "shc_tile_old",
  387. "size": size,
  388. "chy_token": "m_token",
  389. "mapID": params.mapID
  390. })
  391. break;
  392. case '晒衣架':
  393. case '公共绿地':
  394. case '无障碍设施':
  395. case '桥孔停车场':
  396. case '桥孔道班房':
  397. case '小区绿化':
  398. case '基础路网(切片)':
  399. previewInvokeParams('AddSingleLayer',
  400. {
  401. "id": params.id,
  402. "title": params.title,
  403. "visible": params.visible,
  404. "opacity": 1,
  405. "url": params.url,
  406. "type": "shc_tile",
  407. "size": size,
  408. "origin": origin,
  409. "mapID": params.mapID
  410. })
  411. break;
  412. case '1979航空影像':
  413. case '2006航空影像':
  414. case '2015航空影像':
  415. case '1994航空影像':
  416. case '1948航空影像':
  417. case '政务地图':
  418. case '政务地图_简易地形':
  419. previewInvokeParams('AddSingleLayer',
  420. {
  421. "id": params.id,
  422. "title": params.title,
  423. "visible": params.visible,
  424. "opacity": params.opacity === undefined?1:params.opacity,
  425. "url": params.url,
  426. "type": "shc_tile",
  427. "chy_token": "m_token"
  428. })
  429. break;
  430. default:
  431. previewInvokeParams('AddSingleLayer',
  432. {
  433. "id": params.id,
  434. "title": params.title,
  435. "visible": params.visible,
  436. "opacity": params.opacity === undefined?1:params.opacity,
  437. "url": params.url,
  438. "type": "shc_tile",
  439. "mapID": params.mapID
  440. })
  441. break;
  442. }
  443. }
  444. }
  445. export function clearPreviewAllLayerMap() {
  446. previewInvokeParams("ClearMapLayers",{
  447. "mapID": "map"
  448. })
  449. }
  450. export function MapPreviewClickAll(){
  451. previewInvokeParams('MapClickAll', {
  452. "status": "show",
  453. "popup": "show",
  454. "disableLayerIdList":[],
  455. })
  456. }
  457. //点查询
  458. export function MapClickByType(status){
  459. invokeParams('MapClickAll', {
  460. "status": status,
  461. "popup": "show",
  462. "disableLayerIdList":["districtArea","districtStreet",'T8101L',
  463. 'T8102L',
  464. 'T8103L',
  465. 'T8104L',
  466. 'T8105L']
  467. })
  468. }
  469. //点查询
  470. export function ChangeBaseMapOpacity(params){
  471. invokeParams('ChangeBaseMapOpacity', {
  472. "opacity": params.opacity,
  473. })
  474. }
  475. export function AddCimPartWhiteMoldLayer(visible) {
  476. invokeParams('AddSingleLayer', {
  477. "id": "cimPartWhiteMold",
  478. "title": "cimPartWhiteMold",
  479. "visible": visible,
  480. "opacity": 1,
  481. "renderer":locationRenderer,
  482. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/75364509",
  483. "type": "scene",
  484. })
  485. }
  486. export function AddWhiteMoldLayer(visible){
  487. invokeParams('AddSingleLayer', {
  488. "id": "whiteMold",
  489. "title": "白模",
  490. "visible": visible,
  491. "opacity": 0.55,
  492. "renderer":locationRenderer,
  493. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/05195418",
  494. "definitionExpression": 'objectId not in (3067829,3068449,3066018,3067835,3069644,3064784,3067833,3069032,3066632,3065418,3068433,3069646,3068445,3064787,3069036,3066022,3064633,3067831)',
  495. "type": "scene",
  496. })
  497. invokeParams('AddSingleLayer', {
  498. "id": "cimPartWhiteMold",
  499. "title": "地下构筑物",
  500. "visible": visible,
  501. "opacity": 1,
  502. "renderer":locationRenderer,
  503. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/75364509",
  504. "type": "scene",
  505. })
  506. invokeParams('AddSingleLayer', {
  507. "id": "underWhiteMold",
  508. "title": "地下管线",
  509. "visible": visible,
  510. "opacity": 1,
  511. "elevationInfo":underHeight,
  512. "renderer":getPipeRenderer(),
  513. "url": "https://10.81.73.76/server/rest/services/Hosted/buildingug/SceneServer/layers/0",
  514. "type": "scene",
  515. })
  516. }
  517. export async function AddSinglePreviewLayer(params) {
  518. if(params.token && Object3DLayerList.indexOf(params.title) < 0){
  519. params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
  520. if(undergroundBuildingLayerList.indexOf(params.title) > -1){
  521. params.url = params.url + "/SceneServer";
  522. console.log(params.url)
  523. }
  524. }
  525. let wkid = "0" // 0 代表上海城建 1:代表3857
  526. if(params.wkid){
  527. if(params.type == "动态地图" && params.wkid =="1"){
  528. params.type = "dynamic"
  529. }
  530. if(params.type == "切片地图" && params.wkid =="1"){
  531. params.type = "tile"
  532. }
  533. }
  534. if (params.type == "scene" || params.type == '3DObject') {
  535. switch (params.id) {
  536. case "whiteMold":
  537. previewInvokeParams('AddSingleLayer', {
  538. "id": params.id,
  539. "title": params.title,
  540. "visible": params.visible,
  541. "opacity": params.opacity === undefined ? 1 : params.opacity,
  542. "url": params.url,
  543. "type": "scene",
  544. "renderer": locationRenderer,
  545. "mapID": params.mapID
  546. })
  547. break;
  548. default:
  549. previewInvokeParams('AddSingleLayer', {
  550. "id": params.id,
  551. "title": params.title,
  552. "visible": params.visible,
  553. "opacity": params.opacity === undefined ? 1 : params.opacity,
  554. "url": params.url,
  555. "type": "scene",
  556. "mapID": params.mapID
  557. })
  558. break;
  559. }
  560. } else if (params.type == "bim") {
  561. switch (params.title) {
  562. case '朱家角车站':
  563. previewInvokeParams('AddSingleLayer',
  564. {
  565. "id": params.id,
  566. "title": params.title,
  567. "visible": params.visible,
  568. "opacity": params.opacity === undefined ? 1 : params.opacity,
  569. "url": params.url,
  570. "elevationInfo": { //下沉高度
  571. mode: "absolute-height",
  572. offset: -19.5
  573. },
  574. "type": "building",
  575. "mapID": params.mapID
  576. })
  577. break;
  578. default:
  579. previewInvokeParams('AddSingleLayer',
  580. {
  581. "id": params.id,
  582. "title": params.title,
  583. "visible": params.visible,
  584. "opacity": params.opacity === undefined ? 1 : params.opacity,
  585. "url": params.url,
  586. "type": "building",
  587. "mapID": params.mapID
  588. })
  589. break
  590. }
  591. } else if (params.type == 'mesh') {
  592. previewInvokeParams('AddSingleLayer',
  593. {
  594. "id": params.id,
  595. "title": params.title,
  596. "visible": params.visible,
  597. "opacity": params.opacity === undefined ? 1 : params.opacity,
  598. "url": params.url,
  599. //"renderer":locationRenderer,
  600. "type": "mesh",
  601. "mapID": params.mapID
  602. })
  603. return
  604. } else if (params.type == "dynamic") {
  605. previewInvokeParams('AddSingleLayer', {
  606. "id": params.id,
  607. "title": params.title,
  608. "visible": params.visible,
  609. "opacity": params.opacity === undefined ? 1 : params.opacity,
  610. "url": params.url,
  611. "sublayers": [
  612. {
  613. "id": 0
  614. }
  615. ],
  616. "type": "dynamic",
  617. "mapID": params.mapID
  618. })
  619. } else if (params.type == "tile") {
  620. previewInvokeParams('AddSingleLayer', {
  621. "id": params.id,
  622. "title": params.title,
  623. "visible": params.visible,
  624. "opacity": params.opacity === undefined ? 1 : params.opacity,
  625. "url": params.url,
  626. "type": "tile",
  627. "mapID": params.mapID
  628. })
  629. } else if (params.type == "动态地图") {
  630. if (buildingLayerList.indexOf(params.title) > -1) { //building 3DObject
  631. previewInvokeParams('AddSingleLayer', {
  632. "id": params.id,
  633. "title": params.title,
  634. "visible": params.visible,
  635. "opacity": params.opacity === undefined ? 1 : params.opacity,
  636. "url": params.url,
  637. "type": "scene",
  638. "mapID": params.mapID
  639. })
  640. } else if (BIMLayerList.indexOf(params.title) > -1) { //BIM
  641. switch (params.title) {
  642. case '朱家角车站':
  643. previewInvokeParams('AddSingleLayer',
  644. {
  645. "id": params.id,
  646. "title": params.title,
  647. "visible": params.visible,
  648. "opacity": params.opacity === undefined ? 1 : params.opacity,
  649. "url": params.url,
  650. "elevationInfo": { //下沉高度
  651. mode: "absolute-height",
  652. offset: -19.5
  653. },
  654. "type": "building",
  655. "mapID": params.mapID
  656. })
  657. break;
  658. default:
  659. previewInvokeParams('AddSingleLayer',
  660. {
  661. "id": params.id,
  662. "title": params.title,
  663. "visible": params.visible,
  664. "opacity": params.opacity === undefined ? 1 : params.opacity,
  665. "url": params.url,
  666. "type": "building",
  667. "mapID": params.mapID
  668. })
  669. break;
  670. }
  671. } else if (undergroundBuildingLayerList.indexOf(params.title) > -1) { //地下构筑物
  672. switch (params.title) {
  673. case '高架(地上,梁柱路面)': //地下桩基render设置
  674. previewInvokeParams('AddSingleLayer', {
  675. "id": params.id,
  676. "title": params.title,
  677. "visible": params.visible,
  678. "opacity": params.opacity === undefined ? 1 : params.opacity,
  679. "url": params.url,
  680. "elevationInfo": underHeight,
  681. "renderer": locationRenderer_GJ,
  682. "type": "scene",
  683. "mapID": params.mapID
  684. })
  685. break;
  686. case '高架(地下,承台桩基)': //地下桩基render设置
  687. previewInvokeParams('AddSingleLayer', {
  688. "id": params.id,
  689. "title": params.title,
  690. "visible": params.visible,
  691. "opacity": params.opacity === undefined ? 1 : params.opacity,
  692. "url": params.url,
  693. "elevationInfo": underHeight,
  694. "renderer": locationRenderer_ZJ,
  695. "type": "scene",
  696. "mapID": params.mapID
  697. })
  698. break;
  699. default:
  700. previewInvokeParams('AddSingleLayer', {
  701. "id": params.id,
  702. "title": params.title,
  703. "visible": params.visible,
  704. "opacity": params.opacity === undefined ? 1 : params.opacity,
  705. "url": params.url,
  706. "elevationInfo": underHeight,
  707. "renderer": getPipeRenderer(),
  708. "type": "scene",
  709. "mapID": params.mapID
  710. })
  711. break;
  712. }
  713. } else {
  714. previewInvokeParams('AddSingleLayer', {
  715. "id": params.id,
  716. "title": params.title,
  717. "visible": params.visible,
  718. "opacity": params.opacity === undefined ? 1 : params.opacity,
  719. "url": params.url,
  720. "type": "shc_map",
  721. "mapID": params.mapID
  722. })
  723. }
  724. } else if (params.type == "切片地图") {
  725. let size = [256, 256];
  726. let origin = {
  727. "x": -9080400.0,
  728. "y": 10002300
  729. };
  730. switch (params.title) {
  731. case '公众地图':
  732. previewInvokeParams('AddSingleLayer',
  733. {
  734. "id": params.id,
  735. "title": params.title,
  736. "visible": params.visible,
  737. "opacity": params.opacity === undefined ? 1 : params.opacity,
  738. "url": params.url,
  739. "type": "shc_tile_old",
  740. "size": size,
  741. "chy_token": "m_token",
  742. "mapID": params.mapID
  743. })
  744. break;
  745. case '晒衣架':
  746. case '公共绿地':
  747. case '无障碍设施':
  748. case '桥孔停车场':
  749. case '桥孔道班房':
  750. case '小区绿化':
  751. case '基础路网(切片)':
  752. previewInvokeParams('AddSingleLayer',
  753. {
  754. "id": params.id,
  755. "title": params.title,
  756. "visible": params.visible,
  757. "opacity": params.opacity === undefined ? 1 : params.opacity,
  758. "url": params.url,
  759. "type": "shc_tile",
  760. "size": size,
  761. "origin": origin,
  762. "mapID": params.mapID
  763. })
  764. break;
  765. case '1979航空影像':
  766. case '2006航空影像':
  767. case '2015航空影像':
  768. case '1994航空影像':
  769. case '1948航空影像':
  770. case '政务地图':
  771. case '政务地图_简易地形':
  772. previewInvokeParams('AddSingleLayer',
  773. {
  774. "id": params.id,
  775. "title": params.title,
  776. "visible": params.visible,
  777. "opacity": params.opacity === undefined ? 1 : params.opacity,
  778. "url": params.url,
  779. "type": "shc_tile",
  780. "chy_token": "m_token"
  781. })
  782. break;
  783. default:
  784. previewInvokeParams('AddSingleLayer',
  785. {
  786. "id": params.id,
  787. "title": params.title,
  788. "visible": params.visible,
  789. "opacity": params.opacity === undefined ? 1 : params.opacity,
  790. "url": params.url,
  791. "type": "shc_tile",
  792. "mapID": params.mapID
  793. })
  794. break;
  795. }
  796. }
  797. }
  798. export function AddSingleLayer(params){
  799. if(params.token && Object3DLayerList.indexOf(params.title) < 0){
  800. params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
  801. if(undergroundBuildingLayerList.indexOf(params.title) > -1){
  802. params.url = params.url + "/SceneServer";
  803. console.log(params.url)
  804. }
  805. }
  806. let wkid = "0" // 0 代表上海城建 1:代表3857
  807. if(params.wkid){
  808. if(params.type == "动态地图" && params.wkid =="1"){
  809. params.type = "dynamic"
  810. }
  811. if(params.type == "切片地图" && params.wkid =="1"){
  812. params.type = "tile"
  813. }
  814. }
  815. if(params.type=="scene"||params.type=='3DObject'){
  816. switch (params.id){
  817. case "whiteMold":
  818. invokeParams('AddSingleLayer', {
  819. "id": params.id,
  820. "title": params.title,
  821. "visible": params.visible,
  822. "opacity": params.opacity === undefined?1:params.opacity,
  823. "url": params.url,
  824. "type": "scene",
  825. "renderer":locationRenderer,
  826. "definitionExpression": 'objectId not in (3067829,3068449,3066018,3067835,3069644,3064784,3067833,3069032,3066632,3065418,3068433,3069646,3068445,3064787,3069036,3066022,3064633,3067831)',
  827. "mapID": params.mapID
  828. })
  829. break;
  830. default:
  831. if(undergroundBuildingLayerList.indexOf(params.title) > -1){
  832. switch (params.title){
  833. case '高架(地上,梁柱路面)': //地下桩基render设置
  834. invokeParams('AddSingleLayer', {
  835. "id": params.id,
  836. "title": params.title,
  837. "visible": params.visible,
  838. "opacity": params.opacity === undefined?1:params.opacity,
  839. "url": params.url,
  840. "elevationInfo":underHeight,
  841. "renderer":locationRenderer_GJ,
  842. "type": "scene",
  843. "mapID": params.mapID
  844. })
  845. break;
  846. case '高架(地下,承台桩基)': //地下桩基render设置
  847. invokeParams('AddSingleLayer', {
  848. "id": params.id,
  849. "title": params.title,
  850. "visible": params.visible,
  851. "opacity": params.opacity === undefined?1:params.opacity,
  852. "url": params.url,
  853. "elevationInfo":underHeight,
  854. "renderer":locationRenderer_ZJ,
  855. "type": "scene",
  856. "mapID": params.mapID
  857. })
  858. break;
  859. default:
  860. invokeParams('AddSingleLayer', {
  861. "id": params.id,
  862. "title": params.title,
  863. "visible": params.visible,
  864. "opacity": params.opacity === undefined?1:params.opacity,
  865. "url": params.url,
  866. "elevationInfo":underHeight,
  867. "renderer":getPipeRenderer(),
  868. "type": "scene",
  869. "mapID": params.mapID
  870. })
  871. break;
  872. }
  873. }else{
  874. invokeParams('AddSingleLayer', {
  875. "id": params.id,
  876. "title": params.title,
  877. "visible": params.visible,
  878. "opacity": params.opacity === undefined?1:params.opacity,
  879. "url": params.url,
  880. "type": "scene",
  881. "mapID": params.mapID
  882. })
  883. }
  884. break;
  885. }
  886. }
  887. else if(params.type=="bim"){
  888. switch (params.title) {
  889. case '朱家角车站':
  890. invokeParams('AddSingleLayer',
  891. {
  892. "id": params.id,
  893. "title": params.title,
  894. "visible": params.visible,
  895. "opacity": params.opacity === undefined?1:params.opacity,
  896. "url": params.url,
  897. "elevationInfo": { //下沉高度
  898. mode:"absolute-height",
  899. offset:-19.5
  900. },
  901. "type": "building",
  902. "mapID": params.mapID
  903. })
  904. break;
  905. default:
  906. invokeParams('AddSingleLayer',
  907. {
  908. "id": params.id,
  909. "title": params.title,
  910. "visible": params.visible,
  911. "opacity": params.opacity === undefined?1:params.opacity,
  912. "url": params.url,
  913. "type": "building",
  914. "mapID": params.mapID
  915. })
  916. break
  917. }
  918. }
  919. else if(params.type=='倾斜摄影'){
  920. invokeParams('AddSingleLayer',
  921. {
  922. "id": params.id,
  923. "title": params.title,
  924. "visible": params.visible,
  925. "opacity": params.opacity === undefined?1:params.opacity,
  926. "url": params.url,
  927. //"renderer":locationRenderer,
  928. "type": "mesh",
  929. "mapID": params.mapID
  930. })
  931. return
  932. }
  933. else if(params.type=="dynamic"){
  934. if(buildingLayerList.indexOf(params.title) > -1){ //building 3DObject
  935. invokeParams('AddSingleLayer', {
  936. "id": params.id,
  937. "title": params.title,
  938. "visible": params.visible,
  939. "opacity": params.opacity === undefined?1:params.opacity,
  940. "url": params.url,
  941. "type": "scene",
  942. "mapID": params.mapID
  943. })
  944. }else if(BIMLayerList.indexOf(params.title) > -1){ //BIM
  945. switch (params.title){
  946. case '朱家角车站':
  947. invokeParams('AddSingleLayer',
  948. {
  949. "id": params.id,
  950. "title": params.title,
  951. "visible": params.visible,
  952. "opacity": params.opacity === undefined?1:params.opacity,
  953. "url": params.url,
  954. "elevationInfo": { //下沉高度
  955. mode:"absolute-height",
  956. offset:-19.5
  957. },
  958. "type": "building",
  959. "mapID": params.mapID
  960. })
  961. break;
  962. default:
  963. invokeParams('AddSingleLayer',
  964. {
  965. "id": params.id,
  966. "title": params.title,
  967. "visible": params.visible,
  968. "opacity": params.opacity === undefined?1:params.opacity,
  969. "url": params.url,
  970. "type": "building",
  971. "mapID": params.mapID
  972. })
  973. break;
  974. }
  975. }else if(undergroundBuildingLayerList.indexOf(params.title) > -1){ //地下构筑物
  976. switch (params.title){
  977. case '高架(地上,梁柱路面)': //地下桩基render设置
  978. invokeParams('AddSingleLayer', {
  979. "id": params.id,
  980. "title": params.title,
  981. "visible": params.visible,
  982. "opacity": params.opacity === undefined?1:params.opacity,
  983. "url": params.url,
  984. "elevationInfo":underHeight,
  985. "renderer":locationRenderer_GJ,
  986. "type": "scene",
  987. "mapID": params.mapID
  988. })
  989. break;
  990. case '高架(地下,承台桩基)': //地下桩基render设置
  991. invokeParams('AddSingleLayer', {
  992. "id": params.id,
  993. "title": params.title,
  994. "visible": params.visible,
  995. "opacity": params.opacity === undefined?1:params.opacity,
  996. "url": params.url,
  997. "elevationInfo":underHeight,
  998. "renderer":locationRenderer_ZJ,
  999. "type": "scene",
  1000. "mapID": params.mapID
  1001. })
  1002. break;
  1003. default:
  1004. invokeParams('AddSingleLayer', {
  1005. "id": params.id,
  1006. "title": params.title,
  1007. "visible": params.visible,
  1008. "opacity": params.opacity === undefined?1:params.opacity,
  1009. "url": params.url,
  1010. "elevationInfo":underHeight,
  1011. "renderer":getPipeRenderer(),
  1012. "type": "scene",
  1013. "mapID": params.mapID
  1014. })
  1015. break;
  1016. }
  1017. }else{
  1018. invokeParams('AddSingleLayer', {
  1019. "id": params.id,
  1020. "title": params.title,
  1021. "visible": params.visible,
  1022. "opacity": params.opacity === undefined?1:params.opacity,
  1023. "url": params.url,
  1024. "type": "dynamic",
  1025. "mapID": params.mapID
  1026. })
  1027. }
  1028. }
  1029. else if(params.type=="tile"){
  1030. invokeParams('AddSingleLayer', {
  1031. "id": params.id,
  1032. "title": params.title,
  1033. "visible": params.visible,
  1034. "opacity": params.opacity === undefined?1:params.opacity,
  1035. "url": params.url,
  1036. "type": "tile",
  1037. "mapID": params.mapID
  1038. })
  1039. }else if(params.type=="动态地图"){
  1040. if(buildingLayerList.indexOf(params.title) > -1){ //building 3DObject
  1041. invokeParams('AddSingleLayer', {
  1042. "id": params.id,
  1043. "title": params.title,
  1044. "visible": params.visible,
  1045. "opacity": params.opacity === undefined?1:params.opacity,
  1046. "url": params.url,
  1047. "type": "scene",
  1048. "mapID": params.mapID
  1049. })
  1050. }else if(BIMLayerList.indexOf(params.title) > -1){ //BIM
  1051. switch (params.title){
  1052. case '朱家角车站':
  1053. invokeParams('AddSingleLayer',
  1054. {
  1055. "id": params.id,
  1056. "title": params.title,
  1057. "visible": params.visible,
  1058. "opacity": params.opacity === undefined?1:params.opacity,
  1059. "url": params.url,
  1060. "elevationInfo": { //下沉高度
  1061. mode:"absolute-height",
  1062. offset:-19.5
  1063. },
  1064. "type": "building",
  1065. "mapID": params.mapID
  1066. })
  1067. break;
  1068. default:
  1069. invokeParams('AddSingleLayer',
  1070. {
  1071. "id": params.id,
  1072. "title": params.title,
  1073. "visible": params.visible,
  1074. "opacity": params.opacity === undefined?1:params.opacity,
  1075. "url": params.url,
  1076. "type": "building",
  1077. "mapID": params.mapID
  1078. })
  1079. break;
  1080. }
  1081. }else if(undergroundBuildingLayerList.indexOf(params.title) > -1){ //地下构筑物
  1082. switch (params.title){
  1083. case '高架(地上,梁柱路面)': //地下桩基render设置
  1084. invokeParams('AddSingleLayer', {
  1085. "id": params.id,
  1086. "title": params.title,
  1087. "visible": params.visible,
  1088. "opacity": params.opacity === undefined?1:params.opacity,
  1089. "url": params.url,
  1090. "elevationInfo":underHeight,
  1091. "renderer":locationRenderer_GJ,
  1092. "type": "scene",
  1093. "mapID": params.mapID
  1094. })
  1095. break;
  1096. case '高架(地下,承台桩基)': //地下桩基render设置
  1097. invokeParams('AddSingleLayer', {
  1098. "id": params.id,
  1099. "title": params.title,
  1100. "visible": params.visible,
  1101. "opacity": params.opacity === undefined?1:params.opacity,
  1102. "url": params.url,
  1103. "elevationInfo":underHeight,
  1104. "renderer":locationRenderer_ZJ,
  1105. "type": "scene",
  1106. "mapID": params.mapID
  1107. })
  1108. break;
  1109. default:
  1110. invokeParams('AddSingleLayer', {
  1111. "id": params.id,
  1112. "title": params.title,
  1113. "visible": params.visible,
  1114. "opacity": params.opacity === undefined?1:params.opacity,
  1115. "url": params.url,
  1116. "elevationInfo":underHeight,
  1117. "renderer":getPipeRenderer(),
  1118. "type": "scene",
  1119. "mapID": params.mapID
  1120. })
  1121. break;
  1122. }
  1123. }else{
  1124. invokeParams('AddSingleLayer', {
  1125. "id": params.id,
  1126. "title": params.title,
  1127. "visible": params.visible,
  1128. "opacity": params.opacity === undefined?1:params.opacity,
  1129. "url": params.url,
  1130. "type": "shc_map",
  1131. "mapID": params.mapID
  1132. })
  1133. }
  1134. }else if(params.type=="切片地图"){
  1135. let size = [256,256];
  1136. let origin = {
  1137. "x": -9080400.0,
  1138. "y": 10002300
  1139. };
  1140. switch (params.title) {
  1141. case '晒衣架':
  1142. case '公共绿地':
  1143. case '无障碍设施':
  1144. case '桥孔停车场':
  1145. case '桥孔道班房':
  1146. case '小区绿化':
  1147. case '基础路网(切片)':
  1148. invokeParams('AddSingleLayer',
  1149. {
  1150. "id": params.id,
  1151. "title": params.title,
  1152. "visible": params.visible,
  1153. "opacity": params.opacity === undefined?1:params.opacity,
  1154. "url": params.url,
  1155. "type": "shc_tile",
  1156. "size": size,
  1157. "origin": origin,
  1158. "mapID": params.mapID
  1159. })
  1160. break;
  1161. case '1979航空影像':
  1162. case '2006航空影像':
  1163. case '2015航空影像':
  1164. case '1994航空影像':
  1165. case '1948航空影像':
  1166. case '政务地图':
  1167. case '政务地图_简易地形':
  1168. invokeParams('AddSingleLayer',
  1169. {
  1170. "id": params.id,
  1171. "title": params.title,
  1172. "visible": params.visible,
  1173. "opacity": params.opacity === undefined?1:params.opacity,
  1174. "url": params.url,
  1175. "type": "shc_tile",
  1176. "chy_token": "m_token"
  1177. })
  1178. break;
  1179. default:
  1180. invokeParams('AddSingleLayer',
  1181. {
  1182. "id": params.id,
  1183. "title": params.title,
  1184. "visible": params.visible,
  1185. "opacity": params.opacity === undefined?1:params.opacity,
  1186. "url": params.url,
  1187. "type": "shc_tile",
  1188. "mapID": params.mapID
  1189. })
  1190. break;
  1191. }
  1192. }
  1193. }
  1194. export function setLocation(params){
  1195. invokeParams('SetLocation', {
  1196. "heading": params.heading == undefined?0:params.heading,
  1197. "tilt": params.tilt == undefined?0:params.tilt,
  1198. "x": params.x,
  1199. "y": params.y,
  1200. "z": params.z == undefined?100:params.z,
  1201. "isfly": true,
  1202. })
  1203. }
  1204. export function drawGraphic(positionGeometry){
  1205. invokeParams('DrawGraphic', {
  1206. "type":"point",
  1207. "geometry":positionGeometry,
  1208. "id": "singlePoint",
  1209. "is_clear": true,
  1210. })
  1211. }
  1212. export function upDateLayerRender(params){
  1213. invokeParams('UpDateLayerRender', {
  1214. "status":params.status,
  1215. "renderer": {
  1216. "type": "simple",
  1217. "symbol":params.symbol
  1218. },
  1219. })
  1220. }
  1221. export function drawGraphics(positionGeometry){
  1222. invokeParams('DrawGraphic', {
  1223. "type":"point",
  1224. "geometry":positionGeometry,
  1225. "symbol": {
  1226. "type": "picture-marker",
  1227. "url": "http://10.81.66.1:8080/jk_map_tool_source/hj/marker.png",
  1228. "width": "20px",
  1229. "height": "20px",
  1230. "yoffset": 10,
  1231. "xoffset": 0
  1232. },
  1233. "is_clear": false,
  1234. })
  1235. }
  1236. //画范围
  1237. export function drawByType(type,is_clear){
  1238. invokeParams('Draw',{
  1239. "type": type,
  1240. "is_clear":is_clear
  1241. })
  1242. }
  1243. //叠加分析
  1244. export function GeometryComposition(type,geometry1,geometry2){
  1245. invokeParams('GeometryComposition',{
  1246. "type": type,
  1247. "geometry1": geometry1,
  1248. "geometry2": geometry2,
  1249. "is_calculation": true,
  1250. })
  1251. }
  1252. //缓冲区分析
  1253. export function GeometryBuffer(distance,unit,geometry){
  1254. invokeParams('GeometryBuffer',{
  1255. "distance": distance,
  1256. "unit": unit,
  1257. "geometry": geometry,
  1258. "is_calculation": true,
  1259. })
  1260. }
  1261. export function ClearMap() {
  1262. invokeParams("ClearMap",{
  1263. "is_draw": true,
  1264. "is_search": true,
  1265. })
  1266. }
  1267. export function positionsToAddress(x,y){
  1268. let positionGeometry =
  1269. {
  1270. "type": "point",
  1271. "x": x,
  1272. "y": y,
  1273. "z": 0
  1274. };
  1275. drawGraphics(positionGeometry);
  1276. }
  1277. export function positionToAddress(x,y){
  1278. let positionGeometry =
  1279. {
  1280. "type": "point",
  1281. "x": x,
  1282. "y": y,
  1283. "z": 0
  1284. };
  1285. drawGraphic(positionGeometry);
  1286. setLocation({
  1287. "x": parseFloat(x),
  1288. "y": parseFloat(y)
  1289. });
  1290. }
  1291. export function addDataPoint(is_clear,data){
  1292. invokeParams('AddDataPoint',
  1293. {
  1294. "is_clear":is_clear,
  1295. "position": data,
  1296. "is_goto":true
  1297. })
  1298. }
  1299. export function addDataLine(is_clear,data){
  1300. invokeParams('AddDataLine',
  1301. {
  1302. "is_clear":is_clear,
  1303. "position": data
  1304. })
  1305. }
  1306. export function addDataArea(is_clear,data){
  1307. invokeParams('AddDataArea',
  1308. {
  1309. "is_clear":is_clear,
  1310. "position": data
  1311. })
  1312. }
  1313. export function DrawBuffers(distance,unit){
  1314. invokeParams('DrawBuffers',
  1315. {
  1316. "distances": distance,
  1317. "unit": unit,
  1318. "geometry": {},
  1319. "symbol": {}
  1320. })
  1321. }
  1322. export function QueryAreaGroupBy(queryWhere){
  1323. invokeParams('QueryAreaGroupBy',
  1324. {
  1325. "quertUrl": "http://10.81.66.1:8080/site02/rest/services/gyld/MapServer/0",
  1326. "queryWhere": queryWhere,
  1327. "groupbyField": ["A1"]
  1328. })
  1329. }
  1330. //大地图切换地图
  1331. // export async function changeMyBaseMap(title, opacity = 1) {
  1332. // debugger
  1333. // if (title == "zwdt") {
  1334. // // invokeParams('SetBackground', {
  1335. // // "opacity": 1,
  1336. // // "color": "#FFFFFF",
  1337. // // "theme": "light",
  1338. // // })
  1339. // invokeParams('AddBaseMapLayer', {
  1340. // "id": "BaseMapZhenwu",
  1341. // "title": "BaseMapZhenwu",
  1342. // "visible": true,
  1343. // "opacity": opacity,
  1344. // "type": "tile",
  1345. // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265"
  1346. // })
  1347. // } else if (title == "air") {
  1348. // // invokeParams('SetBackground', {
  1349. // // "opacity": 1,
  1350. // // "color": "#FFFFFF",
  1351. // // "theme": "light",
  1352. // // })
  1353. // invokeParams('AddBaseMapLayer', {
  1354. // "id": "BaseMapYaoGan",
  1355. // "title": "BaseMapYaoGan",
  1356. // "visible": true,
  1357. // "opacity": opacity,
  1358. // "type": "tile",
  1359. // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036"
  1360. // })
  1361. // } else if (title == "basemap") {
  1362. // // invokeParams('SetBackground', {
  1363. // // "opacity": 0.7,
  1364. // // "color": "#002F47",
  1365. // // "theme": "light",
  1366. // // })
  1367. // invokeParams('AddBaseMapLayer', {
  1368. // "id": "BaseMap",
  1369. // "title": "BaseMap",
  1370. // "visible": true,
  1371. // "opacity": opacity,
  1372. // "type": "tile",
  1373. // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321"
  1374. // })
  1375. // }
  1376. // }
  1377. let arrAllPipe = ['T8101A', 'T8101L','T8101P',
  1378. 'T8102A', 'T8102L', 'T8102P',
  1379. 'T8103L', 'T8103P',
  1380. 'T8104L', 'T8104P',
  1381. 'T8105L', 'T8105P'];
  1382. let arrPipe = ['T8101L',
  1383. 'T8102L',
  1384. 'T8103L',
  1385. 'T8104L',
  1386. 'T8105L'];
  1387. export function PipeProfileAnalysis(params){
  1388. invokeParams('PipeProfileAnalysis', {
  1389. "typename": params.typename,
  1390. "gid": params.gid
  1391. })
  1392. }
  1393. export function PipeExcavationAnalysis(params){
  1394. invokeParams('PipeExcavationAnalysis', {
  1395. "id": arrPipe,
  1396. "geometry":params.geometry,
  1397. "shendu":params.shendu
  1398. })
  1399. }
  1400. export function PipeStatisticAnalysis(params){
  1401. invokeParams('PipeStatisticAnalysis', {
  1402. "bigType": params.bigField,
  1403. "middleType": params.middleField,
  1404. "geometry": params.geometry
  1405. })
  1406. }
  1407. export function ExcavationAnalysis(params){
  1408. invokeParams('ExcavationAnalysis', {
  1409. "status":params.status,
  1410. "depth":params.shendu
  1411. })
  1412. }
  1413. export function RectangleSlice(params){
  1414. invokeParams('RectangleSlice', {
  1415. "status":params.status,
  1416. "geometry":params.geometry,
  1417. "depth":params.shendu
  1418. })
  1419. }
  1420. export function PipeAgeAnalysis(params){
  1421. invokeParams('PipeAgeAnalysis', {
  1422. "id": arrPipe,
  1423. "geometry":params.geometry
  1424. })
  1425. }
  1426. export function CylinderEffect(params){
  1427. invokeParams('CylinderEffect', {
  1428. "status": params.status,
  1429. "positions":params.positions,
  1430. "radius": params.radius,
  1431. "items": params.items
  1432. })
  1433. }
  1434. export function PrismEffect(params){
  1435. invokeParams('PrismEffect', {
  1436. "status": params.status,
  1437. "items": params.items
  1438. })
  1439. }
  1440. //原有剖切数据
  1441. export function PrismDifferentHeightEffect(params){
  1442. invokeParams('PrismDifferentHeightEffect', {
  1443. "status": params.status,
  1444. "items": params.items
  1445. })
  1446. }
  1447. //新剖切数据
  1448. export function PrismDifferentHeightSideEffect(params){
  1449. invokeParams('PrismDifferentHeightSideEffect', {
  1450. "status": params.status,
  1451. "extent": params.extent,
  1452. "items": params.items
  1453. })
  1454. }
  1455. export function PositionSlice(params){
  1456. invokeParams('PositionSlice', {
  1457. "status": params.status,
  1458. "geometry":params.geometry
  1459. })
  1460. }
  1461. export function PipeSectionAnalysis(){
  1462. invokeParams('PipeSectionAnalysis', {
  1463. "id": arrPipe,
  1464. })
  1465. }
  1466. export function CollisionAnalysis(params){
  1467. invokeParams('PipeCollisionAnalysis', {
  1468. "id": arrPipe,
  1469. "maishen1": params.maishen1,
  1470. "maishen2": params.maishen2,
  1471. "guanjing": params.guanjing,
  1472. "color":params.color
  1473. })
  1474. }
  1475. export function CreateThreeGeometry(params){
  1476. invokeParams('CreateThreeGeometry', {
  1477. "status": params.status
  1478. })
  1479. }
  1480. export function Draw3DExtent(params){
  1481. invokeParams('Draw3DExtent', {
  1482. "status": params.status,
  1483. "height": 20,
  1484. "color":[0,255,255],
  1485. "ringsArr":params.rings
  1486. })
  1487. }
  1488. export function AddDataArea(params){
  1489. invokeParams('AddDataArea', {
  1490. "is_clear": params.status,
  1491. "position": params.position,
  1492. })
  1493. }
  1494. let lastPipeThemeVisible = null
  1495. export async function setPipeTheme(visible) {
  1496. if (visible == lastPipeThemeVisible) return
  1497. arrPipe.forEach(item => {
  1498. invokeParams('AddSingleLayer', {
  1499. "id": item,
  1500. "title": item,
  1501. "visible": visible,
  1502. "opacity": 0,
  1503. "url": "https://cimweb.zjw.sh.cegn.cn:2008/arcgis/rest/services/cim_huangpu/" + item + "/MapServer",
  1504. "type": "dynamic"
  1505. })
  1506. })
  1507. invokeParams('AddSingleLayer', {
  1508. "id": "longzhu",
  1509. "title": "地下管线-三维",
  1510. "visible": visible,
  1511. "opacity": 1,
  1512. "renderer": getPipeRenderer(),
  1513. "elevationInfo": underHeight,
  1514. //"url": 'https://10.81.73.76/server/rest/services/Hosted/cim_hp/SceneServer',
  1515. "url": await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990820240801")+'/SceneServer',
  1516. "type": "scene"
  1517. })
  1518. lastPipeThemeVisible = visible
  1519. }
  1520. export function changePipeRender(params){
  1521. invokeParams('AddSingleLayer', {
  1522. "id": "longzhu",
  1523. "visible":true,
  1524. "renderer":getPipeRenderer(params)
  1525. })
  1526. }
  1527. //设置地图控件主题色
  1528. export function changeMapTheme(theme){
  1529. invokeParams('ChangeViewType',{
  1530. theme
  1531. })
  1532. }
  1533. export function changeTestArea(area) {
  1534. invokeParams('ChangeTestArea', {
  1535. "name": area
  1536. })
  1537. }
  1538. //张江前5个
  1539. export function changeProductP(name) {
  1540. invokeParams('ChangeShowLayer', {
  1541. "name": name
  1542. })
  1543. }
  1544. //后6个
  1545. export function changeTypeP(name) {
  1546. invokeParams('ChangeShowType', {
  1547. "name": name
  1548. })
  1549. }
  1550. export function resetMap() {
  1551. invokeParams('ResetMap',{})
  1552. }
  1553. export function changeLayerFloor(floor) {
  1554. invokeParams('ChangeShowFloor', {
  1555. "floor": floor + ''
  1556. })
  1557. }
  1558. //改变地图预览的图层
  1559. export function changeMapViewTreeControl(title, visible= true,isClear,opacity= 1,parentID,mapID = '') {
  1560. invokePreviewMapParams('LayerTreeControl', {
  1561. "title": title,
  1562. "visible": visible,
  1563. "isclear":(isClear !== undefined)?isClear : true,
  1564. opacity,
  1565. parentID,
  1566. mapID
  1567. })
  1568. }
  1569. export function changeTreeControl(title, visible= true,isClear,opacity= 1,parentID,mapID = '',position = {}) {
  1570. invokeParams('LayerTreeControl', {
  1571. "title": title,
  1572. "visible": visible,
  1573. "isclear":(isClear !== undefined)?isClear : true,
  1574. position:"bottom-right",
  1575. opacity,
  1576. parentID,
  1577. mapID,
  1578. "padding": {
  1579. bottom: 0,
  1580. right:112 - 15
  1581. }
  1582. })
  1583. }
  1584. export function changeTuYuan(name){
  1585. invokeParams('ChangeShowTuyuan', {
  1586. name
  1587. })
  1588. }
  1589. export function changeEntity(name){
  1590. invokeParams('ChangeShowShiti', {
  1591. name
  1592. })
  1593. }
  1594. export function changeShowSlice(status){
  1595. invokeParams('ChangeShowSlice', {
  1596. status
  1597. })
  1598. }
  1599. export function changePosition(position,is_clear = true,is_goto){
  1600. invokeParams('Position', {
  1601. type:'point',
  1602. position,
  1603. mapz:"0",
  1604. tilt:"0",
  1605. heading:"0",
  1606. "is_clear": is_clear,
  1607. "is_goto": is_goto,
  1608. "is_draw": true
  1609. })
  1610. }
  1611. //图层
  1612. export function getLayerControlData(name,type='房屋',title="jianzhu_f"){
  1613. invokeParams('LayerCount', {
  1614. "type": type,
  1615. "title": title,
  1616. "theme": name,
  1617. "layerid": 0
  1618. })
  1619. }
  1620. let yardObj = {
  1621. hparea:{
  1622. layerid:"6",
  1623. title:"yuanluo_hp",
  1624. field:"FIRST_YD"
  1625. },
  1626. zjarea:{
  1627. layerid:"95",
  1628. title:"yuanluo",
  1629. field:"YardType"
  1630. }
  1631. }
  1632. export function getYardLayerData(qu) {
  1633. // "title":"yuanluo", _hp
  1634. // "layerid":"95", 6
  1635. // "field":'YardType' FIRST_YD
  1636. let obj = {}
  1637. if (qu === '黄浦院落'){
  1638. obj = {
  1639. layerid:"6",
  1640. title:"yuanluo_hp",
  1641. field:"FIRST_YD"
  1642. }
  1643. }else if(qu === '张江试点') {
  1644. obj = {
  1645. layerid:"95",
  1646. title:"yuanluo",
  1647. field:"YardType"
  1648. }
  1649. }
  1650. invokeParams('LayerCount', {
  1651. "field":obj.field,
  1652. "type": '院落',
  1653. "title": obj.title,
  1654. "layerid":obj.layerid,
  1655. })
  1656. }
  1657. export function forsetPieClickControl(code,isOn = true){
  1658. invokeParams('LayerControl', {
  1659. "visible": true,
  1660. "title": "zjgreen",
  1661. "opacity": 1,
  1662. "where": isOn?`FeatureCode='${code}'`:'1=1'
  1663. })
  1664. }
  1665. export function yardLayerControl(qu,code,isOn = true){
  1666. let obj = {}
  1667. if (qu === '黄浦院落'){
  1668. obj = {
  1669. layerid:"6",
  1670. title:"yuanluo_hp",
  1671. field:"FIRST_YD"
  1672. }
  1673. }else if(qu === '张江试点') {
  1674. obj = {
  1675. layerid:"95",
  1676. title:"yuanluo",
  1677. field:"YardType"
  1678. }
  1679. }
  1680. invokeParams('LayerControl', {
  1681. "visible": true,
  1682. "title": yardObj[qu].title,
  1683. "opacity": 1,
  1684. "where": isOn?`${obj.field}='${code}'`:'1=1'
  1685. })
  1686. }
  1687. export function setMapCenter(mapx,mapy){
  1688. invokeParams('SetCenter', {
  1689. mapx:mapx,
  1690. mapy:mapy,
  1691. })
  1692. }
  1693. //地图回到初始位置
  1694. export function mapLocationInit(){
  1695. invokeParams('Location', {
  1696. "x": 2614.616635477607,
  1697. "y": -3995.0735499331035,
  1698. "z": 2633.736500112477,
  1699. "heading": 0,
  1700. "tilt": 60,
  1701. "scale": 40000
  1702. })
  1703. }
  1704. //大地图罗盘回到初识方向
  1705. export function mapLocationInit2(){
  1706. invokeParams('Location', {
  1707. "heading": 0
  1708. })
  1709. }
  1710. //白模的开关
  1711. export function bmMapOperation(title,visible,opacity = 1,where = '',params = ''){
  1712. invokeParams('LayerControl', {
  1713. "title": title,
  1714. "visible":visible,
  1715. "opacity": opacity,
  1716. "where": where,
  1717. "params": params
  1718. })
  1719. }
  1720. //白模的种类
  1721. export function bmMapOperationType(title,theme){
  1722. invokeParams('SceneLayerRender', {
  1723. "title": title,
  1724. "theme":theme
  1725. })
  1726. }
  1727. //去掉地推
  1728. export function clearMapF(visible){
  1729. invokeParams('ClearBaseMap', {
  1730. "visible":visible
  1731. })
  1732. }
  1733. //透明度
  1734. export function setMapOpacity(opacity){
  1735. invokeParams('SetOpacity', {
  1736. "opacity":opacity
  1737. })
  1738. }
  1739. //图元
  1740. export function setMapTy(geometry,graphicsID){
  1741. invokeParams('LayerHighlight', {
  1742. "geometry":geometry,
  1743. "graphicsId":graphicsID,
  1744. })
  1745. }
  1746. //环视
  1747. export function setMapCircleWatch(isShow) {
  1748. invokeParams('ChangeViewFlight',{
  1749. "status": isShow?"show":'hide'
  1750. })
  1751. }
  1752. //环视-内圈
  1753. export function setMapCircleWatchInner(isShow) {
  1754. invokeParams('ChangeViewFlightCircle',{
  1755. "status": isShow?"show":'hide'
  1756. })
  1757. }
  1758. //水波特效
  1759. export function setMapWaterEffect(isShow) {
  1760. invokeParams('ChangeWaterEffect',{
  1761. "status": isShow?"show":'hide',
  1762. "direction": 260,
  1763. "strength": "moderate",
  1764. "color": "#25427c"
  1765. })
  1766. }
  1767. //双屏
  1768. export function setMapScreenSplit(isTwoScreen,num=2) {
  1769. invokeParams('ChangeSplitScreen',{
  1770. "status": isTwoScreen?"show":'hide',
  1771. "num": num
  1772. })
  1773. }
  1774. //切换2d或者3d
  1775. export function changeScene3dOr2d(is3d) {
  1776. invokeParams('ChangeViewType',{
  1777. "type": is3d?"3D":"2D"
  1778. })
  1779. }
  1780. //范围回到初始状态
  1781. export function setFullExtentMap() {
  1782. invokeParams('FullExtent',{
  1783. })
  1784. }
  1785. //人口
  1786. export function setPersonMap(type,name) {
  1787. invokeParams('ShowPopulation',{
  1788. type,
  1789. name
  1790. })
  1791. }
  1792. //关闭图层
  1793. export function clearAllLayer() {
  1794. invokeParams('ClearMapLayers',{
  1795. })
  1796. }
  1797. //全市塑膜渲染方式
  1798. export function setCitySm(theme) {
  1799. invokeParams('SceneLayerRender',{
  1800. title:'qsbm2020',
  1801. theme
  1802. })
  1803. }
  1804. //调用点查询
  1805. export function SetClickMapFun(title,type) {
  1806. invokeParams('SetMapClick',{
  1807. title,
  1808. type
  1809. })
  1810. }
  1811. //搜索实体书
  1812. export function searchAboutEntity(name,mapx,mapy) {
  1813. invokeParams("LocationBuilding",{
  1814. "title": "jianzhu",
  1815. "name": name,
  1816. "mapx": mapx,
  1817. "mapy": mapy,
  1818. "mapz":0
  1819. })
  1820. }
  1821. //测量
  1822. export function setClMap(type,is_show =true) {
  1823. invokeParams('Calculation',{
  1824. type:type,
  1825. is_show:is_show,
  1826. })
  1827. }
  1828. //测量
  1829. export function calculation3D(type,is_show=true){
  1830. invokeParams('Calculation3D',{
  1831. type:type,
  1832. status:is_show?'show':'clear',
  1833. position: 'top-right',
  1834. padding: {
  1835. right:130,
  1836. top:87
  1837. }
  1838. })
  1839. }
  1840. //船舶热力图
  1841. export function setBoatHeatmap(show,data){
  1842. invokeParams('SetBoatHeatmap',{
  1843. "show": show,
  1844. "data": data,
  1845. })
  1846. }
  1847. //船舶实时位置
  1848. export function setBoatGPS(show,data){
  1849. invokeParams('SetBoatGPS',{
  1850. "show": show,
  1851. "data": data,
  1852. })
  1853. }
  1854. //船舶历史轨迹
  1855. export function setBoatHistory(data){
  1856. invokeParams('SetBoatHistory',{
  1857. "data": data,
  1858. })
  1859. }
  1860. //播放历史轨迹
  1861. export function playBoatHistory(status){
  1862. invokeParams('PlayBoatHistory',{
  1863. "status": status,
  1864. })
  1865. }
  1866. export function refreshBoatGPS(data){
  1867. invokeParams('RefreshBoatGPS',{
  1868. "data": data,
  1869. })
  1870. }
  1871. //书签
  1872. export function setBookMarkMap(isLabelShow,right) {
  1873. let obj = !isLabelShow?{
  1874. status:isLabelShow?'show':'hide',
  1875. }:{
  1876. status:isLabelShow?'show':'hide',
  1877. "position": "top-right",
  1878. "padding": {
  1879. right:130,
  1880. top:87
  1881. }
  1882. }
  1883. invokeParams('ChangeBookmarks',obj)
  1884. }
  1885. //清空地图
  1886. export function clearMapDraw(is_draw,is_search,is_position) {
  1887. invokeParams('ClearMap',{
  1888. is_draw:is_draw,
  1889. is_search:is_search,
  1890. is_position:is_position,
  1891. // is_boat:true,
  1892. })
  1893. }
  1894. //地图的打印
  1895. export function setMapPrint(isPrint,right) {
  1896. let obj = !isPrint?{
  1897. status:isPrint?'show':'hide',
  1898. }:{
  1899. status:isPrint?'show':'hide',
  1900. "position": "top-right",
  1901. "padding": {
  1902. right:130,
  1903. top:87
  1904. }
  1905. }
  1906. invokeParams('ChangePrintMap',obj)
  1907. }
  1908. //视线分析
  1909. export function setWatchLineAny(Type,isAna,x,y,z,radius){
  1910. if(Type=='line'){
  1911. invokeParams('ChangeLineSight',{
  1912. status:isAna?'show':'hide',
  1913. })
  1914. }else if(Type=='Area'){
  1915. invokeParams('ChangeLineSight',{
  1916. status:isAna?'show':'hide',
  1917. "point": {
  1918. // "x": 3352.092000000179,
  1919. "x": x,
  1920. // "y": 5043.542199999094,
  1921. "y": y,
  1922. // "z": 50
  1923. "z": z
  1924. },
  1925. // "radius": 100,
  1926. "radius": radius,
  1927. "count": 180
  1928. })
  1929. }
  1930. }
  1931. //画点
  1932. export function drawMapPoint(type = 'point'){
  1933. invokeParams('Draw',{
  1934. type
  1935. })
  1936. }
  1937. //日照分析
  1938. export function setMapSumAna(isAna) {
  1939. invokeParams('ChangeDayLight', {
  1940. status:isAna?'show':'hide',
  1941. position: 'top-right',
  1942. padding: {
  1943. right:130,
  1944. top:87
  1945. }
  1946. })
  1947. }
  1948. //撒点
  1949. export function setMapSplitSingle(position) {
  1950. invokeParams('AddPoint',{
  1951. type:'point',
  1952. position,
  1953. is_clear:false,
  1954. is_goto:false
  1955. })
  1956. }
  1957. //三维模型分析
  1958. export function setBaiMoModel(buffer=0,title) {
  1959. invokeParams('SpatialQuery',{
  1960. // type,
  1961. buffer,
  1962. title:title
  1963. })
  1964. }
  1965. //属性查询
  1966. export function setFieldQuerySearch(id,where) {
  1967. debugger
  1968. invokeParams('QueryIn3D',{
  1969. id:id,
  1970. geometry: null,
  1971. // where:"BUILDINGNAME=中银大厦"
  1972. where:where
  1973. })
  1974. }
  1975. export function changeChosenContent(id,where) {
  1976. invokeParams('AddSingleLayer', {
  1977. "id": id,
  1978. "visible": true,
  1979. "opacity": 1,
  1980. "where":where
  1981. })
  1982. }
  1983. export function highLight_pipe(params) {
  1984. invokeParams('HighLight_pipe', {
  1985. "id": "longzhu",
  1986. "status": params.status,
  1987. "where": params.where,
  1988. "opposite_where":params.opposite_where,
  1989. "opposite_renderer":getPipeRendererDark()
  1990. })
  1991. }
  1992. //拿到属性查询的所有字段
  1993. export function getPropSearchAllFields(){
  1994. invokeParams('LayerFields',{
  1995. title:'qsbm2020'
  1996. })
  1997. }
  1998. //获取服务所有字段
  1999. export function getLayerAllFields(url){
  2000. invokeParams('LayerFieldsByUrl',{
  2001. url:url,
  2002. layerId:'0'
  2003. })
  2004. }
  2005. //拿到管线属性查询的所有字段
  2006. export function getPipePropSearchAllFields(title){
  2007. invokeParams('LayerFields',{
  2008. title:title
  2009. })
  2010. }
  2011. //画球
  2012. export function drawCircle3d(mapx,mapy,radius) {
  2013. invokeParams('Draw3D',{
  2014. title:"whiteMold",
  2015. mapx:mapx,
  2016. mapy:mapy,
  2017. radius:radius
  2018. })
  2019. }
  2020. //获取三维点 getBuildingPoint
  2021. export function getBuildingPoint(clear) {
  2022. invokeParams('GetBuildingPoint',{
  2023. "clear": clear
  2024. })
  2025. }
  2026. export function getMoreBuildingPoint(clear) {
  2027. invokeParams('GetMoreBuildingPoint',{
  2028. "clear": clear
  2029. })
  2030. }
  2031. //对白膜做筛选
  2032. export function getDefinedLayer(clear) {
  2033. invokeParams('GetDefinedLayer',{
  2034. "clear": clear
  2035. })
  2036. }
  2037. //绿地统计
  2038. export function addBufferLayer(is_clear,position_type,position_where,url) {
  2039. invokeParams('AddBufferLayer',{
  2040. "is_clear": is_clear,
  2041. "position_type": position_type,
  2042. "position_where":position_where,
  2043. "url": url
  2044. })
  2045. }
  2046. //添加居住小区面
  2047. export function addJZXQLayer(is_clear) {
  2048. invokeParams('AddJZXQLayer',{
  2049. "is_clear": is_clear,
  2050. "url":'http://10.81.66.1:8080/site03/rest/services/D3005000220170601/MapServer'
  2051. })
  2052. }
  2053. //添加绿地-切换
  2054. // export function addGreenLayer(is_clear,url) {
  2055. // invokeParams('AddGreenLayer',{
  2056. // "is_clear": is_clear,
  2057. // "url": url
  2058. // })
  2059. // }
  2060. //绿地分析
  2061. export function greenAnalysis(url1,url2,type,distance) {
  2062. invokeParams('GreenAnalysis',{
  2063. "inputLayerUrl1": url1,
  2064. "inputLayerUrl2": url2,
  2065. "type": type,
  2066. "distance": distance,
  2067. "units": "esriMeters",
  2068. "line_side": "FULL",
  2069. "line_end_type": "ROUND",
  2070. "dissolve_option": "NONE",
  2071. "dissolve_field": []
  2072. })
  2073. }
  2074. //各种类型缓冲区绘制
  2075. export function allTypeBufferAnalysis(url1,url2,type,distance,where) {
  2076. invokeParams('AllTypeBufferAnalysis',{
  2077. "inputLayerUrl1": url1,
  2078. "inputLayerUrl2": url2,
  2079. "type": type,
  2080. "distance": distance,
  2081. "units": "esriMeters",
  2082. "line_side": "FULL",
  2083. "line_end_type": "ROUND",
  2084. "dissolve_option": "NONE",
  2085. "dissolve_field": [],
  2086. "where":where
  2087. })
  2088. }
  2089. //各种类型叠加分析绘制
  2090. export function CompositionAnalysis(url1,url2,type,compositionType,where) {
  2091. invokeParams('CompositionAnalysis',{
  2092. "inputLayerUrl1": url1,
  2093. "inputLayerUrl2": url2,
  2094. "type": type,
  2095. "distance": 0.01,
  2096. "compositionType":compositionType,
  2097. "units": "esriMeters",
  2098. "line_side": "FULL",
  2099. "line_end_type": "ROUND",
  2100. "dissolve_option": "NONE",
  2101. "dissolve_field": [],
  2102. "where":where
  2103. })
  2104. }
  2105. //feature定位图片
  2106. export function positionGoToMap3d(feature) {
  2107. invokeParams('GoToMap',{
  2108. objectID:feature
  2109. })
  2110. }
  2111. //添加图层
  2112. export function addMapLayer(id,title,url) {
  2113. invokePreviewMapParams('AddLayer',
  2114. {
  2115. "id": id,
  2116. "title": title,
  2117. "visible": true,
  2118. "opacity": 1,
  2119. "url":url,
  2120. "type": "shc_map",
  2121. "token": ""
  2122. })
  2123. }
  2124. //飞行路线
  2125. // export function SetViewGoto(status,pointArr) {
  2126. // invokeParams('SetViewGoto',
  2127. // {
  2128. // "status": status?'start':'end',
  2129. // "pointArr": pointArr
  2130. // })
  2131. // }
  2132. export function SetViewGoto(status,pointArr) {
  2133. invokeParams('ViewGoTo',
  2134. {
  2135. "status": status?'show':'hide',
  2136. "pointArr": pointArr
  2137. })
  2138. }
  2139. //大地图添加图层
  2140. export function addMapLayerMap(id,type,title,url,visible = true,opacity=100,mapID='m_map') {
  2141. if(type=='3DObject'){
  2142. invokeParams('AddLayer',
  2143. {
  2144. "id": id,
  2145. "title": title,
  2146. "visible": visible,
  2147. "opacity": opacity/100,
  2148. "url":url,
  2149. //"renderer":locationRenderer,
  2150. "elevationInfo":overHeight,
  2151. "type": "scene",
  2152. "token": "",
  2153. "mapID": mapID
  2154. })
  2155. return
  2156. }
  2157. if(type=='bim'){
  2158. switch (title) {
  2159. case '朱家角车站':
  2160. invokeParams('AddLayer',
  2161. {
  2162. "id": id,
  2163. "title": title,
  2164. "visible": visible,
  2165. "opacity": opacity / 100,
  2166. "url": url,
  2167. "elevationInfo": underStationHeight,
  2168. "type": "building",
  2169. "token": "",
  2170. "mapID": mapID
  2171. })
  2172. break;
  2173. default:
  2174. invokeParams('AddLayer',
  2175. {
  2176. "id": id,
  2177. "title": title,
  2178. "visible": visible,
  2179. "opacity": opacity / 100,
  2180. "url": url,
  2181. "type": "building",
  2182. "token": "",
  2183. "mapID": mapID
  2184. })
  2185. break
  2186. }
  2187. return
  2188. }
  2189. if(type=='mesh'){
  2190. invokeParams('AddLayer',
  2191. {
  2192. "id": id,
  2193. "title": title,
  2194. "visible": visible,
  2195. "opacity": opacity/100,
  2196. "url":url,
  2197. //"renderer":locationRenderer,
  2198. "type": "mesh",
  2199. "mapID": mapID
  2200. })
  2201. return
  2202. }
  2203. if(type=='动态地图'){
  2204. if(buildingLayerList.indexOf(title) > -1){ //是否为地上构筑物
  2205. switch (title) {
  2206. case '三维白膜':
  2207. invokeParams('AddLayer',
  2208. {
  2209. "id": id,
  2210. "title": title,
  2211. "visible": visible,
  2212. "opacity": opacity/100,
  2213. "url":url,
  2214. "renderer":locationRenderer,
  2215. "type": "scene",
  2216. "token": "",
  2217. "mapID": mapID
  2218. })
  2219. break;
  2220. default:
  2221. invokeParams('AddLayer',
  2222. {
  2223. "id": id,
  2224. "title": title,
  2225. "visible": visible,
  2226. "opacity": opacity/100,
  2227. "url":url,
  2228. "type": "scene",
  2229. "token": "",
  2230. "mapID": mapID
  2231. })
  2232. break
  2233. }
  2234. }else if(BIMLayerList.indexOf(title) > -1){ //BIM 图层加载
  2235. switch (title){
  2236. case '朱家角车站':
  2237. invokeParams('AddLayer',
  2238. {
  2239. "id": id,
  2240. "title": title,
  2241. "visible": visible,
  2242. "opacity": opacity/100,
  2243. "url":url,
  2244. "elevationInfo":underStationHeight,
  2245. "type": "building",
  2246. "token": "",
  2247. "mapID": mapID
  2248. })
  2249. break;
  2250. default:
  2251. invokeParams('AddLayer',
  2252. {
  2253. "id": id,
  2254. "title": title,
  2255. "visible": visible,
  2256. "opacity": opacity/100,
  2257. "url":url,
  2258. "type": "building",
  2259. "token": "",
  2260. "mapID": mapID
  2261. })
  2262. break
  2263. }
  2264. }else if(subLayerList.indexOf(title) > -1){ // 带sublayer图层加载
  2265. invokeParams('AddLayer',
  2266. {
  2267. "id": id,
  2268. "title": title,
  2269. "visible": visible,
  2270. "opacity": opacity/100,
  2271. "url":url,
  2272. "type": "dynamic",
  2273. "sublayers": [{id:0,outFields: ["*"]}],
  2274. "token": "",
  2275. "mapID": mapID
  2276. })
  2277. } else if(undergroundBuildingLayerList.indexOf(title) > -1){ //是否为地下构筑物
  2278. // invokeParams('AddLayer',
  2279. // {
  2280. // "id": "chezhang",
  2281. // "title": "chezhang",
  2282. // "visible": true,
  2283. // "opacity": 1,
  2284. // "url":"https://10.81.73.76/server/rest/services/Hosted/zhujiajiao/SceneServer/layers/0",
  2285. // "type": "scene",
  2286. // "renderer":getPipeRenderer(),
  2287. // "token": ""
  2288. // })
  2289. switch (title) {
  2290. case '高架(地上,梁柱路面)': //地下桩基render设置
  2291. invokeParams('AddLayer',
  2292. {
  2293. "id": id,
  2294. "title": title,
  2295. "visible": visible,
  2296. "opacity": opacity/100,
  2297. "url":url,
  2298. "elevationInfo":underHeight,
  2299. "renderer":locationRenderer_GJ,
  2300. "type": "scene",
  2301. "token": "",
  2302. "mapID": mapID
  2303. })
  2304. break
  2305. case '高架(地下,承台桩基)': //地下桩基render设置
  2306. invokeParams('AddLayer',
  2307. {
  2308. "id": id,
  2309. "title": title,
  2310. "visible": visible,
  2311. "opacity": opacity/100,
  2312. "url":url,
  2313. "elevationInfo":underHeight,
  2314. "renderer":locationRenderer_ZJ,
  2315. "type": "scene",
  2316. "token": "",
  2317. "mapID": mapID
  2318. })
  2319. break
  2320. default:
  2321. invokeParams('AddLayer',
  2322. {
  2323. "id": id,
  2324. "title": title,
  2325. "visible": visible,
  2326. "opacity": opacity/100,
  2327. "url":url,
  2328. "elevationInfo":underHeight,
  2329. "renderer":getPipeRenderer(),
  2330. "type": "scene",
  2331. "token": "",
  2332. "mapID": mapID
  2333. })
  2334. break;
  2335. }
  2336. }else{ //普通动态图层加载
  2337. invokeParams('AddLayer',
  2338. {
  2339. "id": id,
  2340. "title": title,
  2341. "visible": visible,
  2342. "opacity": opacity/100,
  2343. "url":url,
  2344. "type": "shc_map",
  2345. "token": "",
  2346. "mapID": mapID
  2347. })
  2348. }
  2349. }else if(type=="切片地图"){
  2350. let size = [256,256];
  2351. let origin = {
  2352. "x": -9080400.0,
  2353. "y": 10002300
  2354. };
  2355. switch (title) {
  2356. case '公众地图':
  2357. invokeParams('AddLayer',
  2358. {
  2359. "id": id,
  2360. "title": title,
  2361. "visible": visible,
  2362. "opacity": opacity/100,
  2363. "url":url,
  2364. "type": "shc_tile",
  2365. "size": size,
  2366. "token": "",
  2367. "mapID": mapID
  2368. })
  2369. break;
  2370. case '晒衣架':
  2371. case '公共绿地':
  2372. case '无障碍设施':
  2373. case '桥孔停车场':
  2374. case '桥孔道班房':
  2375. case '小区绿化':
  2376. case '基础路网(切片)':
  2377. invokeParams('AddLayer',
  2378. {
  2379. "id": id,
  2380. "title": title,
  2381. "visible": visible,
  2382. "opacity": opacity/100,
  2383. "url":url,
  2384. "type": "shc_tile",
  2385. "size": size,
  2386. "origin": origin,
  2387. "token": "",
  2388. "mapID": mapID
  2389. })
  2390. break;
  2391. case '1979航空影像':
  2392. case '2006航空影像':
  2393. case '2015航空影像':
  2394. case '1994航空影像':
  2395. case '1948航空影像':
  2396. case '政务地图':
  2397. case '政务地图_简易地形':
  2398. case '(上半年)航空影像':
  2399. case '2008航空影像':
  2400. case '2010航空影像':
  2401. case '2011航空影像':
  2402. case '2012(上半年)航空影像':
  2403. case '2012(下半年)航空影像':
  2404. case '2013(上半年)航空影像':
  2405. case '2013(下半年)航空影像':
  2406. case '2016航空影像':
  2407. case '2017航空影像':
  2408. case '2018航空影像':
  2409. case '影像注记':
  2410. case '最新航空影像':
  2411. invokeParams('AddLayer',
  2412. {
  2413. "id": id,
  2414. "title": title,
  2415. "visible": visible,
  2416. "opacity": 1,
  2417. "url": url,
  2418. "type": "shc_tile",
  2419. "token": "m_token",
  2420. "mapID": mapID
  2421. })
  2422. break;
  2423. default:
  2424. invokeParams('AddLayer',
  2425. {
  2426. "id": id,
  2427. "title": title,
  2428. "visible": visible,
  2429. "opacity": opacity/100,
  2430. "url":url,
  2431. "type": "shc_tile",
  2432. "token": "",
  2433. "mapID": mapID
  2434. })
  2435. break;
  2436. }
  2437. }
  2438. }
  2439. //改变书签的位置
  2440. export function setWidgetPositionFun(id = 'legend',position,transition = 'none') {
  2441. invokeParams('SetWidgetPosition',{
  2442. id:id,
  2443. padding: {
  2444. right:130,
  2445. top:87
  2446. },
  2447. // transition:transition
  2448. })
  2449. }
  2450. //进入模型分析
  2451. export function modelManageAna(name,parentName,distance,units,line_side,line_end_type,dissolve_option) {
  2452. invokeParams('CreateBuffers',{
  2453. "inputLayerName":name,
  2454. "inputLayerParent": parentName,
  2455. "inputLayerUrl": "",
  2456. "distance": distance,
  2457. "units": units,
  2458. // "resultName": "result",
  2459. "line_side": line_side,
  2460. "line_end_type": line_end_type,
  2461. "dissolve_option": dissolve_option,
  2462. "dissolve_field": []
  2463. })
  2464. }
  2465. //定位
  2466. export function setMapPosition(x,y){
  2467. invokeParams('Location',{
  2468. "heading": 0,
  2469. "tilt": 60,
  2470. "x": x,
  2471. "y":y,
  2472. "z": 2633.736500112477,
  2473. "isfly": true
  2474. })
  2475. }
  2476. //重点区域定位
  2477. export function importantAreaPosition(x,y,z,heading,tilt,isfly=false){
  2478. invokeParams('SetLocation',{
  2479. "x": x,
  2480. "y": y,
  2481. "z": z,
  2482. "heading": heading,
  2483. "tilt": tilt,
  2484. "isfly": isfly
  2485. })
  2486. }
  2487. export function setExtent(params){
  2488. invokeParams('SetExtent',{
  2489. "extent": {
  2490. "spatialReference": {
  2491. "latestWkid": 3857,
  2492. "wkid": 102100
  2493. },
  2494. "xmin": params.xmin,
  2495. "ymin": params.ymin,
  2496. "xmax": params.xmax,
  2497. "ymax": params.ymax,
  2498. },
  2499. "isfly": true,
  2500. })
  2501. }
  2502. export function setGeometryLocation(params){
  2503. invokeParams('SetGeometryLocation',{
  2504. "type": params.type,
  2505. "x":params.x,
  2506. "y":params.y,
  2507. "paths":params.paths,
  2508. "rings":params.rings,
  2509. })
  2510. }
  2511. //画可视域分析俩个点
  2512. export function ViewshedLine(type,is_clear){
  2513. invokeParams('ViewshedLine',{
  2514. "type": type,
  2515. "is_clear":is_clear
  2516. })
  2517. }
  2518. export function ViewshedArea(params){
  2519. invokeParams('ViewshedArea', {
  2520. "startPoint": params.startPoint,
  2521. "endPoint": params.endPoint,
  2522. "status":params.status == undefined?"show":params.status,
  2523. "angle": params.angle,
  2524. })
  2525. }
  2526. export function LayerQuery(iayerid,where){
  2527. invokeParams('LayerQuery',{
  2528. "title": "jiezhen",
  2529. "layerid": iayerid,
  2530. "where": where,
  2531. "outFields": [
  2532. "*"
  2533. ],
  2534. "returnGeometry": true,
  2535. "is_draw": true,
  2536. "is_goto": false
  2537. })
  2538. }
  2539. export function PipeLayerTreeControl(title,visible,parentID){
  2540. invokeParams('LayerTreeControl',{
  2541. "title": title,
  2542. "opacity": 1,
  2543. "visible": visible,
  2544. "isclear": false,
  2545. "parentID": parentID
  2546. })
  2547. }
  2548. export function SetStatisticDefinition(url,layerType,type,positionWhere,layerWhere){
  2549. invokeParams('SetStatisticDefinition',{
  2550. "is_clear": true,
  2551. "layerType": layerType,
  2552. "queryUrl": url,
  2553. "type": type,
  2554. "where": positionWhere,
  2555. "queryWhere": layerWhere,
  2556. })
  2557. }
  2558. export function QuZhenQuery(layerid,where){
  2559. invokeParams('LayerQuery',{
  2560. "title": "jiezhen",
  2561. "layerid": layerid,
  2562. "where": where,
  2563. "outFields": [
  2564. "*"
  2565. ],
  2566. "returnGeometry": false
  2567. })
  2568. }
  2569. export function clearAllLayerMap(idList) {
  2570. invokeParams("ClearMapLayers",{
  2571. "idList":idList,
  2572. "mapID": "map"
  2573. })
  2574. }
  2575. export function Calculation3D(params){
  2576. invokeParams('Calculation3D', {
  2577. "status": params.status == undefined?"show":params.status,
  2578. "type": params.type,
  2579. "position": "top-right",
  2580. "padding": {
  2581. right:130,
  2582. top:87
  2583. },
  2584. })
  2585. }
  2586. export function setMapClick(viewID,mapID){
  2587. invokeParams('MapClickAll', {
  2588. status:true,
  2589. is_draw:true,
  2590. is_code:false,
  2591. viewID:viewID,
  2592. mapID:mapID
  2593. })
  2594. }
  2595. export function previewChangeSplitScreen(params){
  2596. previewInvokeParams('ChangeSplitScreen', {
  2597. "status": params.status,
  2598. "num": params.num,
  2599. "display":params.display
  2600. })
  2601. }
  2602. export function ChangeSplitScreen(params){
  2603. invokeParams('ChangeSplitScreen', {
  2604. "status": params.status,
  2605. "num": 2,
  2606. })
  2607. }
  2608. export function MapClickPreviewByType(params){
  2609. previewInvokeParams('MapClickAll', {
  2610. "status": params.status,
  2611. "viewID":params.viewID,
  2612. "disableLayerIdList":["districtArea","districtStreet"],
  2613. "mapID":params.mapID,
  2614. "clickHandleID":params.clickHandleID
  2615. })
  2616. }
  2617. export function LineSight(status){
  2618. invokeParams('LineSight', {
  2619. "status": status == undefined?"show":status,
  2620. "position": "top-right",
  2621. "padding": {
  2622. right:130,
  2623. top:87
  2624. },
  2625. })
  2626. }
  2627. export function ChangeSlowSlice(status){
  2628. invokeParams('ChangeSlowSlice', {
  2629. "status":status,
  2630. })
  2631. }
  2632. export function addBIMMQLayers(visible){
  2633. invokeParams('AddSingleLayer',
  2634. {
  2635. "id": "cim_3c_mq",
  2636. "title": "3C_幕墙模型",
  2637. "visible": visible,
  2638. "opacity": 1,
  2639. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/81489911",
  2640. "type": "building",
  2641. })
  2642. invokeParams('AddSingleLayer',
  2643. {
  2644. "id": "cim_1c_mq",
  2645. "title": "1C_幕墙模型",
  2646. "visible": visible,
  2647. "opacity": 1,
  2648. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/71262478",
  2649. "type": "building",
  2650. })
  2651. invokeParams('AddSingleLayer',
  2652. {
  2653. "id": "cim_4c_mq",
  2654. "title": "4C_幕墙模型",
  2655. "visible": visible,
  2656. "opacity": 1,
  2657. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/83660520",
  2658. "type": "building",
  2659. })
  2660. invokeParams('AddSingleLayer',
  2661. {
  2662. "id": "cim_5c_mq",
  2663. "title": "5C_幕墙模型",
  2664. "visible": visible,
  2665. "opacity": 1,
  2666. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/55485332",
  2667. "type": "building",
  2668. })
  2669. invokeParams('AddSingleLayer',
  2670. {
  2671. "id": "cim_2c",
  2672. "title": "2C",
  2673. "visible": visible,
  2674. "opacity": 1,
  2675. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/32777302",
  2676. "type": "building",
  2677. })
  2678. }
  2679. export function addBIMDETAILLayers(visible){
  2680. invokeParams('AddSingleLayer',
  2681. {
  2682. "id": "cim_3c_jz",
  2683. "title": "3C_建筑模型",
  2684. "visible": visible,
  2685. "opacity": 1,
  2686. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/92984758",
  2687. "type": "building",
  2688. })
  2689. invokeParams('AddSingleLayer',
  2690. {
  2691. "id": "cim_3c_jg",
  2692. "title": "3C_结构模型",
  2693. "visible": visible,
  2694. "opacity": 1,
  2695. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/73521993",
  2696. "type": "building",
  2697. })
  2698. invokeParams('AddSingleLayer',
  2699. {
  2700. "id": "cim_1c_jz",
  2701. "title": "1C_建筑模型",
  2702. "visible": visible,
  2703. "opacity": 1,
  2704. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/95137325",
  2705. "type": "building",
  2706. })
  2707. invokeParams('AddSingleLayer',
  2708. {
  2709. "id": "cim_1c_ps",
  2710. "title": "1C_排水模型",
  2711. "visible": visible,
  2712. "opacity": 1,
  2713. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/47631451",
  2714. "type": "building",
  2715. })
  2716. invokeParams('AddSingleLayer',
  2717. {
  2718. "id": "cim_1c_nt",
  2719. "title": "1C_暖通模型",
  2720. "visible": visible,
  2721. "opacity": 1,
  2722. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/69074922",
  2723. "type": "building",
  2724. })
  2725. invokeParams('AddSingleLayer',
  2726. {
  2727. "id": "cim_1c_d",
  2728. "title": "1C_电模型",
  2729. "visible": visible,
  2730. "opacity": 1,
  2731. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/20036147",
  2732. "type": "building",
  2733. })
  2734. invokeParams('AddSingleLayer',
  2735. {
  2736. "id": "cim_1c_jg",
  2737. "title": "1C_结构模型",
  2738. "visible": visible,
  2739. "opacity": 1,
  2740. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/69138134",
  2741. "type": "building",
  2742. })
  2743. invokeParams('AddSingleLayer',
  2744. {
  2745. "id": "cim_4c_jz",
  2746. "title": "4C_建筑模型",
  2747. "visible": visible,
  2748. "opacity": 1,
  2749. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/86895632",
  2750. "type": "building",
  2751. })
  2752. invokeParams('AddSingleLayer',
  2753. {
  2754. "id": "cim_4c_jg",
  2755. "title": "4C_结构模型",
  2756. "visible": visible,
  2757. "opacity": 1,
  2758. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/30192995",
  2759. "type": "building",
  2760. })
  2761. invokeParams('AddSingleLayer',
  2762. {
  2763. "id": "cim_5c_jz",
  2764. "title": "5C_建筑模型",
  2765. "visible": visible,
  2766. "opacity": 1,
  2767. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/07944781",
  2768. "type": "building",
  2769. })
  2770. invokeParams('AddSingleLayer',
  2771. {
  2772. "id": "cim_5c_jg",
  2773. "title": "5C_结构模型",
  2774. "visible": visible,
  2775. "opacity": 1,
  2776. "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/54350469",
  2777. "type": "building",
  2778. })
  2779. }
  2780. export async function changeBaseMap(title, opacity = 0.7) {
  2781. if (title == "zwdt") {
  2782. invokeParams('SetBackground', {
  2783. "opacity": opacity,
  2784. "color": "#FFFFFF",
  2785. "theme": "light",
  2786. })
  2787. let url1 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265")
  2788. invokeParams('AddBaseMapLayer', {
  2789. "id": "BaseMapZhenwu",
  2790. "title": "BaseMapZhenwu",
  2791. "visible": true,
  2792. "opacity": opacity,
  2793. "type": "tile",
  2794. "url": url1
  2795. })
  2796. } else if (title == "air") {
  2797. invokeParams('SetBackground', {
  2798. "opacity": opacity,
  2799. "color": "#002F47",
  2800. "theme": "light",
  2801. })
  2802. let url2 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036")
  2803. invokeParams('AddBaseMapLayer', {
  2804. "id": "BaseMapYaoGan",
  2805. "title": "BaseMapYaoGan",
  2806. "visible": true,
  2807. "opacity": opacity,
  2808. "type": "tile",
  2809. "url": url2
  2810. })
  2811. } else if (title == "basemap") {
  2812. invokeParams('SetBackground', {
  2813. "opacity": opacity,
  2814. "color": "#002F47",
  2815. "theme": "light",
  2816. })
  2817. let url3 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321")
  2818. invokeParams('AddBaseMapLayer', {
  2819. "id": "BaseMap",
  2820. "title": "BaseMap",
  2821. "visible": true,
  2822. "opacity": opacity,
  2823. "type": "tile",
  2824. "url": url3
  2825. })
  2826. }
  2827. }
  2828. export function AddZhenwuMapLayer(){
  2829. invokeParams('AddBaseMapLayer', {
  2830. "id": "BaseMapZhenwu",
  2831. "title":"BaseMapZhenwu",
  2832. "visible": true,
  2833. "opacity": 1,
  2834. "type":"tile",
  2835. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265",
  2836. })
  2837. }
  2838. export function AddYaoganMapLayer(){
  2839. invokeParams('AddBaseMapLayer', {
  2840. "id": "BaseMapYaoGan",
  2841. "title":"BaseMapYaoGan",
  2842. "visible": true,
  2843. "opacity": 1,
  2844. "type":"tile",
  2845. // "chy_token":"m_token",
  2846. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/94286922"
  2847. })
  2848. }
  2849. export function AddBaseMapLayer(){
  2850. invokeParams('AddBaseMapLayer', {
  2851. "id": "BaseMap",
  2852. "title":"BaseMap",
  2853. "visible": true,
  2854. "opacity": 1,
  2855. "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321",
  2856. })
  2857. }
  2858. export function DrawMap(params){
  2859. invokeParams('Draw', {
  2860. "type": params.type,
  2861. "clear": params.clear==undefined?true:params.clear,
  2862. "hasZ": params.hasZ,
  2863. "countNumber":params.countNumber!=undefined?params.countNumber:null
  2864. })
  2865. }
  2866. export function DrawPreviewMap(params){
  2867. previewInvokeParams('Draw', {
  2868. "type": params.type,
  2869. "clear": true,
  2870. "hasZ": params.hasZ,
  2871. "is_calculation":true,
  2872. "countNumber":params.countNumber!=undefined?params.countNumber:null
  2873. })
  2874. }
  2875. export function DataHeatMap(params){
  2876. invokeParams('DataHeatMap', {
  2877. "id": "dataHeatMapLayer",
  2878. "title": "热力图",
  2879. "visible": params.visible,
  2880. "radius": params.radius,
  2881. "data": params.data,
  2882. "fields": [
  2883. {
  2884. "name": "FID",
  2885. "type": "oid"
  2886. },
  2887. {
  2888. "name": "value",
  2889. "type": "string"
  2890. }
  2891. ],
  2892. "objectIdField": "FID",
  2893. })
  2894. }
  2895. export async function AddGreenLayer(id, url, isClear = false) {
  2896. let url2 = await returnProxyUrl(url)
  2897. invokeParams('AddThemeLayer', {
  2898. "id": id,
  2899. "is_clear": isClear,
  2900. "url": url2,
  2901. })
  2902. }
  2903. export function ChangeViewFlight(params){
  2904. invokeParams('ChangeViewFlight', {
  2905. "status": params.status,
  2906. "speed": 0.1,
  2907. "direction": 'anticlockwise'
  2908. })
  2909. }
  2910. export function ChangeViewFlightCircle(params){
  2911. invokeParams('ChangeViewFlightCircle', {
  2912. "status": params.status,
  2913. "speed": 0.1,
  2914. "direction": 'anticlockwise'
  2915. })
  2916. }
  2917. export function positionRegionP(type,where){
  2918. invokeParams('SetAreaLocation', {
  2919. "type":type,
  2920. "where": where,
  2921. })
  2922. }