12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104 |
- import {myBridge,previewMapBridge} from "./map";
- import {getProxyToken, getServiceToken} from "@/service/service-apply";
- const buildingLayerList = ['三维白膜','全市售后公房','保障房白膜'] //地表普通白膜列表
- const undergroundBuildingLayerList = [
- '地下构筑物(三维)','地下管点-嘉定','地下管点-奉贤','地下管点-宝山',
- '地下管点-崇明','地下管点-徐汇','地下管点-普陀','地下管点-杨浦',
- '地下管点-松江','地下管点-浦东','地下管点-虹口','地下管点-金山',
- '地下管点-长宁','地下管点-闵行','地下管点-青浦','地下管点-静安',
- '地下管点-黄浦','地下管线-嘉定','地下管线-奉贤','地下管线-宝山',
- '地下管线-崇明','地下管线-徐汇','地下管线-普陀','地下管线-杨浦',
- '地下管线-松江','地下管线-浦东','地下管线-虹口','地下管线-金山',
- '地下管线-长宁','地下管线-闵行','地下管线-青浦','地下管线-静安',
- '地下管线-黄浦', '地铁区间', '高架(地上,梁柱路面)', '高架(地下,承台桩基)',
- '地质模型(除崇明区)','水文地质模型(除崇明区)','①0吹填土','⑿粉质粘土',
- '⑧粉质粘土','⑥粉质粘土','⑤3粉质粘土','⑤2砂质粉土','⑾粉细砂','⑨粉细砂',
- '⑦1砂质粉土','⑤1粉质粘土','③3淤泥质粘性土','①3新近沉积土(江滩土)','⑩粉质粘土','⑦2粉砂',
- '④2粉砂','④1淤泥质粘土','③2粉砂','③1淤泥质粘性土','②3砂质粉土','②1粉质粘土',
- '①1填土'
- ]
- //地下白膜列表
- const Object3DLayerList = [
- '外环内精模交通_路面',
- '外环内精模_场地','外环内_建筑','外环内精模_其他','外环内精模_设施','外环内精模交通_无路面',
- '外环内精模_水面','外环内精模_植被'
- ] //地下白膜列表
- const BIMLayerList = [
- '外环地质',
- '春塔路900弄保障房_2C','春塔路900弄保障房_3C_PC模型','春塔路900弄保障房_3C_幕墙模型','春塔路900弄保障房_3C_建筑模型','春塔路900弄保障房_3C_结构模型',
- '春塔路900弄保障房_1C_幕墙模型','春塔路900弄保障房_1C_建筑模型','春塔路900弄保障房_1C_排水模型','春塔路900弄保障房_1C_暖通模型','春塔路900弄保障房_1C_电模型','春塔路900弄保障房_1C_结构模型',
- '春塔路900弄保障房_4C_幕墙模型','春塔路900弄保障房_4C_建筑模型','春塔路900弄保障房_4C_结构模型','春塔路900弄保障房_5C_幕墙模型','春塔路900弄保障房_5C_建筑模型','春塔路900弄保障房_5C_结构模型',
- '朱家角车站'
- ] //地下白膜列表
- const subLayerList = [
- '物业小区','小区绿化'
- ] //地下白膜列表
- const underHeight = { //下沉高度
- mode:"absolute-height",
- offset:-3.5
- }
- const overHeight = { //下沉高度
- mode:"absolute-height",
- offset:2
- }
- const underStationHeight = { //下沉高度
- mode:"absolute-height",
- offset:-19.5
- }
- //获取
- function getPipeRenderer(object) {
- let originRender = {
- type: "unique-value",
- field: "TypeName",
- defaultSymbol: getPipeSymbol(""),
- uniqueValueInfos: [{
- value: "电力",
- symbol: getPipeSymbol("电力")
- }, {
- value: "通信",
- symbol: getPipeSymbol("通信")
- }, {
- value: "给水",
- symbol: getPipeSymbol("给水")
- }, {
- value: "排水",
- symbol: getPipeSymbol("排水")
- }, {
- value: "燃气",
- symbol: getPipeSymbol("燃气")
- }, {
- value: "热力",
- symbol: getPipeSymbol("热力")
- }, {
- value: "工业",
- symbol: getPipeSymbol("工业")
- }, {
- value: "其它",
- symbol: getPipeSymbol("其它")
- },{
- value: "其它",
- symbol: getPipeSymbol("其它")
- }, {
- value: "长输管线",
- symbol: getPipeSymbol("长输管线")
- }]
- };
- if(object){
- originRender.uniqueValueInfos.forEach((item)=>{
- if(object.TypeName == item.value){
- item.symbol.symbolLayers[0].edges.color = object.borderColor;
- item.symbol.symbolLayers[0].material.color = object.bgColor;
- }
- })
- }
- return originRender
- }
- //获取Symbol
- function getPipeSymbol(type) {
- return {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: getPipeColor(type)
- },
- edges: {
- type: "solid",
- color: [0,0,0]
- }
- }]
- };
- }
- // 测试,管线,符号
- function getPipeColor(type) {
- switch (type) {
- case "电力": return [255,0,0];
- case "通信": return [0,255,0];
- case "给水": return [0,0,255];
- case "排水": return [153,0,0];
- case "燃气": return [255, 0, 255];
- case "热力": return [255, 102, 0];
- case "工业": return [113, 113, 113];
- case "其它":
- case "长输管线":
- default:
- return [178, 178, 178];
- }
- }
- //获取
- function getPipeRendererDark(object) {
- let originRender = {
- type: "unique-value",
- field: "TypeName",
- defaultSymbol: getPipeSymbolDark(""),
- uniqueValueInfos: [{
- value: "电力",
- symbol: getPipeSymbolDark("电力")
- }, {
- value: "通信",
- symbol: getPipeSymbolDark("通信")
- }, {
- value: "给水",
- symbol: getPipeSymbolDark("给水")
- }, {
- value: "排水",
- symbol: getPipeSymbolDark("排水")
- }, {
- value: "燃气",
- symbol: getPipeSymbolDark("燃气")
- }, {
- value: "热力",
- symbol: getPipeSymbolDark("热力")
- }, {
- value: "工业",
- symbol: getPipeSymbolDark("工业")
- }, {
- value: "其它",
- symbol: getPipeSymbolDark("其它")
- },{
- value: "其它",
- symbol: getPipeSymbolDark("其它")
- }, {
- value: "长输管线",
- symbol: getPipeSymbolDark("长输管线")
- }]
- };
- if(object){
- originRender.uniqueValueInfos.forEach((item)=>{
- if(object.TypeName == item.value){
- item.symbol.symbolLayers[0].edges.color = object.borderColor;
- item.symbol.symbolLayers[0].material.color = object.bgColor;
- }
- })
- }
- return originRender
- }
- //获取Symbol
- function getPipeSymbolDark(type) {
- return {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: getPipeColorDrak(type)
- },
- edges: {
- type: "solid",
- color: [0,0,0]
- }
- }]
- };
- }
- // 测试,管线,符号
- function getPipeColorDrak(type) {
- const darken = (color, factor = 0.1) => color.map(c => Math.floor(c * factor));
- switch (type) {
- case "电力": return darken([255,0,0]);
- case "通信": return darken([0,255,0]);
- case "给水": return darken([0,0,255]);
- case "排水": return darken([153,0,0]);
- case "燃气": return darken([255, 0, 255]);
- case "热力": return darken([255, 102, 0]);
- case "工业": return darken([113, 113, 113]);
- case "其它":
- case "长输管线":
- default:
- return darken([178, 178, 178]);
- }
- }
- // 白膜颜色配置
- const locationRenderer = {
- type: "simple",
- symbol: {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: [255, 255, 255, 0.7],
- colorMixMode: "tint"
- },
- edges: {
- type: 'solid',
- color: [0, 0, 0, 0.8],
- size: 1
- }
- }]
- }
- };
- // 高架颜色配置
- const locationRenderer_GJ = {
- type: "simple",
- symbol: {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: [255, 239, 213, 1],
- colorMixMode: "tint"
- },
- edges: {
- type: 'solid',
- color: [255, 239, 213, 1],
- size: 1
- }
- }]
- }
- };
- // 桩基颜色配置
- const locationRenderer_ZJ = {
- type: "simple",
- symbol: {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: [255, 239, 213, 1],
- colorMixMode: "tint"
- },
- edges: {
- type: 'solid',
- color: [255, 239, 213, 1],
- size: 1
- }
- }]
- }
- };
- export function invokeParams(ActionName, params) {
- getServiceToken().then(res =>{
- let token = res.msg[0].Rows[0].token;
- myBridge.bridgeContent.Invoke({
- 'ActionName': ActionName,
- "Parameters": {
- token: token,
- ...params
- }
- })
- })
- }
- //地图预览的时候地图方法
- export function previewInvokeParams(ActionName, params) {
- getServiceToken().then(res =>{
- let token = res.msg[0].Rows[0].token;
- previewMapBridge.bridgeContent.Invoke({
- 'ActionName': ActionName,
- "Parameters": {
- token: token,
- ...params
- }
- })
- })
- }
- async function returnProxyUrl(url){
- let arr = url.split('/');
- let username = '';
- let password = '';
- if(arr.indexOf('MapProxyApi') !== -1){ //不需要授权服务
- for(let i=0;i<arr.length;i++){
- if(arr[i] ==='getSceneServer'){
- username = arr[i+1];
- password = arr[i+2];
- const response = await getProxyToken(username,password);
- if(response.length > 0){
- arr.splice(i-1, 4);
- return arr.join('/')+'/MapServiceProxy/'+response;
- }
- }
- }
- }else{
- return url
- }
- }
- export function AddPreviewSingleLayer(params){
- if(params.token){
- params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
- }
- let wkid = "0" // 0 代表上海城建 1:代表3857
- if(params.wkid){
- if(params.type == "动态地图" && params.wkid =="1"){
- params.type = "dynamic"
- }
- if(params.type == "切片地图" && params.wkid =="1"){
- params.type = "tile"
- }
- }
- if(params.type=="scene"){
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": 1,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- }
- else if(params.type=="dynamic"){
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": 1,
- "url": params.url,
- "sublayers": [
- {
- "id": 0
- }
- ],
- "type": "dynamic",
- "mapID": params.mapID
- })
- }
- else if(params.type=="tile"){
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": 1,
- "url": params.url,
- "type": "tile",
- "mapID": params.mapID
- })
- }else if(params.type=="动态地图"){
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_map",
- "mapID": params.mapID
- })
- }else if(params.type=="切片地图"){
- let size = [256,256];
- let origin = {
- "x": -9080400.0,
- "y": 10002300
- };
- switch (params.title) {
- case '公众地图':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": 1,
- "url": params.url,
- "type": "shc_tile_old",
- "size": size,
- "chy_token": "m_token",
- "mapID": params.mapID
- })
- break;
- case '晒衣架':
- case '公共绿地':
- case '无障碍设施':
- case '桥孔停车场':
- case '桥孔道班房':
- case '小区绿化':
- case '基础路网(切片)':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": 1,
- "url": params.url,
- "type": "shc_tile",
- "size": size,
- "origin": origin,
- "mapID": params.mapID
- })
- break;
- case '1979航空影像':
- case '2006航空影像':
- case '2015航空影像':
- case '1994航空影像':
- case '1948航空影像':
- case '政务地图':
- case '政务地图_简易地形':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "chy_token": "m_token"
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "mapID": params.mapID
- })
- break;
- }
- }
- }
- export function clearPreviewAllLayerMap() {
- previewInvokeParams("ClearMapLayers",{
- "mapID": "map"
- })
- }
- export function MapPreviewClickAll(){
- previewInvokeParams('MapClickAll', {
- "status": "show",
- "popup": "show",
- "disableLayerIdList":[],
- })
- }
- //点查询
- export function MapClickByType(status){
- invokeParams('MapClickAll', {
- "status": status,
- "popup": "show",
- "disableLayerIdList":["districtArea","districtStreet",'T8101L',
- 'T8102L',
- 'T8103L',
- 'T8104L',
- 'T8105L']
- })
- }
- //点查询
- export function ChangeBaseMapOpacity(params){
- invokeParams('ChangeBaseMapOpacity', {
- "opacity": params.opacity,
- })
- }
- export function AddCimPartWhiteMoldLayer(visible) {
- invokeParams('AddSingleLayer', {
- "id": "cimPartWhiteMold",
- "title": "cimPartWhiteMold",
- "visible": visible,
- "opacity": 1,
- "renderer":locationRenderer,
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/75364509",
- "type": "scene",
- })
- }
- export function AddWhiteMoldLayer(visible){
- invokeParams('AddSingleLayer', {
- "id": "whiteMold",
- "title": "白模",
- "visible": visible,
- "opacity": 0.55,
- "renderer":locationRenderer,
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/05195418",
- "definitionExpression": 'objectId not in (3067829,3068449,3066018,3067835,3069644,3064784,3067833,3069032,3066632,3065418,3068433,3069646,3068445,3064787,3069036,3066022,3064633,3067831)',
- "type": "scene",
- })
- invokeParams('AddSingleLayer', {
- "id": "cimPartWhiteMold",
- "title": "地下构筑物",
- "visible": visible,
- "opacity": 1,
- "renderer":locationRenderer,
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/75364509",
- "type": "scene",
- })
- invokeParams('AddSingleLayer', {
- "id": "underWhiteMold",
- "title": "地下管线",
- "visible": visible,
- "opacity": 1,
- "elevationInfo":underHeight,
- "renderer":getPipeRenderer(),
- "url": "https://10.81.73.76/server/rest/services/Hosted/buildingug/SceneServer/layers/0",
- "type": "scene",
- })
- }
- export async function AddSinglePreviewLayer(params) {
- if(params.token && Object3DLayerList.indexOf(params.title) < 0){
- params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
- if(undergroundBuildingLayerList.indexOf(params.title) > -1){
- params.url = params.url + "/SceneServer";
- console.log(params.url)
- }
- }
- let wkid = "0" // 0 代表上海城建 1:代表3857
- if(params.wkid){
- if(params.type == "动态地图" && params.wkid =="1"){
- params.type = "dynamic"
- }
- if(params.type == "切片地图" && params.wkid =="1"){
- params.type = "tile"
- }
- }
- if (params.type == "scene" || params.type == '3DObject') {
- switch (params.id) {
- case "whiteMold":
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "scene",
- "renderer": locationRenderer,
- "mapID": params.mapID
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- }
- } else if (params.type == "bim") {
- switch (params.title) {
- case '朱家角车站':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "elevationInfo": { //下沉高度
- mode: "absolute-height",
- offset: -19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "building",
- "mapID": params.mapID
- })
- break
- }
- } else if (params.type == 'mesh') {
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- //"renderer":locationRenderer,
- "type": "mesh",
- "mapID": params.mapID
- })
- return
- } else if (params.type == "dynamic") {
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "sublayers": [
- {
- "id": 0
- }
- ],
- "type": "dynamic",
- "mapID": params.mapID
- })
- } else if (params.type == "tile") {
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "tile",
- "mapID": params.mapID
- })
- } else if (params.type == "动态地图") {
- if (buildingLayerList.indexOf(params.title) > -1) { //building 3DObject
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- } else if (BIMLayerList.indexOf(params.title) > -1) { //BIM
- switch (params.title) {
- case '朱家角车站':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "elevationInfo": { //下沉高度
- mode: "absolute-height",
- offset: -19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "building",
- "mapID": params.mapID
- })
- break;
- }
- } else if (undergroundBuildingLayerList.indexOf(params.title) > -1) { //地下构筑物
- switch (params.title) {
- case '高架(地上,梁柱路面)': //地下桩基render设置
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "elevationInfo": underHeight,
- "renderer": locationRenderer_GJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- case '高架(地下,承台桩基)': //地下桩基render设置
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "elevationInfo": underHeight,
- "renderer": locationRenderer_ZJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "elevationInfo": underHeight,
- "renderer": getPipeRenderer(),
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- }
- } else {
- previewInvokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "shc_map",
- "mapID": params.mapID
- })
- }
- } else if (params.type == "切片地图") {
- let size = [256, 256];
- let origin = {
- "x": -9080400.0,
- "y": 10002300
- };
- switch (params.title) {
- case '公众地图':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "shc_tile_old",
- "size": size,
- "chy_token": "m_token",
- "mapID": params.mapID
- })
- break;
- case '晒衣架':
- case '公共绿地':
- case '无障碍设施':
- case '桥孔停车场':
- case '桥孔道班房':
- case '小区绿化':
- case '基础路网(切片)':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "size": size,
- "origin": origin,
- "mapID": params.mapID
- })
- break;
- case '1979航空影像':
- case '2006航空影像':
- case '2015航空影像':
- case '1994航空影像':
- case '1948航空影像':
- case '政务地图':
- case '政务地图_简易地形':
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "chy_token": "m_token"
- })
- break;
- default:
- previewInvokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "mapID": params.mapID
- })
- break;
- }
- }
- }
- export function AddSingleLayer(params){
- if(params.token && Object3DLayerList.indexOf(params.title) < 0){
- params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
- if(undergroundBuildingLayerList.indexOf(params.title) > -1){
- params.url = params.url + "/SceneServer";
- console.log(params.url)
- }
- }
- let wkid = "0" // 0 代表上海城建 1:代表3857
- if(params.wkid){
- if(params.type == "动态地图" && params.wkid =="1"){
- params.type = "dynamic"
- }
- if(params.type == "切片地图" && params.wkid =="1"){
- params.type = "tile"
- }
- }
- if(params.type=="scene"||params.type=='3DObject'){
- switch (params.id){
- case "whiteMold":
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "scene",
- "renderer":locationRenderer,
- "definitionExpression": 'objectId not in (3067829,3068449,3066018,3067835,3069644,3064784,3067833,3069032,3066632,3065418,3068433,3069646,3068445,3064787,3069036,3066022,3064633,3067831)',
- "mapID": params.mapID
- })
- break;
- default:
- if(undergroundBuildingLayerList.indexOf(params.title) > -1){
- switch (params.title){
- case '高架(地上,梁柱路面)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_GJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- case '高架(地下,承台桩基)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_ZJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":getPipeRenderer(),
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- }
- }else{
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- }
- break;
- }
- }
- else if(params.type=="bim"){
- switch (params.title) {
- case '朱家角车站':
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo": { //下沉高度
- mode:"absolute-height",
- offset:-19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "building",
- "mapID": params.mapID
- })
- break
- }
- }
- else if(params.type=='倾斜摄影'){
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- //"renderer":locationRenderer,
- "type": "mesh",
- "mapID": params.mapID
- })
- return
- }
- else if(params.type=="dynamic"){
- if(buildingLayerList.indexOf(params.title) > -1){ //building 3DObject
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- }else if(BIMLayerList.indexOf(params.title) > -1){ //BIM
- switch (params.title){
- case '朱家角车站':
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo": { //下沉高度
- mode:"absolute-height",
- offset:-19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "building",
- "mapID": params.mapID
- })
- break;
- }
- }else if(undergroundBuildingLayerList.indexOf(params.title) > -1){ //地下构筑物
- switch (params.title){
- case '高架(地上,梁柱路面)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_GJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- case '高架(地下,承台桩基)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_ZJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":getPipeRenderer(),
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- }
- }else{
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "dynamic",
- "mapID": params.mapID
- })
- }
- }
- else if(params.type=="tile"){
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "tile",
- "mapID": params.mapID
- })
- }else if(params.type=="动态地图"){
- if(buildingLayerList.indexOf(params.title) > -1){ //building 3DObject
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "scene",
- "mapID": params.mapID
- })
- }else if(BIMLayerList.indexOf(params.title) > -1){ //BIM
- switch (params.title){
- case '朱家角车站':
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo": { //下沉高度
- mode:"absolute-height",
- offset:-19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "building",
- "mapID": params.mapID
- })
- break;
- }
- }else if(undergroundBuildingLayerList.indexOf(params.title) > -1){ //地下构筑物
- switch (params.title){
- case '高架(地上,梁柱路面)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_GJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- case '高架(地下,承台桩基)': //地下桩基render设置
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_ZJ,
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- default:
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "elevationInfo":underHeight,
- "renderer":getPipeRenderer(),
- "type": "scene",
- "mapID": params.mapID
- })
- break;
- }
- }else{
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_map",
- "mapID": params.mapID
- })
- }
- }else if(params.type=="切片地图"){
- let size = [256,256];
- let origin = {
- "x": -9080400.0,
- "y": 10002300
- };
- switch (params.title) {
- case '晒衣架':
- case '公共绿地':
- case '无障碍设施':
- case '桥孔停车场':
- case '桥孔道班房':
- case '小区绿化':
- case '基础路网(切片)':
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "size": size,
- "origin": origin,
- "mapID": params.mapID
- })
- break;
- case '1979航空影像':
- case '2006航空影像':
- case '2015航空影像':
- case '1994航空影像':
- case '1948航空影像':
- case '政务地图':
- case '政务地图_简易地形':
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "chy_token": "m_token"
- })
- break;
- default:
- invokeParams('AddSingleLayer',
- {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined?1:params.opacity,
- "url": params.url,
- "type": "shc_tile",
- "mapID": params.mapID
- })
- break;
- }
- }
- }
- export function setLocation(params){
- invokeParams('SetLocation', {
- "heading": params.heading == undefined?0:params.heading,
- "tilt": params.tilt == undefined?0:params.tilt,
- "x": params.x,
- "y": params.y,
- "z": params.z == undefined?100:params.z,
- "isfly": true,
- })
- }
- export function drawGraphic(positionGeometry){
- invokeParams('DrawGraphic', {
- "type":"point",
- "geometry":positionGeometry,
- "id": "singlePoint",
- "is_clear": true,
- })
- }
- export function upDateLayerRender(params){
- invokeParams('UpDateLayerRender', {
- "status":params.status,
- "renderer": {
- "type": "simple",
- "symbol":params.symbol
- },
- })
- }
- export function drawGraphics(positionGeometry){
- invokeParams('DrawGraphic', {
- "type":"point",
- "geometry":positionGeometry,
- "symbol": {
- "type": "picture-marker",
- "url": "http://10.81.66.1:8080/jk_map_tool_source/hj/marker.png",
- "width": "20px",
- "height": "20px",
- "yoffset": 10,
- "xoffset": 0
- },
- "is_clear": false,
- })
- }
- //画范围
- export function drawByType(type,is_clear){
- invokeParams('Draw',{
- "type": type,
- "is_clear":is_clear
- })
- }
- //叠加分析
- export function GeometryComposition(type,geometry1,geometry2){
- invokeParams('GeometryComposition',{
- "type": type,
- "geometry1": geometry1,
- "geometry2": geometry2,
- "is_calculation": true,
- })
- }
- //缓冲区分析
- export function GeometryBuffer(distance,unit,geometry){
- invokeParams('GeometryBuffer',{
- "distance": distance,
- "unit": unit,
- "geometry": geometry,
- "is_calculation": true,
- })
- }
- export function ClearMap() {
- invokeParams("ClearMap",{
- "is_draw": true,
- "is_search": true,
- })
- }
- export function positionsToAddress(x,y){
- let positionGeometry =
- {
- "type": "point",
- "x": x,
- "y": y,
- "z": 0
- };
- drawGraphics(positionGeometry);
- }
- export function positionToAddress(x,y){
- let positionGeometry =
- {
- "type": "point",
- "x": x,
- "y": y,
- "z": 0
- };
- drawGraphic(positionGeometry);
- setLocation({
- "x": parseFloat(x),
- "y": parseFloat(y)
- });
- }
- export function addDataPoint(is_clear,data){
- invokeParams('AddDataPoint',
- {
- "is_clear":is_clear,
- "position": data,
- "is_goto":true
- })
- }
- export function addDataLine(is_clear,data){
- invokeParams('AddDataLine',
- {
- "is_clear":is_clear,
- "position": data
- })
- }
- export function addDataArea(is_clear,data){
- invokeParams('AddDataArea',
- {
- "is_clear":is_clear,
- "position": data
- })
- }
- export function DrawBuffers(distance,unit){
- invokeParams('DrawBuffers',
- {
- "distances": distance,
- "unit": unit,
- "geometry": {},
- "symbol": {}
- })
- }
- export function QueryAreaGroupBy(queryWhere){
- invokeParams('QueryAreaGroupBy',
- {
- "quertUrl": "http://10.81.66.1:8080/site02/rest/services/gyld/MapServer/0",
- "queryWhere": queryWhere,
- "groupbyField": ["A1"]
- })
- }
- //大地图切换地图
- // export async function changeMyBaseMap(title, opacity = 1) {
- // debugger
- // if (title == "zwdt") {
- // // invokeParams('SetBackground', {
- // // "opacity": 1,
- // // "color": "#FFFFFF",
- // // "theme": "light",
- // // })
- // invokeParams('AddBaseMapLayer', {
- // "id": "BaseMapZhenwu",
- // "title": "BaseMapZhenwu",
- // "visible": true,
- // "opacity": opacity,
- // "type": "tile",
- // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265"
- // })
- // } else if (title == "air") {
- // // invokeParams('SetBackground', {
- // // "opacity": 1,
- // // "color": "#FFFFFF",
- // // "theme": "light",
- // // })
- // invokeParams('AddBaseMapLayer', {
- // "id": "BaseMapYaoGan",
- // "title": "BaseMapYaoGan",
- // "visible": true,
- // "opacity": opacity,
- // "type": "tile",
- // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036"
- // })
- // } else if (title == "basemap") {
- // // invokeParams('SetBackground', {
- // // "opacity": 0.7,
- // // "color": "#002F47",
- // // "theme": "light",
- // // })
- // invokeParams('AddBaseMapLayer', {
- // "id": "BaseMap",
- // "title": "BaseMap",
- // "visible": true,
- // "opacity": opacity,
- // "type": "tile",
- // "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321"
- // })
- // }
- // }
- let arrAllPipe = ['T8101A', 'T8101L','T8101P',
- 'T8102A', 'T8102L', 'T8102P',
- 'T8103L', 'T8103P',
- 'T8104L', 'T8104P',
- 'T8105L', 'T8105P'];
- let arrPipe = ['T8101L',
- 'T8102L',
- 'T8103L',
- 'T8104L',
- 'T8105L'];
- export function PipeProfileAnalysis(params){
- invokeParams('PipeProfileAnalysis', {
- "typename": params.typename,
- "gid": params.gid
- })
- }
- export function PipeExcavationAnalysis(params){
- invokeParams('PipeExcavationAnalysis', {
- "id": arrPipe,
- "geometry":params.geometry,
- "shendu":params.shendu
- })
- }
- export function PipeStatisticAnalysis(params){
- invokeParams('PipeStatisticAnalysis', {
- "bigType": params.bigField,
- "middleType": params.middleField,
- "geometry": params.geometry
- })
- }
- export function ExcavationAnalysis(params){
- invokeParams('ExcavationAnalysis', {
- "status":params.status,
- "depth":params.shendu
- })
- }
- export function RectangleSlice(params){
- invokeParams('RectangleSlice', {
- "status":params.status,
- "geometry":params.geometry,
- "depth":params.shendu
- })
- }
- export function PipeAgeAnalysis(params){
- invokeParams('PipeAgeAnalysis', {
- "id": arrPipe,
- "geometry":params.geometry
- })
- }
- export function CylinderEffect(params){
- invokeParams('CylinderEffect', {
- "status": params.status,
- "positions":params.positions,
- "radius": params.radius,
- "items": params.items
- })
- }
- export function PrismEffect(params){
- invokeParams('PrismEffect', {
- "status": params.status,
- "items": params.items
- })
- }
- //原有剖切数据
- export function PrismDifferentHeightEffect(params){
- invokeParams('PrismDifferentHeightEffect', {
- "status": params.status,
- "items": params.items
- })
- }
- //新剖切数据
- export function PrismDifferentHeightSideEffect(params){
- invokeParams('PrismDifferentHeightSideEffect', {
- "status": params.status,
- "extent": params.extent,
- "items": params.items
- })
- }
- export function PositionSlice(params){
- invokeParams('PositionSlice', {
- "status": params.status,
- "geometry":params.geometry
- })
- }
- export function PipeSectionAnalysis(){
- invokeParams('PipeSectionAnalysis', {
- "id": arrPipe,
- })
- }
- export function CollisionAnalysis(params){
- invokeParams('PipeCollisionAnalysis', {
- "id": arrPipe,
- "maishen1": params.maishen1,
- "maishen2": params.maishen2,
- "guanjing": params.guanjing,
- "color":params.color
- })
- }
- export function CreateThreeGeometry(params){
- invokeParams('CreateThreeGeometry', {
- "status": params.status
- })
- }
- export function Draw3DExtent(params){
- invokeParams('Draw3DExtent', {
- "status": params.status,
- "height": 20,
- "color":[0,255,255],
- "ringsArr":params.rings
- })
- }
- export function AddDataArea(params){
- invokeParams('AddDataArea', {
- "is_clear": params.status,
- "position": params.position,
- })
- }
- let lastPipeThemeVisible = null
- export async function setPipeTheme(visible) {
- if (visible == lastPipeThemeVisible) return
- arrPipe.forEach(item => {
- invokeParams('AddSingleLayer', {
- "id": item,
- "title": item,
- "visible": visible,
- "opacity": 0,
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/arcgis/rest/services/cim_huangpu/" + item + "/MapServer",
- "type": "dynamic"
- })
- })
- invokeParams('AddSingleLayer', {
- "id": "longzhu",
- "title": "地下管线-三维",
- "visible": visible,
- "opacity": 1,
- "renderer": getPipeRenderer(),
- "elevationInfo": underHeight,
- //"url": 'https://10.81.73.76/server/rest/services/Hosted/cim_hp/SceneServer',
- "url": await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990820240801")+'/SceneServer',
- "type": "scene"
- })
- lastPipeThemeVisible = visible
- }
- export function changePipeRender(params){
- invokeParams('AddSingleLayer', {
- "id": "longzhu",
- "visible":true,
- "renderer":getPipeRenderer(params)
- })
- }
- //设置地图控件主题色
- export function changeMapTheme(theme){
- invokeParams('ChangeViewType',{
- theme
- })
- }
- export function changeTestArea(area) {
- invokeParams('ChangeTestArea', {
- "name": area
- })
- }
- //张江前5个
- export function changeProductP(name) {
- invokeParams('ChangeShowLayer', {
- "name": name
- })
- }
- //后6个
- export function changeTypeP(name) {
- invokeParams('ChangeShowType', {
- "name": name
- })
- }
- export function resetMap() {
- invokeParams('ResetMap',{})
- }
- export function changeLayerFloor(floor) {
- invokeParams('ChangeShowFloor', {
- "floor": floor + ''
- })
- }
- //改变地图预览的图层
- export function changeMapViewTreeControl(title, visible= true,isClear,opacity= 1,parentID,mapID = '') {
- invokePreviewMapParams('LayerTreeControl', {
- "title": title,
- "visible": visible,
- "isclear":(isClear !== undefined)?isClear : true,
- opacity,
- parentID,
- mapID
- })
- }
- export function changeTreeControl(title, visible= true,isClear,opacity= 1,parentID,mapID = '',position = {}) {
- invokeParams('LayerTreeControl', {
- "title": title,
- "visible": visible,
- "isclear":(isClear !== undefined)?isClear : true,
- position:"bottom-right",
- opacity,
- parentID,
- mapID,
- "padding": {
- bottom: 0,
- right:112 - 15
- }
- })
- }
- export function changeTuYuan(name){
- invokeParams('ChangeShowTuyuan', {
- name
- })
- }
- export function changeEntity(name){
- invokeParams('ChangeShowShiti', {
- name
- })
- }
- export function changeShowSlice(status){
- invokeParams('ChangeShowSlice', {
- status
- })
- }
- export function changePosition(position,is_clear = true,is_goto){
- invokeParams('Position', {
- type:'point',
- position,
- mapz:"0",
- tilt:"0",
- heading:"0",
- "is_clear": is_clear,
- "is_goto": is_goto,
- "is_draw": true
- })
- }
- //图层
- export function getLayerControlData(name,type='房屋',title="jianzhu_f"){
- invokeParams('LayerCount', {
- "type": type,
- "title": title,
- "theme": name,
- "layerid": 0
- })
- }
- let yardObj = {
- hparea:{
- layerid:"6",
- title:"yuanluo_hp",
- field:"FIRST_YD"
- },
- zjarea:{
- layerid:"95",
- title:"yuanluo",
- field:"YardType"
- }
- }
- export function getYardLayerData(qu) {
- // "title":"yuanluo", _hp
- // "layerid":"95", 6
- // "field":'YardType' FIRST_YD
- let obj = {}
- if (qu === '黄浦院落'){
- obj = {
- layerid:"6",
- title:"yuanluo_hp",
- field:"FIRST_YD"
- }
- }else if(qu === '张江试点') {
- obj = {
- layerid:"95",
- title:"yuanluo",
- field:"YardType"
- }
- }
- invokeParams('LayerCount', {
- "field":obj.field,
- "type": '院落',
- "title": obj.title,
- "layerid":obj.layerid,
- })
- }
- export function forsetPieClickControl(code,isOn = true){
- invokeParams('LayerControl', {
- "visible": true,
- "title": "zjgreen",
- "opacity": 1,
- "where": isOn?`FeatureCode='${code}'`:'1=1'
- })
- }
- export function yardLayerControl(qu,code,isOn = true){
- let obj = {}
- if (qu === '黄浦院落'){
- obj = {
- layerid:"6",
- title:"yuanluo_hp",
- field:"FIRST_YD"
- }
- }else if(qu === '张江试点') {
- obj = {
- layerid:"95",
- title:"yuanluo",
- field:"YardType"
- }
- }
- invokeParams('LayerControl', {
- "visible": true,
- "title": yardObj[qu].title,
- "opacity": 1,
- "where": isOn?`${obj.field}='${code}'`:'1=1'
- })
- }
- export function setMapCenter(mapx,mapy){
- invokeParams('SetCenter', {
- mapx:mapx,
- mapy:mapy,
- })
- }
- //地图回到初始位置
- export function mapLocationInit(){
- invokeParams('Location', {
- "x": 2614.616635477607,
- "y": -3995.0735499331035,
- "z": 2633.736500112477,
- "heading": 0,
- "tilt": 60,
- "scale": 40000
- })
- }
- //大地图罗盘回到初识方向
- export function mapLocationInit2(){
- invokeParams('Location', {
- "heading": 0
- })
- }
- //白模的开关
- export function bmMapOperation(title,visible,opacity = 1,where = '',params = ''){
- invokeParams('LayerControl', {
- "title": title,
- "visible":visible,
- "opacity": opacity,
- "where": where,
- "params": params
- })
- }
- //白模的种类
- export function bmMapOperationType(title,theme){
- invokeParams('SceneLayerRender', {
- "title": title,
- "theme":theme
- })
- }
- //去掉地推
- export function clearMapF(visible){
- invokeParams('ClearBaseMap', {
- "visible":visible
- })
- }
- //透明度
- export function setMapOpacity(opacity){
- invokeParams('SetOpacity', {
- "opacity":opacity
- })
- }
- //图元
- export function setMapTy(geometry,graphicsID){
- invokeParams('LayerHighlight', {
- "geometry":geometry,
- "graphicsId":graphicsID,
- })
- }
- //环视
- export function setMapCircleWatch(isShow) {
- invokeParams('ChangeViewFlight',{
- "status": isShow?"show":'hide'
- })
- }
- //环视-内圈
- export function setMapCircleWatchInner(isShow) {
- invokeParams('ChangeViewFlightCircle',{
- "status": isShow?"show":'hide'
- })
- }
- //水波特效
- export function setMapWaterEffect(isShow) {
- invokeParams('ChangeWaterEffect',{
- "status": isShow?"show":'hide',
- "direction": 260,
- "strength": "moderate",
- "color": "#25427c"
- })
- }
- //双屏
- export function setMapScreenSplit(isTwoScreen,num=2) {
- invokeParams('ChangeSplitScreen',{
- "status": isTwoScreen?"show":'hide',
- "num": num
- })
- }
- //切换2d或者3d
- export function changeScene3dOr2d(is3d) {
- invokeParams('ChangeViewType',{
- "type": is3d?"3D":"2D"
- })
- }
- //范围回到初始状态
- export function setFullExtentMap() {
- invokeParams('FullExtent',{
- })
- }
- //人口
- export function setPersonMap(type,name) {
- invokeParams('ShowPopulation',{
- type,
- name
- })
- }
- //关闭图层
- export function clearAllLayer() {
- invokeParams('ClearMapLayers',{
- })
- }
- //全市塑膜渲染方式
- export function setCitySm(theme) {
- invokeParams('SceneLayerRender',{
- title:'qsbm2020',
- theme
- })
- }
- //调用点查询
- export function SetClickMapFun(title,type) {
- invokeParams('SetMapClick',{
- title,
- type
- })
- }
- //搜索实体书
- export function searchAboutEntity(name,mapx,mapy) {
- invokeParams("LocationBuilding",{
- "title": "jianzhu",
- "name": name,
- "mapx": mapx,
- "mapy": mapy,
- "mapz":0
- })
- }
- //测量
- export function setClMap(type,is_show =true) {
- invokeParams('Calculation',{
- type:type,
- is_show:is_show,
- })
- }
- //测量
- export function calculation3D(type,is_show=true){
- invokeParams('Calculation3D',{
- type:type,
- status:is_show?'show':'clear',
- position: 'top-right',
- padding: {
- right:130,
- top:87
- }
- })
- }
- //船舶热力图
- export function setBoatHeatmap(show,data){
- invokeParams('SetBoatHeatmap',{
- "show": show,
- "data": data,
- })
- }
- //船舶实时位置
- export function setBoatGPS(show,data){
- invokeParams('SetBoatGPS',{
- "show": show,
- "data": data,
- })
- }
- //船舶历史轨迹
- export function setBoatHistory(data){
- invokeParams('SetBoatHistory',{
- "data": data,
- })
- }
- //播放历史轨迹
- export function playBoatHistory(status){
- invokeParams('PlayBoatHistory',{
- "status": status,
- })
- }
- export function refreshBoatGPS(data){
- invokeParams('RefreshBoatGPS',{
- "data": data,
- })
- }
- //书签
- export function setBookMarkMap(isLabelShow,right) {
- let obj = !isLabelShow?{
- status:isLabelShow?'show':'hide',
- }:{
- status:isLabelShow?'show':'hide',
- "position": "top-right",
- "padding": {
- right:130,
- top:87
- }
- }
- invokeParams('ChangeBookmarks',obj)
- }
- //清空地图
- export function clearMapDraw(is_draw,is_search,is_position) {
- invokeParams('ClearMap',{
- is_draw:is_draw,
- is_search:is_search,
- is_position:is_position,
- // is_boat:true,
- })
- }
- //地图的打印
- export function setMapPrint(isPrint,right) {
- let obj = !isPrint?{
- status:isPrint?'show':'hide',
- }:{
- status:isPrint?'show':'hide',
- "position": "top-right",
- "padding": {
- right:130,
- top:87
- }
- }
- invokeParams('ChangePrintMap',obj)
- }
- //视线分析
- export function setWatchLineAny(Type,isAna,x,y,z,radius){
- if(Type=='line'){
- invokeParams('ChangeLineSight',{
- status:isAna?'show':'hide',
- })
- }else if(Type=='Area'){
- invokeParams('ChangeLineSight',{
- status:isAna?'show':'hide',
- "point": {
- // "x": 3352.092000000179,
- "x": x,
- // "y": 5043.542199999094,
- "y": y,
- // "z": 50
- "z": z
- },
- // "radius": 100,
- "radius": radius,
- "count": 180
- })
- }
- }
- //画点
- export function drawMapPoint(type = 'point'){
- invokeParams('Draw',{
- type
- })
- }
- //日照分析
- export function setMapSumAna(isAna) {
- invokeParams('ChangeDayLight', {
- status:isAna?'show':'hide',
- position: 'top-right',
- padding: {
- right:130,
- top:87
- }
- })
- }
- //撒点
- export function setMapSplitSingle(position) {
- invokeParams('AddPoint',{
- type:'point',
- position,
- is_clear:false,
- is_goto:false
- })
- }
- //三维模型分析
- export function setBaiMoModel(buffer=0,title) {
- invokeParams('SpatialQuery',{
- // type,
- buffer,
- title:title
- })
- }
- //属性查询
- export function setFieldQuerySearch(id,where) {
- debugger
- invokeParams('QueryIn3D',{
- id:id,
- geometry: null,
- // where:"BUILDINGNAME=中银大厦"
- where:where
- })
- }
- export function changeChosenContent(id,where) {
- invokeParams('AddSingleLayer', {
- "id": id,
- "visible": true,
- "opacity": 1,
- "where":where
- })
- }
- export function highLight_pipe(params) {
- invokeParams('HighLight_pipe', {
- "id": "longzhu",
- "status": params.status,
- "where": params.where,
- "opposite_where":params.opposite_where,
- "opposite_renderer":getPipeRendererDark()
- })
- }
- //拿到属性查询的所有字段
- export function getPropSearchAllFields(){
- invokeParams('LayerFields',{
- title:'qsbm2020'
- })
- }
- //获取服务所有字段
- export function getLayerAllFields(url){
- invokeParams('LayerFieldsByUrl',{
- url:url,
- layerId:'0'
- })
- }
- //拿到管线属性查询的所有字段
- export function getPipePropSearchAllFields(title){
- invokeParams('LayerFields',{
- title:title
- })
- }
- //画球
- export function drawCircle3d(mapx,mapy,radius) {
- invokeParams('Draw3D',{
- title:"whiteMold",
- mapx:mapx,
- mapy:mapy,
- radius:radius
- })
- }
- //获取三维点 getBuildingPoint
- export function getBuildingPoint(clear) {
- invokeParams('GetBuildingPoint',{
- "clear": clear
- })
- }
- export function getMoreBuildingPoint(clear) {
- invokeParams('GetMoreBuildingPoint',{
- "clear": clear
- })
- }
- //对白膜做筛选
- export function getDefinedLayer(clear) {
- invokeParams('GetDefinedLayer',{
- "clear": clear
- })
- }
- //绿地统计
- export function addBufferLayer(is_clear,position_type,position_where,url) {
- invokeParams('AddBufferLayer',{
- "is_clear": is_clear,
- "position_type": position_type,
- "position_where":position_where,
- "url": url
- })
- }
- //添加居住小区面
- export function addJZXQLayer(is_clear) {
- invokeParams('AddJZXQLayer',{
- "is_clear": is_clear,
- "url":'http://10.81.66.1:8080/site03/rest/services/D3005000220170601/MapServer'
- })
- }
- //添加绿地-切换
- // export function addGreenLayer(is_clear,url) {
- // invokeParams('AddGreenLayer',{
- // "is_clear": is_clear,
- // "url": url
- // })
- // }
- //绿地分析
- export function greenAnalysis(url1,url2,type,distance) {
- invokeParams('GreenAnalysis',{
- "inputLayerUrl1": url1,
- "inputLayerUrl2": url2,
- "type": type,
- "distance": distance,
- "units": "esriMeters",
- "line_side": "FULL",
- "line_end_type": "ROUND",
- "dissolve_option": "NONE",
- "dissolve_field": []
- })
- }
- //各种类型缓冲区绘制
- export function allTypeBufferAnalysis(url1,url2,type,distance,where) {
- invokeParams('AllTypeBufferAnalysis',{
- "inputLayerUrl1": url1,
- "inputLayerUrl2": url2,
- "type": type,
- "distance": distance,
- "units": "esriMeters",
- "line_side": "FULL",
- "line_end_type": "ROUND",
- "dissolve_option": "NONE",
- "dissolve_field": [],
- "where":where
- })
- }
- //各种类型叠加分析绘制
- export function CompositionAnalysis(url1,url2,type,compositionType,where) {
- invokeParams('CompositionAnalysis',{
- "inputLayerUrl1": url1,
- "inputLayerUrl2": url2,
- "type": type,
- "distance": 0.01,
- "compositionType":compositionType,
- "units": "esriMeters",
- "line_side": "FULL",
- "line_end_type": "ROUND",
- "dissolve_option": "NONE",
- "dissolve_field": [],
- "where":where
- })
- }
- //feature定位图片
- export function positionGoToMap3d(feature) {
- invokeParams('GoToMap',{
- objectID:feature
- })
- }
- //添加图层
- export function addMapLayer(id,title,url) {
- invokePreviewMapParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": true,
- "opacity": 1,
- "url":url,
- "type": "shc_map",
- "token": ""
- })
- }
- //飞行路线
- // export function SetViewGoto(status,pointArr) {
- // invokeParams('SetViewGoto',
- // {
- // "status": status?'start':'end',
- // "pointArr": pointArr
- // })
- // }
- export function SetViewGoto(status,pointArr) {
- invokeParams('ViewGoTo',
- {
- "status": status?'show':'hide',
- "pointArr": pointArr
- })
- }
- //大地图添加图层
- export function addMapLayerMap(id,type,title,url,visible = true,opacity=100,mapID='m_map') {
- if(type=='3DObject'){
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- //"renderer":locationRenderer,
- "elevationInfo":overHeight,
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- return
- }
- if(type=='bim'){
- switch (title) {
- case '朱家角车站':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity / 100,
- "url": url,
- "elevationInfo": underStationHeight,
- "type": "building",
- "token": "",
- "mapID": mapID
- })
- break;
- default:
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity / 100,
- "url": url,
- "type": "building",
- "token": "",
- "mapID": mapID
- })
- break
- }
- return
- }
- if(type=='mesh'){
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- //"renderer":locationRenderer,
- "type": "mesh",
- "mapID": mapID
- })
- return
- }
- if(type=='动态地图'){
- if(buildingLayerList.indexOf(title) > -1){ //是否为地上构筑物
- switch (title) {
- case '三维白膜':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "renderer":locationRenderer,
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- break;
- default:
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- break
- }
- }else if(BIMLayerList.indexOf(title) > -1){ //BIM 图层加载
- switch (title){
- case '朱家角车站':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "elevationInfo":underStationHeight,
- "type": "building",
- "token": "",
- "mapID": mapID
- })
- break;
- default:
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "building",
- "token": "",
- "mapID": mapID
- })
- break
- }
- }else if(subLayerList.indexOf(title) > -1){ // 带sublayer图层加载
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "dynamic",
- "sublayers": [{id:0,outFields: ["*"]}],
- "token": "",
- "mapID": mapID
- })
- } else if(undergroundBuildingLayerList.indexOf(title) > -1){ //是否为地下构筑物
- // invokeParams('AddLayer',
- // {
- // "id": "chezhang",
- // "title": "chezhang",
- // "visible": true,
- // "opacity": 1,
- // "url":"https://10.81.73.76/server/rest/services/Hosted/zhujiajiao/SceneServer/layers/0",
- // "type": "scene",
- // "renderer":getPipeRenderer(),
- // "token": ""
- // })
- switch (title) {
- case '高架(地上,梁柱路面)': //地下桩基render设置
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_GJ,
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- break
- case '高架(地下,承台桩基)': //地下桩基render设置
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "elevationInfo":underHeight,
- "renderer":locationRenderer_ZJ,
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- break
- default:
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "elevationInfo":underHeight,
- "renderer":getPipeRenderer(),
- "type": "scene",
- "token": "",
- "mapID": mapID
- })
- break;
- }
- }else{ //普通动态图层加载
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "shc_map",
- "token": "",
- "mapID": mapID
- })
- }
- }else if(type=="切片地图"){
- let size = [256,256];
- let origin = {
- "x": -9080400.0,
- "y": 10002300
- };
- switch (title) {
- case '公众地图':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "shc_tile",
- "size": size,
- "token": "",
- "mapID": mapID
- })
- break;
- case '晒衣架':
- case '公共绿地':
- case '无障碍设施':
- case '桥孔停车场':
- case '桥孔道班房':
- case '小区绿化':
- case '基础路网(切片)':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "shc_tile",
- "size": size,
- "origin": origin,
- "token": "",
- "mapID": mapID
- })
- break;
- case '1979航空影像':
- case '2006航空影像':
- case '2015航空影像':
- case '1994航空影像':
- case '1948航空影像':
- case '政务地图':
- case '政务地图_简易地形':
- case '(上半年)航空影像':
- case '2008航空影像':
- case '2010航空影像':
- case '2011航空影像':
- case '2012(上半年)航空影像':
- case '2012(下半年)航空影像':
- case '2013(上半年)航空影像':
- case '2013(下半年)航空影像':
- case '2016航空影像':
- case '2017航空影像':
- case '2018航空影像':
- case '影像注记':
- case '最新航空影像':
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": 1,
- "url": url,
- "type": "shc_tile",
- "token": "m_token",
- "mapID": mapID
- })
- break;
- default:
- invokeParams('AddLayer',
- {
- "id": id,
- "title": title,
- "visible": visible,
- "opacity": opacity/100,
- "url":url,
- "type": "shc_tile",
- "token": "",
- "mapID": mapID
- })
- break;
- }
- }
- }
- //改变书签的位置
- export function setWidgetPositionFun(id = 'legend',position,transition = 'none') {
- invokeParams('SetWidgetPosition',{
- id:id,
- padding: {
- right:130,
- top:87
- },
- // transition:transition
- })
- }
- //进入模型分析
- export function modelManageAna(name,parentName,distance,units,line_side,line_end_type,dissolve_option) {
- invokeParams('CreateBuffers',{
- "inputLayerName":name,
- "inputLayerParent": parentName,
- "inputLayerUrl": "",
- "distance": distance,
- "units": units,
- // "resultName": "result",
- "line_side": line_side,
- "line_end_type": line_end_type,
- "dissolve_option": dissolve_option,
- "dissolve_field": []
- })
- }
- //定位
- export function setMapPosition(x,y){
- invokeParams('Location',{
- "heading": 0,
- "tilt": 60,
- "x": x,
- "y":y,
- "z": 2633.736500112477,
- "isfly": true
- })
- }
- //重点区域定位
- export function importantAreaPosition(x,y,z,heading,tilt,isfly=false){
- invokeParams('SetLocation',{
- "x": x,
- "y": y,
- "z": z,
- "heading": heading,
- "tilt": tilt,
- "isfly": isfly
- })
- }
- export function setExtent(params){
- invokeParams('SetExtent',{
- "extent": {
- "spatialReference": {
- "latestWkid": 3857,
- "wkid": 102100
- },
- "xmin": params.xmin,
- "ymin": params.ymin,
- "xmax": params.xmax,
- "ymax": params.ymax,
- },
- "isfly": true,
- })
- }
- export function setGeometryLocation(params){
- invokeParams('SetGeometryLocation',{
- "type": params.type,
- "x":params.x,
- "y":params.y,
- "paths":params.paths,
- "rings":params.rings,
- })
- }
- //画可视域分析俩个点
- export function ViewshedLine(type,is_clear){
- invokeParams('ViewshedLine',{
- "type": type,
- "is_clear":is_clear
- })
- }
- export function ViewshedArea(params){
- invokeParams('ViewshedArea', {
- "startPoint": params.startPoint,
- "endPoint": params.endPoint,
- "status":params.status == undefined?"show":params.status,
- "angle": params.angle,
- })
- }
- export function LayerQuery(iayerid,where){
- invokeParams('LayerQuery',{
- "title": "jiezhen",
- "layerid": iayerid,
- "where": where,
- "outFields": [
- "*"
- ],
- "returnGeometry": true,
- "is_draw": true,
- "is_goto": false
- })
- }
- export function PipeLayerTreeControl(title,visible,parentID){
- invokeParams('LayerTreeControl',{
- "title": title,
- "opacity": 1,
- "visible": visible,
- "isclear": false,
- "parentID": parentID
- })
- }
- export function SetStatisticDefinition(url,layerType,type,positionWhere,layerWhere){
- invokeParams('SetStatisticDefinition',{
- "is_clear": true,
- "layerType": layerType,
- "queryUrl": url,
- "type": type,
- "where": positionWhere,
- "queryWhere": layerWhere,
- })
- }
- export function QuZhenQuery(layerid,where){
- invokeParams('LayerQuery',{
- "title": "jiezhen",
- "layerid": layerid,
- "where": where,
- "outFields": [
- "*"
- ],
- "returnGeometry": false
- })
- }
- export function clearAllLayerMap(idList) {
- invokeParams("ClearMapLayers",{
- "idList":idList,
- "mapID": "map"
- })
- }
- export function Calculation3D(params){
- invokeParams('Calculation3D', {
- "status": params.status == undefined?"show":params.status,
- "type": params.type,
- "position": "top-right",
- "padding": {
- right:130,
- top:87
- },
- })
- }
- export function setMapClick(viewID,mapID){
- invokeParams('MapClickAll', {
- status:true,
- is_draw:true,
- is_code:false,
- viewID:viewID,
- mapID:mapID
- })
- }
- export function previewChangeSplitScreen(params){
- previewInvokeParams('ChangeSplitScreen', {
- "status": params.status,
- "num": params.num,
- "display":params.display
- })
- }
- export function ChangeSplitScreen(params){
- invokeParams('ChangeSplitScreen', {
- "status": params.status,
- "num": 2,
- })
- }
- export function MapClickPreviewByType(params){
- previewInvokeParams('MapClickAll', {
- "status": params.status,
- "viewID":params.viewID,
- "disableLayerIdList":["districtArea","districtStreet"],
- "mapID":params.mapID,
- "clickHandleID":params.clickHandleID
- })
- }
- export function LineSight(status){
- invokeParams('LineSight', {
- "status": status == undefined?"show":status,
- "position": "top-right",
- "padding": {
- right:130,
- top:87
- },
- })
- }
- export function ChangeSlowSlice(status){
- invokeParams('ChangeSlowSlice', {
- "status":status,
- })
- }
- export function addBIMMQLayers(visible){
- invokeParams('AddSingleLayer',
- {
- "id": "cim_3c_mq",
- "title": "3C_幕墙模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/81489911",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_mq",
- "title": "1C_幕墙模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/71262478",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_4c_mq",
- "title": "4C_幕墙模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/83660520",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_5c_mq",
- "title": "5C_幕墙模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/55485332",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_2c",
- "title": "2C",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/32777302",
- "type": "building",
- })
- }
- export function addBIMDETAILLayers(visible){
- invokeParams('AddSingleLayer',
- {
- "id": "cim_3c_jz",
- "title": "3C_建筑模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/92984758",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_3c_jg",
- "title": "3C_结构模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/73521993",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_jz",
- "title": "1C_建筑模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/95137325",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_ps",
- "title": "1C_排水模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/47631451",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_nt",
- "title": "1C_暖通模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/69074922",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_d",
- "title": "1C_电模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/20036147",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_1c_jg",
- "title": "1C_结构模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/69138134",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_4c_jz",
- "title": "4C_建筑模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/86895632",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_4c_jg",
- "title": "4C_结构模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/30192995",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_5c_jz",
- "title": "5C_建筑模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/07944781",
- "type": "building",
- })
- invokeParams('AddSingleLayer',
- {
- "id": "cim_5c_jg",
- "title": "5C_结构模型",
- "visible": visible,
- "opacity": 1,
- "url":"https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/admin/54350469",
- "type": "building",
- })
- }
- export async function changeBaseMap(title, opacity = 0.7) {
- if (title == "zwdt") {
- invokeParams('SetBackground', {
- "opacity": opacity,
- "color": "#FFFFFF",
- "theme": "light",
- })
- let url1 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265")
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapZhenwu",
- "title": "BaseMapZhenwu",
- "visible": true,
- "opacity": opacity,
- "type": "tile",
- "url": url1
- })
- } else if (title == "air") {
- invokeParams('SetBackground', {
- "opacity": opacity,
- "color": "#002F47",
- "theme": "light",
- })
- let url2 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036")
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapYaoGan",
- "title": "BaseMapYaoGan",
- "visible": true,
- "opacity": opacity,
- "type": "tile",
- "url": url2
- })
- } else if (title == "basemap") {
- invokeParams('SetBackground', {
- "opacity": opacity,
- "color": "#002F47",
- "theme": "light",
- })
- let url3 = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321")
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMap",
- "title": "BaseMap",
- "visible": true,
- "opacity": opacity,
- "type": "tile",
- "url": url3
- })
- }
- }
- export function AddZhenwuMapLayer(){
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapZhenwu",
- "title":"BaseMapZhenwu",
- "visible": true,
- "opacity": 1,
- "type":"tile",
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265",
- })
- }
- export function AddYaoganMapLayer(){
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapYaoGan",
- "title":"BaseMapYaoGan",
- "visible": true,
- "opacity": 1,
- "type":"tile",
- // "chy_token":"m_token",
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/94286922"
- })
- }
- export function AddBaseMapLayer(){
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMap",
- "title":"BaseMap",
- "visible": true,
- "opacity": 1,
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321",
- })
- }
- export function DrawMap(params){
- invokeParams('Draw', {
- "type": params.type,
- "clear": params.clear==undefined?true:params.clear,
- "hasZ": params.hasZ,
- "countNumber":params.countNumber!=undefined?params.countNumber:null
- })
- }
- export function DrawPreviewMap(params){
- previewInvokeParams('Draw', {
- "type": params.type,
- "clear": true,
- "hasZ": params.hasZ,
- "is_calculation":true,
- "countNumber":params.countNumber!=undefined?params.countNumber:null
- })
- }
- export function DataHeatMap(params){
- invokeParams('DataHeatMap', {
- "id": "dataHeatMapLayer",
- "title": "热力图",
- "visible": params.visible,
- "radius": params.radius,
- "data": params.data,
- "fields": [
- {
- "name": "FID",
- "type": "oid"
- },
- {
- "name": "value",
- "type": "string"
- }
- ],
- "objectIdField": "FID",
- })
- }
- export async function AddGreenLayer(id, url, isClear = false) {
- let url2 = await returnProxyUrl(url)
- invokeParams('AddThemeLayer', {
- "id": id,
- "is_clear": isClear,
- "url": url2,
- })
- }
- export function ChangeViewFlight(params){
- invokeParams('ChangeViewFlight', {
- "status": params.status,
- "speed": 0.1,
- "direction": 'anticlockwise'
- })
- }
- export function ChangeViewFlightCircle(params){
- invokeParams('ChangeViewFlightCircle', {
- "status": params.status,
- "speed": 0.1,
- "direction": 'anticlockwise'
- })
- }
- export function positionRegionP(type,where){
- invokeParams('SetAreaLocation', {
- "type":type,
- "where": where,
- })
- }
|