123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182 |
- import { myBridge, previewMapBridge } from "./map.js";
- import { getMapToken, getServiceToken } from "@/service/map.js";
- // 白膜颜色配置
- const locationRenderer = {
- type: "simple",
- symbol: {
- type: "mesh-3d",
- symbolLayers: [{
- type: "fill",
- material: {
- color: [255, 255, 255, 1],
- colorMixMode: "tint"
- },
- edges: {
- type: 'solid',
- color: [0, 0, 0, 0.5],
- size: 1
- }
- }]
- }
- };
- export function invokeParams(ActionName, params) {
- console.log('invokeParams', ActionName, params)
- getMapToken().then(res => {
- let token = res.data.msg[0].Rows[0].token;
- myBridge.bridgeContent.Invoke({
- 'ActionName': ActionName,
- "Parameters": {
- token: token,
- ...params
- }
- })
- })
- }
- export function previewInvokeParams(ActionName, params) {
- getMapToken().then(res => {
- let token = res.data.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 getServiceToken(username, password);
- if (response?.data.length > 0) {
- arr.splice(i - 1, 4);
- return arr.join('/') + '/MapServiceProxy/' + response.data;
- }
- }
- }
- } else {
- return url
- }
- }
- export function SetBackground() {
- invokeParams('SetBackground', {
- "opacity": 1,
- "color": "transparent",
- })
- }
- export async function AddWhiteMold(visible) { //添加白膜
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/05195418");
- invokeParams('AddSingleLayer', {
- "id": "D8503010320240901",
- "title": "全市白模",
- "visible": visible,
- "opacity": 1,
- //"renderer": locationRenderer,
- "url": url,
- "type": "scene",
- })
- }
- export function addPartWhiteMold(visible) {
- invokeParams('AddSingleLayer', {
- "id": "whiteMold",
- "title": "局部白模",
- "visible": visible,
- "opacity": 0,
- "renderer": locationRenderer,
- //"url":"https://serve3d41.gis.cn:6443/geoscene/rest/services/Hosted/jzbm_ljz/SceneServer",
- "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990120240926",
- "type": "scene",
- })
- }
- export function GeometryMeshPrismEffect(params) {
- invokeParams('GeometryMeshPrismEffect', {
- "status": params.status,
- "startHeight": params.startHeight,
- "rings": [
- [
- [
- 3764.910326990452,
- 8853.749163112263
- ],
- [
- 5715.688477752859,
- 8853.749163112263
- ],
- [
- 5715.688477752859,
- 6816.1711134560055
- ],
- [
- 3764.910326990452,
- 6816.1711134560055
- ],
- [
- 3764.910326990452,
- 8853.749163112263
- ]
- ]
- ],
- "items": params.items
- })
- }
- export function ThreeGrid(params) {
- invokeParams('ThreeGrid', {
- "status": params.status,
- "size": params.size,
- "extent": { minX: 2176, maxX: 6048, minY: -1024, maxY: 1352 },
- "height": 1200,
- "layerHeight": params.layerHeight,
- "animationEnabled": params.animationEnabled
- })
- }
- export function ShowThreeCube(params) {
- invokeParams('ShowThreeCube', {
- "status": params.status,
- "size": params.size,
- "points": params.points
- })
- }
- export function ShowThreeCubeDetail(params) {
- invokeParams('ShowThreeCubeDetail', {
- "id": "paths",
- "status": params.status,
- "size": params.size,
- "points": params.points,
- "depthTest": params.depthTest
- })
- }
- export function ShowBuildingThreeCubeByInterface(params) {
- invokeParams('ShowBuildingThreeCubeByInterface', {
- "status": params.status,
- "level": params.level,
- "size": params.size
- })
- }
- export function ShowNoFlyThreeCubeByInterface(params) {
- invokeParams('ShowNoFlyThreeCubeByInterface', {
- "status": params.status,
- "level": params.level,
- "size": params.size
- })
- }
- export function ShowRoadThreeCubeByInterface(params) {
- invokeParams('ShowRoadThreeCubeByInterface', {
- "status": params.status,
- "level": params.level,
- "size": params.size
- })
- }
- export function ShowRiverThreeCubeByInterface(params) {
- invokeParams('ShowRiverThreeCubeByInterface', {
- "status": params.status,
- "level": params.level,
- "size": params.size
- })
- }
- export function ShowThreeNet(params) {
- invokeParams('ShowThreeNet', {
- "status": params.status,
- "size": params.size,
- "origin": params.origin,
- "buffer": params.buffer,
- "maxHeight": 120,
- "minHeight": 0,
- })
- }
- export function DrawPoint(params) {
- invokeParams('Draw', {
- "type": "point",
- "hasZ": true,
- "status": params.status,
- "symbol": {
- "type": "point-3d",
- "symbolLayers": [{
- "type": "object",
- "width": 20,
- "height": 20,
- "depth": 20,
- "resource": { "primitive": "circle" },
- "material": { "color": [0, 255, 0, 0.8] }
- }]
- }
- })
- }
- export function DrawPath(params) {
- invokeParams('Draw', {
- "type": "polyline",
- "hasZ": true,
- "status": params.status,
- "path": params.path,
- "symbol": {
- "type": "line-3d",
- "symbolLayers": [
- {
- "type": "path",
- "profile": "circle",
- "material": {
- "color": [
- 0,
- 255,
- 0,
- 0.3
- ]
- },
- "width": 10,
- "height": 10
- }
- ]
- }
- })
- }
- export function PathPipe(params) {
- invokeParams('PathPipe', {
- "status": params.status,
- "paths": params.paths,
- "color": "#00FF7F",
- "pipeRadius": 10
- })
- }
- export function hideFlyGLTF(params) {
- invokeParams('FlyGLTF', {
- "uavid": params.uavid,
- "status": "hide"
- })
- }
- export async function PrismEffectService_sfky(params) {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990220240926") + '/1';
- invokeParams('AddSingleLayer', {
- "id": "sfky",
- "title": "飞行空域",
- "visible": params.visible,
- "type": "feature",
- "opacity": 0.6,
- "url": url,
- "elevationInfo": {
- "mode": "on-the-ground"
- },
- "renderer": {
- "type": "simple",
- "symbol": {
- "type": "polygon-3d",
- "symbolLayers": [{
- "type": "extrude",
- "size": 120,
- "material": {
- "color": [
- 4, 138, 255,
- 1
- ],
- },
- "edges": {
- "type": "solid",
- "color": [50, 50, 50, 0.5]
- }
- }]
- }
- }
- })
- }
- export async function PrismEffectService_jkbhq(params) {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990220240926") + '/0';
- invokeParams('AddSingleLayer', {
- "id": "jkbhq",
- "title": "净空保护区",
- "visible": params.visible,
- "type": "feature",
- "opacity": 0.6,
- "url": url,
- "elevationInfo": {
- "mode": "on-the-ground"
- },
- "renderer": {
- "type": "simple",
- "symbol": {
- "type": "polygon-3d",
- "symbolLayers": [{
- "type": "extrude",
- "size": 120,
- "material": {
- "color": [
- 255, 0, 0,
- 1
- ],
- },
- "edges": {
- "type": "solid",
- "color": [50, 50, 50, 0.5]
- }
- }]
- }
- }
- })
- }
- export async function WaterEffect(params) {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D0401010120150601") + '/0';
- invokeParams('WaterEffect', {
- "status": params.status,
- "url": url,
- "direction": 260,
- "strength": "moderate",
- "color": "#25427c"
- })
- }
- export function LimitHeightAnalysis(params) {
- invokeParams('LimitHeightAnalysis', {
- "layerId": "D8503010320240901",
- "status": params.status,
- "limitH": params.start,
- "maxLimitH": params.end,
- "rings": [
- [
- 5734.326828652739,
- 8833.735652138346,
- 0
- ],
- [
- 3738.5816674344023,
- 8812.731486429415,
- 0
- ],
- [
- 3783.7974914766223,
- 6817.002289960246,
- 0
- ],
- [
- 5778.02483719044,
- 6840.510219478308,
- 0
- ]
- ]
- })
- }
- //重点区域定位
- export function importantAreaPosition(x, y, z, heading, tilt, isfly = true) {
- invokeParams('SetLocation', {
- "x": x,
- "y": y,
- "z": z,
- "heading": heading,
- "tilt": tilt,
- "isfly": isfly
- })
- }
- export function FeatureThreeDimension(params) {
- if (params.token) {
- params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
- }
- invokeParams('FeatureThreeDimension', {
- "url": params.url,
- "status": params.status
- })
- }
- //区县聚类
- export function MapClickByType(status) {
- invokeParams('MapClickAll', {
- "status": status,
- "disableLayerIdList": ["districtArea", "districtStreet", "bgFeaturelayer"]
- })
- }
- //点查询
- export function AreaJsonRankShow(params) {
- invokeParams('AreaJsonRankShow', {
- "type": params.type, //qx、jz
- "district": null,
- "id": "AreaTextLayer",
- "title": "文本标绘",
- "status": params.status,
- "data": params.data,
- "symbol": {
- "color": [255, 255, 255, 1],
- "backgroundColor": [77, 161, 194, 0.4],
- "font": {
- "size": 12
- }
- },
- })
- }
- export function ExtentHeight(height) {
- invokeParams('Draw', {
- "type": "polygon",
- "height": height,
- })
- }
- export async function AddBaseMapLayer() {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321");
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMap",
- "title": "BaseMap",
- "visible": true,
- "opacity": 1,
- url
- })
- invokeParams('AddSingleLayer', {
- "id": "BaseMapCSJYaoGan",
- "visible": false,
- })
- showLayersWithScaleEvents({ status: 'hide' })
- }
- export async function AddZhenwuMapLayer() {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265");
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapZhenwu",
- "title": "BaseMapZhenwu",
- "visible": true,
- "opacity": 1,
- url
- })
- invokeParams('AddSingleLayer', {
- "id": "BaseMapCSJYaoGan",
- "visible": false,
- })
- showLayersWithScaleEvents({ status: 'hide' })
- }
- export async function AddYaoganMapLayer() {
- let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036");
- invokeParams('AddBaseMapLayer', {
- "id": "BaseMapYaoGan",
- "title": "BaseMapYaoGan",
- "visible": true,
- "opacity": 1,
- "type": "tile",
- url
- });
- let CSJUrl = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9902002720240801");
- invokeParams('AddSingleLayer', {
- "id": "BaseMapCSJYaoGan",
- "title": "BaseMapCSJYaoGan",
- "visible": true,
- "opacity": 1,
- "type": "tile",
- url: CSJUrl
- })
- showLayersWithScaleEvents({ status: 'show' })
- }
- export function showLayersWithScaleEvents(params) {
- invokeParams('ShowLayersWithScaleEvents', {
- "status": params.status ? "show" : "hide",
- "scale_handle_id": "scale_handle_tileLayerChange",
- });
- }
- //关闭图层
- export function clearAllLayer() {
- invokeParams('ClearMapLayers', {
- })
- }
- export async function heatMap(params) {
- params.url = await returnProxyUrl(params.url) + '/0';
- invokeParams('HeatMap', {
- id: params.id,
- title: params.title,
- visible: params.visible,
- url: params.url
- })
- }
- export async function AddSingleLayer(params) {
- // if(params.token){
- // params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
- // }
- params.url = await returnProxyUrl(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') {
- if (params.title == "全市白模") {
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity,
- "url": params.url + '/SceneServer',
- "where": 'objectid not in (3941595,3841426)',
- "type": "scene",
- "theme": "高度",
- "popupEnabled": false,
- "renderer": {
- "type": "class-breaks",
- "field": "HEIGHT",
- "classBreakInfos": [
- {
- "minValue": 0,
- "maxValue": 10,
- "symbol": {
- "type": "mesh-3d",
- "symbolLayers": [
- {
- "type": "fill",
- "material": {
- "color": [55, 135, 192, 0.7],
- "colorMixMode": "replace"
- },
- "edges": {
- "type": "solid",
- "color": [0, 0, 0, 0.6],
- "size": 1
- }
- }
- ]
- },
- "label": "<10"
- }, {
- "minValue": 10.1,
- "maxValue": 24,
- "symbol": {
- "type": "mesh-3d",
- "symbolLayers": [
- {
- "type": "fill",
- "material": {
- "color": [148, 195, 223, 0.7],
- "colorMixMode": "replace"
- },
- "edges": {
- "type": "solid",
- "color": [0, 0, 0, 0.6],
- "size": 1
- }
- }
- ]
- },
- "label": "10~24"
- }, {
- "minValue": 24.1,
- "maxValue": 100,
- "symbol": {
- "type": "mesh-3d",
- "symbolLayers": [
- {
- "type": "fill",
- "material": {
- "color": [230, 238, 251, 0.7],
- "colorMixMode": "replace"
- },
- "edges": {
- "type": "solid",
- "color": [0, 0, 0, 0.6],
- "size": 1
- }
- }
- ]
- },
- "label": "24~100"
- }, {
- "minValue": 100.1,
- "maxValue": 1000,
- "symbol": {
- "type": "mesh-3d",
- "symbolLayers": [
- {
- "type": "fill",
- "material": {
- "color": [235, 240, 249, 0.7],
- "colorMixMode": "replace"
- },
- "edges": {
- "type": "solid",
- "color": [0, 0, 0, 0.6],
- "size": 1
- }
- }
- ]
- },
- "label": ">100"
- }]
- },
- "mapID": params.mapID
- })
- } else {
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity,
- "url": params.url + '/SceneServer',
- "type": "scene",
- "popupEnabled": false,
- "mapID": params.mapID
- })
- }
- } 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,
- "elevationInfo": { //下沉高度
- mode: "absolute-height",
- offset: -19.5
- },
- "type": "building",
- "mapID": params.mapID
- })
- break
- }
- } else if (params.type == 'mesh') {
- 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") {
- invokeParams('AddSingleLayer', {
- "id": params.id,
- "title": params.title,
- "visible": params.visible,
- "opacity": params.opacity === undefined ? 1 : params.opacity,
- "url": params.url,
- // "sublayers": [
- // {
- // "id": 0
- // },{
- // "id": 1
- // }
- // ],
- "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 == "动态地图") {
- 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
- };
- 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
- })
- }
- }
- export function queryIn2D(params) {
- invokeParams('QueryIn2D', params)
- }
- export function FeaturePolygonPlottingEvent(params) {
- invokeParams('FeaturePolygonPlotting', params)
- }
- export function getRealFlyPoint(params) {
- invokeParams('GetRealFlyPoint', params);
- }
- export function getVirtualFlyPoint(params) {
- invokeParams('GetVirtualFlyPoint', params);
- }
- export function changePointStatus(params) {
- invokeParams('ChangePointStatus', params);
- }
- // 绘制图形:空域划设、起降场划设
- export function drawArea(params) {
- switch (params.drawType) {
- case 'polygon':
- case 'rectangle':
- case 'circle':
- invokeParams('Draw', {
- "type": params.drawType,
- "hasZ": true,
- "status": "show",
- "symbol": {
- "type": "polygon-3d",
- "symbolLayers": [
- {
- "type": "extrude",
- "size": params.height,
- "material": {
- "color": params.color
- }
- }
- ]
- },
- "token": "",
- })
- break;
- case 'point': // 圆锥
- invokeParams('Draw', {
- "type": "point",
- "hasZ": true,
- "status": "show",
- "point": {
- "x": 0,
- "y": 0,
- "z": -10
- },
- "symbol": {
- "type": "point-3d",
- "symbolLayers": [
- {
- "type": "object",
- "width": params.topRadius,
- "height": params.topRadius,
- "depth": params.height,
- "anchor": "origin",
- "resource": {
- "primitive": "inverted-cone"
- },
- "material": {
- "color": params.color
- }
- }
- ]
- },
- "token": ""
- })
- break;
- case 'mesh': // 圆台
- invokeParams('Draw', {
- "type": "mesh",
- "hasZ": true,
- "status": "show",
- "symbol": {
- "bottomRadius": params.bottomRadius,
- "topRadius": params.topRadius,
- "height": params.height,
- "color": params.color
- },
- "token": ""
- })
- break;
- case 'funnel': // 漏斗
- invokeParams('Draw', {
- "type": "funnel",
- "hasZ": true,
- "status": "show",
- "symbol": {
- "bottomRadius": params.bottomRadius,
- "topRadius": params.topRadius,
- "coneHeight": params.topHeight,
- "cylinderHeight": params.bottomHeight,
- "color": params.color
- },
- "token": ""
- })
- break;
- }
- }
- //绘制圆台
- export function drawFrustumCone(params) {
- invokeParams('GeometryMeshFrustumEffect', {
- ...params
- })
- }
- // 航线展示
- export function showRoutePath(params) {
- invokeParams('PathPipe', {
- ...params,
- // "id": "1",
- // "status": "show",
- // "paths": [], //传入路径
- "color": params.color,
- "intensity": 1.2,
- "pipeRadius": 10
- })
- }
- // 航线展示
- export function showVritualRoutePath(params) {
- invokeParams('PathPipe', {
- ...params,
- // "id": "1",
- // "status": "show",
- // "paths": [], //传入路径
- "color": params.color,
- "intensity": 1.2,
- "pipeRadius": 5
- })
- }
- export function symbolPathPipe(params) {
- invokeParams('SymbolPathPipe', {
- ...params,
- // "id": "1",
- // "status": "show",
- // "paths": [], //传入路径
- "color": params.color,
- })
- }
- // 航线展示
- export function showRoadPath(params) {
- invokeParams('PathPipe', {
- ...params,
- // "id": "1",
- // "status": "show",
- // "paths": [], //传入路径
- "color": "#438EDB",
- "intensity": 1.2,
- "pipeRadius": 25
- })
- }
- // 航线规划-自动
- export function drawRouteAuto(params) {
- invokeParams('Draw', {
- "type": "point",
- "hasZ": true,
- "status": "show",
- "clear": false,
- "symbol": {
- "type": "point-3d",
- "symbolLayers": [
- {
- "type": "object",
- "width": 20,
- "height": 20,
- "depth": 20,
- "resource": {
- "primitive": "circle"
- },
- "material": {
- "color": params.color
- }
- }
- ]
- }
- })
- }
- // 航线规划-手动
- export function drawRouteManual(params) {
- invokeParams('Draw', {
- "type": "polyline",
- "hasZ": true,
- "status": params.status,
- "path": params.path,
- "symbol": {
- "type": "line-3d",
- "symbolLayers": [
- {
- "type": "path",
- "profile": "circle",
- "material": {
- "color": [
- 0,
- 149,
- 255,
- 0.3
- ]
- },
- "width": 10,
- "height": 10
- }
- ]
- },
- })
- }
- // 起降场展示
- export function showPlot(params) {
- invokeParams('FeaturePointsPlotting', {
- "status": params.status,
- "data": params.data, //传入数据
- })
- }
- // 起降场划设
- export function drawPlot(params) {
- invokeParams('Draw', {
- "type": "circle",
- "hasZ": true,
- "status": params.status,
- "symbol": {
- "type": "polygon-3d",
- "symbolLayers": [
- {
- "type": "extrude",
- "size": 20,
- "material": {
- "color": [
- 4,
- 138,
- 255,
- 0.3
- ]
- }
- }
- ]
- }
- })
- }
- //显示网格
- export function GetRealPower2(params) {
- invokeParams('GetRealPower2', {
- id: params.id,
- lastId: params.lastId,
- status: params.status,
- fields: params.fields,
- center: params.center,
- radius: params.radius,
- minZ: params.minZ,
- maxZ: params.maxZ,
- level: params.level,
- size: params.size,
- })
- }
- //碰撞预警
- export function pathConflict(params) {
- invokeParams('PathConflict', {
- status: params.status,
- })
- }
- //避让路线
- export function conflict_fly(params) {
- invokeParams('Conflict_fly', {
- status: params.status,
- "uavid": params.uavid,
- "skip_route_id": params.skip_route_id,
- "distance": params.distance,
- })
- }
- // 态势评估
- export function situationAssessment(params) {
- invokeParams('SituationAssessment', {
- status: params.status
- })
- }
- // 清空绘制
- export function clearDraw() {
- invokeParams('Draw', {
- status: "hide",
- })
- }
- // 空域展示
- export function showShapes({ id, data }) {
- invokeParams('GeometryMeshEffect', {
- id,
- status: data ? 'show' : 'hide',
- data
- })
- }
- // 绘制区域
- export function DrawPolygon(params) {
- invokeParams('Draw', {
- type: "polygon",
- clear: true,
- hasZ: params?.hasZ || false,
- token: ""
- })
- }
- // 取消分层
- export function clearLayering(id) {
- invokeParams('FeaturePolygonPlotting', {
- id,
- status: "hide",
- token: ""
- })
- }
- // 绘制分层
- export function drawLayering(params) {
- const heightArr = params.height.split(',').map(h => Number(h))
- invokeParams('FeaturePolygonPlotting', {
- "id": params.id,
- "status": "show",
- "showText": true,
- "data": [
- {
- "attributes": {
- "FID": params.id,
- "id": params.id,
- "name": ""
- },
- "symbol": {
- "height": heightArr[0],
- "size": heightArr[1] - heightArr[0],
- "color": params.color
- },
- "geometry": {
- rings: params.rings.map(s => {
- return s.map(p => {
- return [...p, heightArr[0]]
- })
- })
- }
- }
- ],
- "token": ""
- })
- }
- // 核查网格
- export function InspectCube(params) {
- const actionMap = {
- 'polygon': 'GetPrismCube',
- 'funnel': 'GetFunnelCube',
- 'frustum-cone': 'GetFrustumConeCube',
- 'inverted-cone': 'GetInvertedConeCube',
- 'polyline': 'GetPathCube',
- }
- if (!actionMap[params?.type]) return
- invokeParams(actionMap[params.type], {
- id: params.id.toString(),
- status: params.show ? 'show' : 'hide',
- level: 23,
- token: "",
- ...params.shape
- })
- }
- // 栅格占用查询、空域剖面查询
- export function QueryCube(params) {
- invokeParams(params.evaluation ? 'GetPowerCube' : 'GetOccupyCube', {
- id: params.id || 'QueryCube',
- status: params.show ? 'show' : 'hide',
- level: params.level,
- minZ: params.minZ,
- maxZ: params.maxZ,
- rings: params.rings,
- token: "",
- })
- }
- // 查询行政区划
- export function QueryDistrict(districtArr) {
- const type = districtArr.length === 1 ? "区县" : "街道"
- invokeParams('QueryIn2D', {
- type,
- where: `${type}名称='${districtArr.at(-1)}'`,
- token: ""
- })
- }
- // 比例尺无极切换(空域栅格)
- export function addKysgScale(show) {
- invokeParams('ShowLayersWithScaleEvents', {
- "status": show ? "show" : 'hide',
- "scale_handle_id": "scale_handle_cube",
- "token": ""
- })
- }
|