Merge branch 'develop' of http://xny.yj-3d.com:3000/zh/sdk4.0 into develop
This commit is contained in:
		| @ -1,5 +1,5 @@ | |||||||
| class BaseDialog { | class BaseDialog { | ||||||
|   constructor(container, options = {}) { |   constructor(container, options = {}, only = true) { | ||||||
|     this.container = container |     this.container = container | ||||||
|     this.options = { ...options } |     this.options = { ...options } | ||||||
|     this.options.ismove = true |     this.options.ismove = true | ||||||
| @ -9,10 +9,13 @@ class BaseDialog { | |||||||
|     this.closeCallBack = options.closeCallBack |     this.closeCallBack = options.closeCallBack | ||||||
|     this._element = {} |     this._element = {} | ||||||
|     this._element_style = undefined |     this._element_style = undefined | ||||||
|  |     this.only = only | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   async init() { |   async init() { | ||||||
|  |     if (this.only) { | ||||||
|       this.closeAll() |       this.closeAll() | ||||||
|  |     } | ||||||
|     DialogAll.push(this) |     DialogAll.push(this) | ||||||
|     this.isDestroy = false |     this.isDestroy = false | ||||||
|     // body |     // body | ||||||
| @ -48,6 +51,15 @@ class BaseDialog { | |||||||
|     <button class="close">关闭</button> |     <button class="close">关闭</button> | ||||||
|     ` |     ` | ||||||
|     this._element.body.appendChild(this._element.foot) |     this._element.body.appendChild(this._element.foot) | ||||||
|  |     let curtain = await document.createElement('div') | ||||||
|  |     curtain.style.position = 'absolute' | ||||||
|  |     curtain.style.top = '0' | ||||||
|  |     curtain.style.left = '0' | ||||||
|  |     curtain.style.width = '100%' | ||||||
|  |     curtain.style.height = '100%' | ||||||
|  |     curtain.style.backdropFilter = 'blur(2px)' | ||||||
|  |     curtain.style.zIndex = '-999999' | ||||||
|  |     this._element.body.appendChild(curtain) | ||||||
|  |  | ||||||
|     // 关闭 |     // 关闭 | ||||||
|     let closeBtnsBox = this._element.body.getElementsByClassName('close-box')[0]; |     let closeBtnsBox = this._element.body.getElementsByClassName('close-box')[0]; | ||||||
|  | |||||||
| @ -59,12 +59,17 @@ export default class DrawAttackArrow extends Draw { | |||||||
|           return |           return | ||||||
|         } |         } | ||||||
|         into = '3D' |         into = '3D' | ||||||
|  |         let pos84 = this.cartesian3Towgs84(cartesian, this.viewer) | ||||||
|  |         let lastPos84 = cache_positions[cache_positions.length - 1] | ||||||
|  |         if(lastPos84 && (lastPos84.lng === pos84.lng && lastPos84.lat === pos84.lat)) { | ||||||
|  |           return | ||||||
|  |         } | ||||||
|         if (!this.entityHasCreated) { |         if (!this.entityHasCreated) { | ||||||
|           let polyline_id = DrawAttackArrow.create_arrow_polygon(this) |           let polyline_id = DrawAttackArrow.create_arrow_polygon(this) | ||||||
|           this.points_ids.push(polyline_id) |           this.points_ids.push(polyline_id) | ||||||
|         } |         } | ||||||
|         this.points_ids.push(this.create_point(cartesian)) |         this.points_ids.push(this.create_point(cartesian)) | ||||||
|         cache_positions.push(this.cartesian3Towgs84(cartesian, this.viewer)) |         cache_positions.push(pos84) | ||||||
|         isMove = false |         isMove = false | ||||||
|       }) |       }) | ||||||
|       this.event.mouse_right((movement, cartesian) => { |       this.event.mouse_right((movement, cartesian) => { | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ class DrawPolygon extends Draw { | |||||||
|    * */ |    * */ | ||||||
|   constructor(sdk, options = {}) { |   constructor(sdk, options = {}) { | ||||||
|     super(sdk, options) |     super(sdk, options) | ||||||
|  |     this.color = options.color || 'rgba(255,0,0,0.5)' | ||||||
|     this.polygonHasCreated = false |     this.polygonHasCreated = false | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -34,8 +35,8 @@ class DrawPolygon extends Draw { | |||||||
|           positions: new Cesium.CallbackProperty((e) => { |           positions: new Cesium.CallbackProperty((e) => { | ||||||
|             return that.positions.concat(that.positions[0]) |             return that.positions.concat(that.positions[0]) | ||||||
|           }), |           }), | ||||||
|           width: 2, |           width: 3, | ||||||
|           material: Cesium.Color.fromCssColorString('#c1c505').withAlpha(0.5), |           material: Cesium.Color.fromCssColorString(that.color).withAlpha(1), | ||||||
|           clampToGround: true, |           clampToGround: true, | ||||||
|           zIndex: 99999999 |           zIndex: 99999999 | ||||||
|         }, |         }, | ||||||
|  | |||||||
| @ -1420,11 +1420,11 @@ async function MapPrint(sdk, thumbnailImg, rectangle, originalImg) { | |||||||
|         const url = URL.createObjectURL(blob); |         const url = URL.createObjectURL(blob); | ||||||
|         let downloadElement = document.createElement('a'); |         let downloadElement = document.createElement('a'); | ||||||
|         downloadElement.href = url; |         downloadElement.href = url; | ||||||
|         downloadElement.download = `高清出图-${getDateTimeString()}.jpg`; |         downloadElement.download = `高清出图-${getDateTimeString()}.png`; | ||||||
|         document.body.appendChild(downloadElement); |         document.body.appendChild(downloadElement); | ||||||
|         downloadElement.click(); |         downloadElement.click(); | ||||||
|         document.body.removeChild(downloadElement); |         document.body.removeChild(downloadElement); | ||||||
|       }, 'image/jpeg', 0.95); |       }, 'image/png', 0.95); | ||||||
|       exporting = false; |       exporting = false; | ||||||
|       exportBtn.innerHTML = '打印'; |       exportBtn.innerHTML = '打印'; | ||||||
|       // canvas2.toBlob(function (blob) { |       // canvas2.toBlob(function (blob) { | ||||||
|  | |||||||
| @ -124,7 +124,7 @@ function syncViewer() { | |||||||
|   if (height > 9000000) { |   if (height > 9000000) { | ||||||
|     height = 9000000 |     height = 9000000 | ||||||
|   } |   } | ||||||
|   if (height < 100000) { |   if (height < 400000) { | ||||||
|     this.entity.billboard.show = true |     this.entity.billboard.show = true | ||||||
|     this.entity.rectangle.show = false |     this.entity.rectangle.show = false | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -4,18 +4,38 @@ | |||||||
| import Tools from "../../Tools"; | import Tools from "../../Tools"; | ||||||
| import { getCoordinateSystem } from "../../Global/global"; | import { getCoordinateSystem } from "../../Global/global"; | ||||||
| import MouseEvent from '../../Event/index' | import MouseEvent from '../../Event/index' | ||||||
|  | import { getSdk as get2DSdk } from '../../Global/MultiViewportMode' | ||||||
|  | import { getSdk as getSplitScreenSdk } from "../../Global/SplitScreen"; | ||||||
|  |  | ||||||
| let event | let event | ||||||
|  | let event2 | ||||||
| let MouseCoordinateElm | let MouseCoordinateElm | ||||||
| let requestAnimationFrameEventId | let requestAnimationFrameEventId | ||||||
|  | let tmovement | ||||||
|  | let targetSdk | ||||||
|  | let sdkD | ||||||
|  |  | ||||||
| const MouseCoordinate = (sdk, status) => { | const MouseCoordinate = (sdk, status) => { | ||||||
|  |   if (!sdk || !sdk.viewer) { | ||||||
|  |     return | ||||||
|  |   } | ||||||
|  |   targetSdk = sdk | ||||||
|  |   sdkD = get2DSdk().sdkD | ||||||
|  |   if(!sdkD) { | ||||||
|  |     sdkD = getSplitScreenSdk().sdkD | ||||||
|  |   } | ||||||
|  |  | ||||||
|   let tools = new Tools(sdk) |   let tools = new Tools(sdk) | ||||||
|   if (status) { |   if (status) { | ||||||
|     if (event) { |     if (event) { | ||||||
|       event.destroy() |       event.destroy() | ||||||
|     } |     } | ||||||
|  |     if (event2) { | ||||||
|  |       event2.destroy() | ||||||
|  |       event2 = undefined | ||||||
|  |     } | ||||||
|     event = new MouseEvent(sdk) |     event = new MouseEvent(sdk) | ||||||
|  |     tmovement = null | ||||||
|     let position = { |     let position = { | ||||||
|       x: '', |       x: '', | ||||||
|       y: '', |       y: '', | ||||||
| @ -40,22 +60,60 @@ const MouseCoordinate = (sdk, status) => { | |||||||
|       contentElm.style['background-size'] = `200% 200%`; |       contentElm.style['background-size'] = `200% 200%`; | ||||||
|       MouseCoordinateElm = contentElm |       MouseCoordinateElm = contentElm | ||||||
|     } |     } | ||||||
|     sdk.viewer._element.appendChild(contentElm) |     sdk.viewer.container.appendChild(contentElm) | ||||||
|     let tmovement |  | ||||||
|     event.mouse_move((movement, cartesian) => { |     event.mouse_move((movement, cartesian) => { | ||||||
|       tmovement = { ...movement } |       targetSdk = sdk | ||||||
|  |       tmovement = { ...movement.endPosition } | ||||||
|     }) |     }) | ||||||
|  |  | ||||||
|     const getPosition = () => { |     const getPosition = () => { | ||||||
|       if(!tmovement) { |       if (!targetSdk) { | ||||||
|         return |         return | ||||||
|       } |       } | ||||||
|       let canvas = sdk.viewer._element.getElementsByTagName('canvas')[0] |       let canvas = sdk.viewer._element.getElementsByTagName('canvas')[0] | ||||||
|       let left = tmovement.endPosition.x; |       sdkD = get2DSdk().sdkD | ||||||
|       let top = tmovement.endPosition.y; |       if(!sdkD) { | ||||||
|       let cartesian = event.getcartesian(tmovement) |         sdkD = getSplitScreenSdk().sdkD | ||||||
|       contentElm.style['background-position-x'] = `${-canvas.width + left + 4}px`; |       } | ||||||
|       contentElm.style['background-position-y'] = `${-canvas.height + top - 2}px`; |       if (!event2 && sdkD) { | ||||||
|  |         event2 = new MouseEvent(sdkD) | ||||||
|  |         event2.mouse_move((movement, cartesian) => { | ||||||
|  |           targetSdk = sdkD | ||||||
|  |           tmovement = { x: movement.endPosition.x, y: movement.endPosition.y } | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|  |       if (!tmovement) { | ||||||
|  |         return | ||||||
|  |       } | ||||||
|  |       let left = tmovement.x; | ||||||
|  |       let top = tmovement.y; | ||||||
|  |       let cartesian | ||||||
|  |       if (targetSdk.viewer.scene.mode === 2) { | ||||||
|  |         left = left + canvas.width | ||||||
|  |         cartesian = targetSdk.viewer.camera.pickEllipsoid(tmovement, targetSdk.viewer.scene.globe.ellipsoid) | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         cartesian = targetSdk.viewer.scene.pickPosition(tmovement) | ||||||
|  |         if (!cartesian) { | ||||||
|  |           const ray = targetSdk.viewer.camera.getPickRay(position); //相交的射线 | ||||||
|  |           let pickedObjects = targetSdk.viewer.scene.drillPickFromRay(ray, 10); | ||||||
|  |           let result = {} | ||||||
|  |           for (let i = 0; i < pickedObjects.length; i++) { | ||||||
|  |             if (pickedObjects[i].position) { | ||||||
|  |               result = pickedObjects[i] | ||||||
|  |               break | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |           cartesian = result.position | ||||||
|  |           if (!cartesian) { | ||||||
|  |             cartesian = targetSdk.viewer.scene.globe.pick(ray, targetSdk.viewer.scene); | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       contentElm.style['background-position-x'] = `${-sdk.viewer.container.clientWidth + left + 4}px`; | ||||||
|  |  | ||||||
|  |       contentElm.style['background-position-y'] = `${-sdk.viewer.container.clientHeight + top - 2}px`; | ||||||
|       // this.entity.position = cartesian |       // this.entity.position = cartesian | ||||||
|       if (cartesian) { |       if (cartesian) { | ||||||
|         let degrees = tools.cartesian3Towgs84(cartesian, sdk.viewer) |         let degrees = tools.cartesian3Towgs84(cartesian, sdk.viewer) | ||||||
| @ -97,10 +155,13 @@ const MouseCoordinate = (sdk, status) => { | |||||||
|   else { |   else { | ||||||
|     if (event) { |     if (event) { | ||||||
|       event.destroy() |       event.destroy() | ||||||
|       event = undefined |     } | ||||||
|  |     if (event2) { | ||||||
|  |       event2.destroy() | ||||||
|  |       event2 = undefined | ||||||
|     } |     } | ||||||
|     if (MouseCoordinateElm) { |     if (MouseCoordinateElm) { | ||||||
|       sdk.viewer._element.removeChild(MouseCoordinateElm) |       sdk.viewer.container.removeChild(MouseCoordinateElm) | ||||||
|       MouseCoordinateElm = undefined |       MouseCoordinateElm = undefined | ||||||
|     } |     } | ||||||
|     if (requestAnimationFrameEventId) { |     if (requestAnimationFrameEventId) { | ||||||
|  | |||||||
| @ -49,7 +49,16 @@ async function init(sdk) { | |||||||
|   sdk2D.viewer.imageryLayers.removeAll() |   sdk2D.viewer.imageryLayers.removeAll() | ||||||
|   for (let i = 0; i < imageryLayers.length; i++) { |   for (let i = 0; i < imageryLayers.length; i++) { | ||||||
|     let entity = sdk2D.viewer.imageryLayers.addImageryProvider(imageryLayers[i].imageryProvider, imageryLayers[i]._layerIndex) |     let entity = sdk2D.viewer.imageryLayers.addImageryProvider(imageryLayers[i].imageryProvider, imageryLayers[i]._layerIndex) | ||||||
|  |     if(imageryLayers[i]._id) { | ||||||
|  |       entity._id = imageryLayers[i]._id | ||||||
|  |     } | ||||||
|     entity.show = imageryLayers[i].show |     entity.show = imageryLayers[i].show | ||||||
|  |     entity.alpha = imageryLayers[i].alpha | ||||||
|  |     if (imageryLayers[i]._objectState) { | ||||||
|  |       if (imageryLayers[i]._showView == 3) { | ||||||
|  |         entity.show = false | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|   // sdk.viewer.entities.collectionChanged.addEventListener(syncEntities) |   // sdk.viewer.entities.collectionChanged.addEventListener(syncEntities) | ||||||
|   // sdk.viewer.dataSources.dataSourceAdded.addEventListener(syncDataSources) |   // sdk.viewer.dataSources.dataSourceAdded.addEventListener(syncDataSources) | ||||||
| @ -61,6 +70,12 @@ async function init(sdk) { | |||||||
|     JwwStatusSwitch(sdk2, true) |     JwwStatusSwitch(sdk2, true) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   sdk.entityMap.forEach((item, key) => { | ||||||
|  |     if (item.showView == 2) { | ||||||
|  |       item.showView = 2 | ||||||
|  |     } | ||||||
|  |   }) | ||||||
|  |  | ||||||
| } | } | ||||||
| async function on(sdk) { | async function on(sdk) { | ||||||
|   if (sdk2D) { |   if (sdk2D) { | ||||||
| @ -94,6 +109,11 @@ function off(sdk) { | |||||||
|     activeViewer = null |     activeViewer = null | ||||||
|     syncObject = {} |     syncObject = {} | ||||||
|   } |   } | ||||||
|  |   sdk.entityMap.forEach((item, key) => { | ||||||
|  |     if (item.showView) { | ||||||
|  |       item.show = item.show | ||||||
|  |     } | ||||||
|  |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| async function syncData2(sdk, id, entityId) { | async function syncData2(sdk, id, entityId) { | ||||||
| @ -119,7 +139,11 @@ async function syncData2(sdk, id, entityId) { | |||||||
|         options.heightMode = 0 |         options.heightMode = 0 | ||||||
|         options.height = 0 |         options.height = 0 | ||||||
|       } |       } | ||||||
|       if (!that.type || (that.type !== 'tileset' && that.type !== 'bim' && that.type !== 'glb' && that.type !== 'layer')) { |  | ||||||
|  |       if (!that.type || (that.type !== 'tileset' && that.type !== 'bim' && that.type !== 'glb' && that.type !== 'layer' && that.type !== 'wallStereoscopic')) { | ||||||
|  |         if (that.showView == 3) { | ||||||
|  |           options.show = false | ||||||
|  |         } | ||||||
|         let newObject = await new that.constructor(sdk2D, options) |         let newObject = await new that.constructor(sdk2D, options) | ||||||
|         newObject.onClick = that.onClick |         newObject.onClick = that.onClick | ||||||
|         newObject.onRightClick = that.onRightClick |         newObject.onRightClick = that.onRightClick | ||||||
| @ -207,8 +231,15 @@ async function syncData2(sdk, id, entityId) { | |||||||
|         obj.options.heightReference = 1 |         obj.options.heightReference = 1 | ||||||
|       } |       } | ||||||
|       let options = syncObject.tools.deepCopyObj(obj.options) |       let options = syncObject.tools.deepCopyObj(obj.options) | ||||||
|       if (!obj.type || (obj.type !== 'tileset' && obj.type !== 'bim' && obj.type !== 'glb' && obj.type !== 'layer')) { |       if (!obj.type || (obj.type !== 'tileset' && obj.type !== 'bim' && obj.type !== 'glb' && obj.type !== 'layer' && obj.type !== 'wallStereoscopic')) { | ||||||
|         let target = await new obj.constructor(sdk2D, options) |         if (obj.showView == 3) { | ||||||
|  |           options.show = false | ||||||
|  |         } | ||||||
|  |         let target = await sdk2D.entityMap.get(options.id) | ||||||
|  |         if(target) { | ||||||
|  |           await target.remove() | ||||||
|  |         } | ||||||
|  |         target = await new obj.constructor(sdk2D, options) | ||||||
|         target.onClick = obj.onClick |         target.onClick = obj.onClick | ||||||
|         target.onRightClick = obj.onRightClick |         target.onRightClick = obj.onRightClick | ||||||
|         target.onMouseMove = obj.onMouseMove |         target.onMouseMove = obj.onMouseMove | ||||||
| @ -401,12 +432,26 @@ function syncImageryLayerRemoved(layer, index) { | |||||||
|   sdk2D.viewer.imageryLayers.remove(layer2d) |   sdk2D.viewer.imageryLayers.remove(layer2d) | ||||||
| } | } | ||||||
| function syncImageryLayerShownOrHidden(layer, index, state) { | function syncImageryLayerShownOrHidden(layer, index, state) { | ||||||
|  |   return | ||||||
|   let layer2d = sdk2D.viewer.imageryLayers._layers[index] |   let layer2d = sdk2D.viewer.imageryLayers._layers[index] | ||||||
|  |   let layer3d = sdk3D.viewer.imageryLayers._layers[index] | ||||||
|  |   console.log('layer2d', layer2d, sdk2D, layer3d) | ||||||
|  |  | ||||||
|   if (!layer2d) { |   if (!layer2d) { | ||||||
|     return |     return | ||||||
|   } |   } | ||||||
|  |   if (layer3d._objectState) { | ||||||
|  |     if (!layer3d._showView || layer3d._showView == 2) { | ||||||
|  |       layer2d.show = true | ||||||
|  |     } | ||||||
|  |     if (layer3d._showView == 3) { | ||||||
|  |       layer2d.show = false | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   else { | ||||||
|     layer2d.show = state |     layer2d.show = state | ||||||
|   } |   } | ||||||
|  | } | ||||||
|  |  | ||||||
| async function syncPrimitives(primitive) { | async function syncPrimitives(primitive) { | ||||||
|   if (!sdk3D) { |   if (!sdk3D) { | ||||||
| @ -535,6 +580,7 @@ function syncViewer() { | |||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| function get2DView() { | function get2DView() { | ||||||
|   return sdk2D |   return sdk2D | ||||||
| } | } | ||||||
|  | |||||||
| @ -517,7 +517,7 @@ async function setSplitDirection(v, id, isoff = false, entityId) { | |||||||
|             thatD.textShow = thatP.textShow |             thatD.textShow = thatP.textShow | ||||||
|           } |           } | ||||||
|           if (thatP.label && thatP.labelShow) { |           if (thatP.label && thatP.labelShow) { | ||||||
|             thatP.label.entity.show = true |             thatP.labelShow = true | ||||||
|           } |           } | ||||||
|           if (thatD.label) { |           if (thatD.label) { | ||||||
|             thatD.label.options.ground = false |             thatD.label.options.ground = false | ||||||
|  | |||||||
| @ -121,6 +121,9 @@ function MouseRightMenu(sdk, status, callBack) { | |||||||
|         <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;"> |         <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;"> | ||||||
|           <li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li> |           <li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li> | ||||||
|         </ul> |         </ul> | ||||||
|  |         <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;"> | ||||||
|  |           <li style="padding: 3px 10px;cursor: pointer;">文本框</li> | ||||||
|  |         </ul> | ||||||
|         ${addedMenu} |         ${addedMenu} | ||||||
|       ` |       ` | ||||||
|         _element.appendChild(menuElm) |         _element.appendChild(menuElm) | ||||||
| @ -175,6 +178,7 @@ function MouseRightMenu(sdk, status, callBack) { | |||||||
|                 break |                 break | ||||||
|               case '文本框': |               case '文本框': | ||||||
|                 object.position = position |                 object.position = position | ||||||
|  |                 key = 'textBox' | ||||||
|                 break |                 break | ||||||
|             } |             } | ||||||
|             eventListener[sdk.div_id].callBack(key, object) |             eventListener[sdk.div_id].callBack(key, object) | ||||||
|  | |||||||
| @ -91,7 +91,7 @@ class MeasureDistance extends Measure { | |||||||
|  |  | ||||||
|  |  | ||||||
|     //暂时固定取20个点 |     //暂时固定取20个点 | ||||||
|     if (d > 20) {//大于20m时,固定取20个点 |     if (d > 2) {//大于20m时,固定取20个点 | ||||||
|       meters = d / 20 |       meters = d / 20 | ||||||
|       await start(meters) |       await start(meters) | ||||||
|     } else if (d < 1) { |     } else if (d < 1) { | ||||||
| @ -106,8 +106,8 @@ class MeasureDistance extends Measure { | |||||||
|  |  | ||||||
|  |  | ||||||
|   async sampleHeight(p1, index) { |   async sampleHeight(p1, index) { | ||||||
|     let p2 = await this.sampleHeightMostDetailed([p1]) |     let height = await this.getClampToHeight(p1, [...this.sdk.viewer.entities.values]) | ||||||
|     p1.alt = p2[0].height |     p1.alt = height | ||||||
|     return {position: p1, index} |     return {position: p1, index} | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | |||||||
| @ -47,6 +47,11 @@ class ContourAnalysis { | |||||||
|     YJ.Analysis.AnalysesResults.push(this) |     YJ.Analysis.AnalysesResults.push(this) | ||||||
|     this.createNewLine(); |     this.createNewLine(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   get type() { | ||||||
|  |     return 'ContourAnalysis' | ||||||
|  |   } | ||||||
|  |  | ||||||
|   createNewLine() { |   createNewLine() { | ||||||
|     ContourAnalysis.interpolatePoint(this); |     ContourAnalysis.interpolatePoint(this); | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -63,11 +63,15 @@ class VisibilityAnalysis extends Tools { | |||||||
|         that.tip.set_text("左键创建视角终点,右键结束通视分析") |         that.tip.set_text("左键创建视角终点,右键结束通视分析") | ||||||
|         if (!that.resultObject.viewPoint) { |         if (!that.resultObject.viewPoint) { | ||||||
|           let pos84 = that.cartesian3Towgs84(cartesian, that.viewer) |           let pos84 = that.cartesian3Towgs84(cartesian, that.viewer) | ||||||
|           let positions = await Cesium.sampleTerrainMostDetailed( |           let positions | ||||||
|  |           if(that.sdk.viewer.terrainProvider.availability) | ||||||
|  |           { | ||||||
|  |             positions = await Cesium.sampleTerrainMostDetailed( | ||||||
|               that.sdk.viewer.terrainProvider, |               that.sdk.viewer.terrainProvider, | ||||||
|               [Cesium.Cartographic.fromDegrees(pos84.lng, pos84.lat)] |               [Cesium.Cartographic.fromDegrees(pos84.lng, pos84.lat)] | ||||||
|             ); |             ); | ||||||
|           if (positions[0].height > pos84.alt) { |           } | ||||||
|  |           if (positions && positions[0].height > pos84.alt) { | ||||||
|             pos84.alt = positions[0].height |             pos84.alt = positions[0].height | ||||||
|           } |           } | ||||||
|           pos84.alt = pos84.alt + that.viewPointHeight |           pos84.alt = pos84.alt + that.viewPointHeight | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ class AssembleObject extends Base { | |||||||
|     this.options.positions = options.positions || [] |     this.options.positions = options.positions || [] | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     this.entity |     this.entity | ||||||
|     this.event = new MouseEvent(this.sdk) |     this.event = new MouseEvent(this.sdk) | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ class AttackArrowObject extends Base { | |||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     this.entity |     this.entity | ||||||
|     this.event = new MouseEvent(this.sdk) |     this.event = new MouseEvent(this.sdk) | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ | |||||||
| import Dialog from '../../../Element/Dialog'; | import Dialog from '../../../Element/Dialog'; | ||||||
| import CoordTransform from "../../../../transform/CoordTransform"; | import CoordTransform from "../../../../transform/CoordTransform"; | ||||||
| import BaseSource from "../index"; | import BaseSource from "../index"; | ||||||
| import { syncData } from '../../../../Global/MultiViewportMode' | import { syncData, get2DView } from '../../../../Global/MultiViewportMode' | ||||||
| import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData } from '../../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' | ||||||
|  |  | ||||||
| @ -244,8 +244,19 @@ class BaseLayer extends BaseSource { | |||||||
|         this.originalOptions = this.deepCopyObj(this.options) |         this.originalOptions = this.deepCopyObj(this.options) | ||||||
|         this._DialogObject.close() |         this._DialogObject.close() | ||||||
|         this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions) |         this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions) | ||||||
|         syncData(this.sdk, this.options.id) |         // syncData(this.sdk, this.options.id) | ||||||
|         syncSplitData(this.sdk, this.options.id) |         syncSplitData(this.sdk, this.options.id) | ||||||
|  |         let sdk2D = get2DView() | ||||||
|  |         if (sdk2D && sdk2D != this.sdk) { | ||||||
|  |           for(let i=0;i<sdk2D.viewer.imageryLayers._layers.length;i++) { | ||||||
|  |             let layer = sdk2D.viewer.imageryLayers._layers[i] | ||||||
|  |             if(layer._id && layer._id == this.options.id) { | ||||||
|  |               layer.alpha = this.options.alpha | ||||||
|  |               break | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |  | ||||||
|  |         } | ||||||
|       }, |       }, | ||||||
|       closeCallBack: () => { |       closeCallBack: () => { | ||||||
|         this.reset() |         this.reset() | ||||||
|  | |||||||
| @ -56,7 +56,7 @@ function html(that) { | |||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|       <div class="col"> |       <div class="col"> | ||||||
|         <span class="label">固定大小</span> |         <span class="label" style="flex: 0 0 60px;">固定大小</span> | ||||||
|         <input class="btn-switch" type="checkbox" @model="scaleByDistance"> |         <input class="btn-switch" type="checkbox" @model="scaleByDistance"> | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|  | |||||||
| @ -78,6 +78,11 @@ class BaseTerrain extends BaseSource { | |||||||
|   close() { |   close() { | ||||||
|     this.sdk.viewer.scene.terrainProvider = |     this.sdk.viewer.scene.terrainProvider = | ||||||
|       new Cesium.EllipsoidTerrainProvider({}) |       new Cesium.EllipsoidTerrainProvider({}) | ||||||
|  |     for (let i = 0; i < YJ.Analysis.AnalysesResults.length; i++) { | ||||||
|  |       if (YJ.Analysis.AnalysesResults[i].type === 'ContourAnalysis') { | ||||||
|  |         YJ.Analysis.AnalysesResults[i].destroy() | ||||||
|  |       } | ||||||
|  |     } | ||||||
|     syncSplitData(this.sdk, this.options.id) |     syncSplitData(this.sdk, this.options.id) | ||||||
|  |  | ||||||
|     clearTimeout(this.#updateModelTimeout) |     clearTimeout(this.#updateModelTimeout) | ||||||
|  | |||||||
| @ -40,6 +40,11 @@ import { | |||||||
| import { getGoodsList } from '../../../Tools/getGoodsList' | import { getGoodsList } from '../../../Tools/getGoodsList' | ||||||
|  |  | ||||||
| class BillboardObject extends Base { | class BillboardObject extends Base { | ||||||
|  |   #_postRenderEvent = null | ||||||
|  |   #_destroyMouseEvent = null | ||||||
|  |   #_billboardHeight = 0 | ||||||
|  |  | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * @constructor |    * @constructor | ||||||
|    * @description 创建点标注 |    * @description 创建点标注 | ||||||
| @ -118,6 +123,7 @@ class BillboardObject extends Base { | |||||||
|     this.options.positions.alt = Number( |     this.options.positions.alt = Number( | ||||||
|       Number(options.positions.alt || 0).toFixed(2) |       Number(options.positions.alt || 0).toFixed(2) | ||||||
|     ) |     ) | ||||||
|  |     this.#_billboardHeight = this.options.positions.alt | ||||||
|     // this.options.diffuseShow = options.diffuseShow || false |     // this.options.diffuseShow = options.diffuseShow || false | ||||||
|     // this.options.diffuseRadius = (options.diffuseRadius || options.diffuseRadius === 0) ? options.diffuseRadius : 10 |     // this.options.diffuseRadius = (options.diffuseRadius || options.diffuseRadius === 0) ? options.diffuseRadius : 10 | ||||||
|     // this.options.diffuseDuration = (options.diffuseDuration || options.diffuseDuration === 0) ? options.diffuseDuration : 2000 |     // this.options.diffuseDuration = (options.diffuseDuration || options.diffuseDuration === 0) ? options.diffuseDuration : 2000 | ||||||
| @ -145,11 +151,18 @@ class BillboardObject extends Base { | |||||||
|       this.options.attribute.goods.content || [] |       this.options.attribute.goods.content || [] | ||||||
|     this.options.attributeType = options.attributeType || 'richText' |     this.options.attributeType = options.attributeType || 'richText' | ||||||
|     this.options.coordinate = options.coordinate || '' |     this.options.coordinate = options.coordinate || '' | ||||||
|  |     this.options.attributeBoxState = options.attributeBoxState || false | ||||||
|     this.operate = {} |     this.operate = {} | ||||||
|     this._elms = {} |     this._elms = {} | ||||||
|     this.previous = { |     this.previous = { | ||||||
|       positions: { ...this.options.positions } |       positions: { ...this.options.positions } | ||||||
|     } |     } | ||||||
|  |     this.options.attributePos = options.attributePos || { | ||||||
|  |       x: 60, | ||||||
|  |       y: 60, | ||||||
|  |       width: 200, | ||||||
|  |       height: 120 | ||||||
|  |     } | ||||||
|     this.entity |     this.entity | ||||||
|     this._proj = this.sdk.proj |     this._proj = this.sdk.proj | ||||||
|  |  | ||||||
| @ -182,7 +195,108 @@ class BillboardObject extends Base { | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     this.#_destroyMouseEvent = () => { | ||||||
|  |       this.attributeElm && (this.attributeElm.style.pointerEvents = 'unset') | ||||||
|  |       this.sdk.viewer._element.onmousemove = null | ||||||
|  |       document.removeEventListener('mouseup', this.#_destroyMouseEvent) | ||||||
|  |       document.removeEventListener('mouseleave', this.#_destroyMouseEvent) | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     this.#_postRenderEvent = () => { | ||||||
|  |       let siteInfoPosition = Cesium.Cartesian3.fromDegrees( | ||||||
|  |         this.options.positions.lng, | ||||||
|  |         this.options.positions.lat, | ||||||
|  |         this.#_billboardHeight | ||||||
|  |       ) | ||||||
|  |       if (this.attributeElm && this.entity) { | ||||||
|  |         let winpos = this.sdk.viewer.scene.cartesianToCanvasCoordinates( | ||||||
|  |           siteInfoPosition | ||||||
|  |         ) | ||||||
|  |         let pixelOffset = this.entity.label.pixelOffset.getValue() | ||||||
|  |         if (winpos) { | ||||||
|  |           let scale = getCurrentBillboardScale(this.entity, this.sdk.viewer.scene) | ||||||
|  |           let height = ((this.entity.billboard.height.getValue() * (this.options.billboard.scale || 0)) + this.options.label.fontSize) * (1 - (scale * scale)) | ||||||
|  |           let flag = false | ||||||
|  |           let lineElm = this.attributeElm.getElementsByClassName('billboard-attribute-box-line')[0] | ||||||
|  |           let leftTopElm = this.attributeElm.getElementsByClassName('left-top')[0] | ||||||
|  |           let rightTopElm = this.attributeElm.getElementsByClassName('right-top')[0] | ||||||
|  |           this.attributeElm.style.left = (winpos.x + this.options.attributePos.x).toFixed(0) + 'px' | ||||||
|  |           this.attributeElm.style.top = (winpos.y + pixelOffset.y - (this.options.label.show ? (this.options.label.fontSize / 2) : -(this.options.label.fontSize / 2)) - this.attributeElm.offsetHeight - this.options.attributePos.y + height).toFixed(0) + 'px' | ||||||
|  |           this.attributeElm.style.width = this.options.attributePos.width + 'px' | ||||||
|  |           this.attributeElm.style.height = this.options.attributePos.height + 'px' | ||||||
|  |           if (this.options.attributePos.x < -this.options.attributePos.width / 2) { | ||||||
|  |             flag = true | ||||||
|  |             lineElm.style.left = 'unset' | ||||||
|  |             lineElm.style.right = '0' | ||||||
|  |             leftTopElm.style.display = 'block' | ||||||
|  |             rightTopElm.style.display = 'none' | ||||||
|  |           } | ||||||
|  |           else { | ||||||
|  |             lineElm.style.left = '0' | ||||||
|  |             lineElm.style.right = 'unset' | ||||||
|  |             leftTopElm.style.display = 'none' | ||||||
|  |             rightTopElm.style.display = 'block' | ||||||
|  |           } | ||||||
|  |  | ||||||
|  |           let lineLength | ||||||
|  |           let lineAngleRad | ||||||
|  |           let lineAngle | ||||||
|  |           let x | ||||||
|  |           let y | ||||||
|  |           if (flag) { | ||||||
|  |             x = this.attributeElm.offsetWidth + this.options.attributePos.x | ||||||
|  |             y = this.options.attributePos.y ? this.options.attributePos.y : 0 | ||||||
|  |           } | ||||||
|  |           else { | ||||||
|  |             x = this.options.attributePos.x | ||||||
|  |             y = this.options.attributePos.y ? this.options.attributePos.y : 0 | ||||||
|  |           } | ||||||
|  |           lineLength = Math.sqrt((x * x) + (y * y)).toFixed(2); | ||||||
|  |           lineAngleRad = Math.atan(x / y); | ||||||
|  |           lineAngle = parseFloat((lineAngleRad * 180 / Math.PI).toFixed(2)); | ||||||
|  |           if (this.options.attributePos.y < 0) { | ||||||
|  |             lineAngle = lineAngle + 180 | ||||||
|  |           } | ||||||
|  |           // if(this.options.attributePos.y<-this.options.attributePos.height/2) { | ||||||
|  |           //   lineElm.style.bottom = 'unset' | ||||||
|  |           //   lineElm.style.top = '0' | ||||||
|  |           // } | ||||||
|  |           // else { | ||||||
|  |           //   lineElm.style.bottom = -lineLength + 'px' | ||||||
|  |           //   lineElm.style.top = 'unset' | ||||||
|  |           // } | ||||||
|  |           lineElm.style.height = lineLength + 'px' | ||||||
|  |           lineElm.style.transform = 'rotate(' + lineAngle + 'deg)' | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     function getCurrentBillboardScale(entity, scene) { | ||||||
|  |       // 获取相机到Billboard的距离 | ||||||
|  |       const distance = Cesium.Cartesian3.distance( | ||||||
|  |         scene.camera.positionWC, | ||||||
|  |         entity.position.getValue() | ||||||
|  |       ); | ||||||
|  |       // 获取缩放距离配置 | ||||||
|  |       const scaleByDistance = entity.billboard.scaleByDistance ? entity.billboard.scaleByDistance.getValue() : undefined; | ||||||
|  |  | ||||||
|  |       if (!scaleByDistance) { | ||||||
|  |         // 如果没有设置距离缩放,则使用基础缩放值 | ||||||
|  |         return 1.0; | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       // 解析缩放距离参数 [near, nearScale, far, farScale] | ||||||
|  |       const { near, nearValue, far, farValue } = scaleByDistance; | ||||||
|  |       if (distance <= near) { | ||||||
|  |         return nearValue; | ||||||
|  |       } else if (distance >= far) { | ||||||
|  |         return farValue; | ||||||
|  |       } else { | ||||||
|  |         // 计算中间距离的缩放值(线性插值) | ||||||
|  |         const t = (distance - near) / (far - near); | ||||||
|  |         return Cesium.Math.lerp(nearValue, farValue, t); | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     this.sdk.addIncetance(this.options.id, this) |     this.sdk.addIncetance(this.options.id, this) | ||||||
| @ -243,6 +357,7 @@ class BillboardObject extends Base { | |||||||
|             that.entity.billboard.imgHeight = 0 |             that.entity.billboard.imgHeight = 0 | ||||||
|             that.entity.billboard.image = canvas |             that.entity.billboard.image = canvas | ||||||
|             addCluster(that.sdk, that.entity) |             addCluster(that.sdk, that.entity) | ||||||
|  |             that.attributeBoxState && (that.attributeBoxState = true) | ||||||
|           } |           } | ||||||
|           return |           return | ||||||
|         } |         } | ||||||
| @ -267,6 +382,7 @@ class BillboardObject extends Base { | |||||||
|             return img |             return img | ||||||
|           }, false) |           }, false) | ||||||
|           addCluster(that.sdk, that.entity) |           addCluster(that.sdk, that.entity) | ||||||
|  |           that.attributeBoxState && (that.attributeBoxState = true) | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     } |     } | ||||||
| @ -298,6 +414,7 @@ class BillboardObject extends Base { | |||||||
|           that.entity.billboard.imgHeight = height |           that.entity.billboard.imgHeight = height | ||||||
|           that.entity.billboard.image = canvas |           that.entity.billboard.image = canvas | ||||||
|           addCluster(that.sdk, that.entity) |           addCluster(that.sdk, that.entity) | ||||||
|  |           that.attributeBoxState && (that.attributeBoxState = true) | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|       image.onerror = function (err) { |       image.onerror = function (err) { | ||||||
| @ -309,6 +426,7 @@ class BillboardObject extends Base { | |||||||
|           that.entity.billboard.imgHeight = 0 |           that.entity.billboard.imgHeight = 0 | ||||||
|           that.entity.billboard.image = canvas |           that.entity.billboard.image = canvas | ||||||
|           addCluster(that.sdk, that.entity) |           addCluster(that.sdk, that.entity) | ||||||
|  |           that.attributeBoxState && (that.attributeBoxState = true) | ||||||
|         } |         } | ||||||
|       }; |       }; | ||||||
|     } |     } | ||||||
| @ -465,14 +583,45 @@ class BillboardObject extends Base { | |||||||
|     return this.options.show |     return this.options.show | ||||||
|   } |   } | ||||||
|   set show(v) { |   set show(v) { | ||||||
|  |     if (!this.isShowView) { | ||||||
|       this.options.show = v |       this.options.show = v | ||||||
|       this.originalOptions.show = v |       this.originalOptions.show = v | ||||||
|     this.entity && (this.entity.show = v) |     } | ||||||
|  |     if (!this.showView || this.showView == 3) { | ||||||
|  |       this.entity && (this.entity.show = this.options.show) | ||||||
|  |       if (this.attributeBoxState && this.options.show) { | ||||||
|  |         this.attributeBoxState = this.options.show | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         // 关闭属性框 | ||||||
|  |         document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |         document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |         if (this.attributeElm) { | ||||||
|  |           this.sdk.viewer._element.removeChild(this.attributeElm) | ||||||
|  |           this.attributeElm = null | ||||||
|  |         } | ||||||
|  |         this.sdk.viewer.scene.postRender.removeEventListener(this.#_postRenderEvent) | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       this.entity && (this.entity.show = false) | ||||||
|  |       // 关闭属性框 | ||||||
|  |       document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |       document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |       if (this.attributeElm) { | ||||||
|  |         this.sdk.viewer._element.removeChild(this.attributeElm) | ||||||
|  |         this.attributeElm = null | ||||||
|  |       } | ||||||
|  |       this.sdk.viewer.scene.postRender.removeEventListener(this.#_postRenderEvent) | ||||||
|  |     } | ||||||
|     syncData(this.sdk, this.options.id) |     syncData(this.sdk, this.options.id) | ||||||
|     syncSplitData(this.sdk, this.options.id) |     syncSplitData(this.sdk, this.options.id) | ||||||
|  |  | ||||||
|     if (this._DialogObject && this._DialogObject.showBtn) { |     if (this._DialogObject && this._DialogObject.showBtn) { | ||||||
|       this._DialogObject.showBtn.checked = v |       this._DialogObject.showBtn.checked = this.options.show | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     this.isShowView = false | ||||||
|     // if (v) { |     // if (v) { | ||||||
|     //   if (this.diffuseShow) { |     //   if (this.diffuseShow) { | ||||||
|     //     this.diffuseShow = true |     //     this.diffuseShow = true | ||||||
| @ -552,6 +701,26 @@ class BillboardObject extends Base { | |||||||
|     if (this.entity) { |     if (this.entity) { | ||||||
|       this.entity.billboard.heightReference = heightMode |       this.entity.billboard.heightReference = heightMode | ||||||
|       this.entity.label.heightReference = heightMode |       this.entity.label.heightReference = heightMode | ||||||
|  |       if(heightMode == Cesium.HeightReference.CLAMP_TO_GROUND) { | ||||||
|  |         if (this.sdk.viewer.scene.terrainProvider.availability) { | ||||||
|  |           Cesium.sampleTerrainMostDetailed( | ||||||
|  |             this.sdk.viewer.scene.terrainProvider, | ||||||
|  |             [ | ||||||
|  |               Cesium.Cartographic.fromDegrees( | ||||||
|  |                 this.options.positions.lng, | ||||||
|  |                 this.options.positions.lat | ||||||
|  |               ) | ||||||
|  |             ] | ||||||
|  |           ).then(position => { | ||||||
|  |             this.#_billboardHeight = position[0].height | ||||||
|  |           }) | ||||||
|  |         } else { | ||||||
|  |           this.#_billboardHeight = 0 | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.#_billboardHeight = this.options.positions.alt | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|     this._elms.heightMode && (this._elms.heightMode.value = heightModeName) |     this._elms.heightMode && (this._elms.heightMode.value = heightModeName) | ||||||
|   } |   } | ||||||
| @ -606,6 +775,7 @@ class BillboardObject extends Base { | |||||||
|   } |   } | ||||||
|   set alt(v) { |   set alt(v) { | ||||||
|     this.options.positions.alt = Number(Number(v).toFixed(2)) |     this.options.positions.alt = Number(Number(v).toFixed(2)) | ||||||
|  |     this.#_billboardHeight = this.options.positions.alt | ||||||
|     // this.scan && (this.scan.alt = v) |     // this.scan && (this.scan.alt = v) | ||||||
|     // this.diffuse && (this.diffuse.alt = v) |     // this.diffuse && (this.diffuse.alt = v) | ||||||
|     this.renewPoint() |     this.renewPoint() | ||||||
| @ -766,6 +936,8 @@ class BillboardObject extends Base { | |||||||
|       _this._frameImages = [] |       _this._frameImages = [] | ||||||
|       superGif.load(function (status) { |       superGif.load(function (status) { | ||||||
|         if (status == 404) { |         if (status == 404) { | ||||||
|  |           let width = 31 | ||||||
|  |           let height = 36 | ||||||
|           canvas = document.createElement('canvas') |           canvas = document.createElement('canvas') | ||||||
|           canvas.width = 0 |           canvas.width = 0 | ||||||
|           canvas.height = 0 |           canvas.height = 0 | ||||||
| @ -855,6 +1027,8 @@ class BillboardObject extends Base { | |||||||
|         billboardH = height * (31 / width) |         billboardH = height * (31 / width) | ||||||
|       } |       } | ||||||
|       image.onerror = function (err) { |       image.onerror = function (err) { | ||||||
|  |         let width = 31 | ||||||
|  |         let height = 36 | ||||||
|         canvas.width = 0 |         canvas.width = 0 | ||||||
|         canvas.height = 0 |         canvas.height = 0 | ||||||
|         billboardH = 0 |         billboardH = 0 | ||||||
| @ -1702,6 +1876,22 @@ class BillboardObject extends Base { | |||||||
|         this.cameraSelect && this.cameraSelect() |         this.cameraSelect && this.cameraSelect() | ||||||
|         this.ISCSelect && this.ISCSelect() |         this.ISCSelect && this.ISCSelect() | ||||||
|         this.goodsSelect && this.goodsSelect() |         this.goodsSelect && this.goodsSelect() | ||||||
|  |  | ||||||
|  |         let col = document.createElement('div') | ||||||
|  |         col.className = 'col' | ||||||
|  |         col.style.flex = '0 0 110px' | ||||||
|  |         col.innerHTML = ` | ||||||
|  |           <span class="label">属性框</span> | ||||||
|  |           <input class="btn-switch" type="checkbox"> | ||||||
|  |         ` | ||||||
|  |  | ||||||
|  |         let row = this._DialogObject._element.content.getElementsByClassName('attribute')[0].getElementsByClassName('row')[0] | ||||||
|  |         row.appendChild(col) | ||||||
|  |         let boxSwitch = col.getElementsByClassName('btn-switch')[0] | ||||||
|  |         boxSwitch.checked = this.attributeBoxState | ||||||
|  |         boxSwitch.addEventListener('change', (e) => { | ||||||
|  |           this.attributeBoxState = boxSwitch.checked | ||||||
|  |         }) | ||||||
|         let tagData = this.attributeSelect |         let tagData = this.attributeSelect | ||||||
|         let attributeElm = this._DialogObject._element.content.getElementsByClassName( |         let attributeElm = this._DialogObject._element.content.getElementsByClassName( | ||||||
|           'attribute-select-box' |           'attribute-select-box' | ||||||
| @ -2213,6 +2403,7 @@ class BillboardObject extends Base { | |||||||
|     this.attributeCamera = this.options.attribute.camera.content |     this.attributeCamera = this.options.attribute.camera.content | ||||||
|     this.attributeGoods = this.options.attribute.goods.content |     this.attributeGoods = this.options.attribute.goods.content | ||||||
|     this.attributeISC = this.options.attribute.ISC.content |     this.attributeISC = this.options.attribute.ISC.content | ||||||
|  |     this.attributeBoxState = this.options.attributeBoxState | ||||||
|     this.cameraSelect && this.cameraSelect() |     this.cameraSelect && this.cameraSelect() | ||||||
|     this.goodsSelect && this.goodsSelect() |     this.goodsSelect && this.goodsSelect() | ||||||
|   } |   } | ||||||
| @ -2220,6 +2411,7 @@ class BillboardObject extends Base { | |||||||
|   async remove() { |   async remove() { | ||||||
|     await remove_entity_from_cluster(this.sdk.viewer, this.entity) |     await remove_entity_from_cluster(this.sdk.viewer, this.entity) | ||||||
|     this.entity = null |     this.entity = null | ||||||
|  |     this.attributeBoxState = false | ||||||
|     if (!this.sdk.viewer || !this.sdk.viewer.entities) { |     if (!this.sdk.viewer || !this.sdk.viewer.entities) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
| @ -2344,6 +2536,9 @@ class BillboardObject extends Base { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async updateHeight() { |   async updateHeight() { | ||||||
|  |     if (!this.sdk || !this.sdk.viewer || !this.sdk.viewer.scene) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|     let height |     let height | ||||||
|     let height2 |     let height2 | ||||||
|     let point1 = new Cesium.Cartesian3.fromDegrees( |     let point1 = new Cesium.Cartesian3.fromDegrees( | ||||||
| @ -2422,6 +2617,7 @@ class BillboardObject extends Base { | |||||||
|           switch (this._elms.heightMode.value) { |           switch (this._elms.heightMode.value) { | ||||||
|             case '海拔高度': |             case '海拔高度': | ||||||
|               heightElm.value = this.options.positions.alt |               heightElm.value = this.options.positions.alt | ||||||
|  |               this.#_billboardHeight = this.options.positions.alt | ||||||
|               break |               break | ||||||
|             case '相对地表': |             case '相对地表': | ||||||
|               if (this.sdk.viewer.scene.terrainProvider.availability) { |               if (this.sdk.viewer.scene.terrainProvider.availability) { | ||||||
| @ -2437,15 +2633,18 @@ class BillboardObject extends Base { | |||||||
|                   heightElm.value = Number( |                   heightElm.value = Number( | ||||||
|                     (this.options.positions.alt - position[0].height).toFixed(2) |                     (this.options.positions.alt - position[0].height).toFixed(2) | ||||||
|                   ) |                   ) | ||||||
|  |                   this.#_billboardHeight = this.options.positions.alt | ||||||
|                 }) |                 }) | ||||||
|               } else { |               } else { | ||||||
|                 heightElm.value = this.options.positions.alt |                 heightElm.value = this.options.positions.alt | ||||||
|  |                 this.#_billboardHeight = this.options.positions.alt | ||||||
|               } |               } | ||||||
|               break |               break | ||||||
|             case '依附地表': |             case '依附地表': | ||||||
|               break |               break | ||||||
|             case '依附模型': |             case '依附模型': | ||||||
|               heightElm.value = this.options.positions.alt |               heightElm.value = this.options.positions.alt | ||||||
|  |               this.#_billboardHeight = this.options.positions.alt | ||||||
|               break |               break | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
| @ -2719,6 +2918,216 @@ class BillboardObject extends Base { | |||||||
|         (this.originalOptions.customView = this.options.customView) |         (this.originalOptions.customView = this.options.customView) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   get attributeBoxState() { | ||||||
|  |     return this.options.attributeBoxState | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   set attributeBoxState(state) { | ||||||
|  |     state = state ? true : false | ||||||
|  |     this.options.attributeBoxState = state | ||||||
|  |     document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |     document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |     if (this.attributeElm) { | ||||||
|  |       this.sdk.viewer._element.removeChild(this.attributeElm) | ||||||
|  |       this.attributeElm = null | ||||||
|  |     } | ||||||
|  |     this.sdk.viewer.scene.postRender.removeEventListener(this.#_postRenderEvent) | ||||||
|  |     if (state && this.sdk && this.sdk.viewer && this.sdk.viewer._element && this.show) { | ||||||
|  |       let attributeElm = document.createElement('div') | ||||||
|  |       this.attributeElm = attributeElm | ||||||
|  |       attributeElm.className = 'billboard-attribute-box' | ||||||
|  |       attributeElm.style.top = '0px' | ||||||
|  |       attributeElm.style.left = '0px' | ||||||
|  |       attributeElm.style.width = 0 | ||||||
|  |       attributeElm.style.height = 0 | ||||||
|  |       // attributeElm.innerHTML = this.options.richTextContent | ||||||
|  |       this.sdk.viewer._element.appendChild(attributeElm) | ||||||
|  |       let linkHtml = '' | ||||||
|  |       let goodsHtml = '' | ||||||
|  |       let richTextHtml = '' | ||||||
|  |       for (let i = 0; i < this.options.attribute.link.content.length; i++) { | ||||||
|  |         linkHtml += `<DIV-cy-tab-pane label="${this.options.attribute.link.content[i].name}"><iframe width='100%' height='100%' src="${this.options.attribute.link.content[i].url}"></iframe></DIV-cy-tab-pane>` | ||||||
|  |       } | ||||||
|  |       if (this.options.attribute.goods && this.options.attribute.goods.content && this.options.attribute.goods.content.length > 0) { | ||||||
|  |         goodsHtml += `<DIV-cy-tab-pane label="物资"> | ||||||
|  |         <div class="table"> | ||||||
|  |           <div class="table-head"> | ||||||
|  |             <div class="tr"> | ||||||
|  |               <div class="th" style="width: 20%; flex: 0 20%;">序号</div> | ||||||
|  |               <div class="th" style="width: 40%; flex: 0 40%;">名称</div> | ||||||
|  |               <div class="th" style="width: 40%; flex: 0 40%;">数量</div> | ||||||
|  |             </div> | ||||||
|  |           </div> | ||||||
|  |           <div class="table-body"> | ||||||
|  |         ` | ||||||
|  |         for (let i = 0; i < this.options.attribute.goods.content.length; i++) { | ||||||
|  |           goodsHtml += `<div class="tr"> | ||||||
|  |             <div class="td" style="width: 20%; flex: 0 20%;">${i + 1}</div> | ||||||
|  |             <div class="td" style="width: 40%; flex: 0 40%;">${this.options.attribute.goods.content[i].name}</div> | ||||||
|  |             <div class="td" style="width: 40%; flex: 0 40%;">${this.options.attribute.goods.content[i].cnt}</div> | ||||||
|  |           </div>` | ||||||
|  |         } | ||||||
|  |         goodsHtml += `</div></div></DIV-cy-tab-pane>` | ||||||
|  |       } | ||||||
|  |       if (this.options.richTextContent) { | ||||||
|  |         richTextHtml = `<DIV-cy-tab-pane label="富文本"> | ||||||
|  |           ${this.options.richTextContent} | ||||||
|  |         </DIV-cy-tab-pane>` | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       let boxHtml = ` | ||||||
|  |         <span class="drag-nook left-top"></span> | ||||||
|  |         <span class="drag-nook right-top"></span> | ||||||
|  |         ` | ||||||
|  |  | ||||||
|  |       if (!linkHtml && !goodsHtml && !richTextHtml) { | ||||||
|  |         boxHtml = boxHtml + '<p style="margin: 0;width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">暂无属性信息</p><div class="billboard-attribute-box-line"></div>' | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         boxHtml = boxHtml + ` | ||||||
|  |         <DIV-cy-tabs class="tabs"> | ||||||
|  |           ${richTextHtml} | ||||||
|  |           ${goodsHtml} | ||||||
|  |           ${linkHtml} | ||||||
|  |         </DIV-cy-tabs> | ||||||
|  |         <div class="billboard-attribute-box-line"></div>` | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       attributeElm.innerHTML = boxHtml | ||||||
|  |  | ||||||
|  |       if (attributeElm.getElementsByClassName('tabs')[0]) { | ||||||
|  |         let tabsElm = new cy_tabs(attributeElm.getElementsByClassName('tabs')[0], undefined, this.sdk) | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       let imgElm = attributeElm.getElementsByTagName('img') | ||||||
|  |       for (let i = 0; i < imgElm.length; i++) { | ||||||
|  |         if (!imgElm[i].style.width) { | ||||||
|  |           imgElm[i].style.width = '100%' | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       this.sdk.viewer.scene.postRender.addEventListener(this.#_postRenderEvent) | ||||||
|  |       let leftOnmousedown = (e) => { | ||||||
|  |         if (this.options.attributePos.width < 200) { | ||||||
|  |           this.options.attributePos.width = 200 | ||||||
|  |         } | ||||||
|  |         if (this.options.attributePos.height < 120) { | ||||||
|  |           this.options.attributePos.height = 120 | ||||||
|  |         } | ||||||
|  |         let x = e.x | ||||||
|  |         let y = e.y | ||||||
|  |         let width = this.options.attributePos.width | ||||||
|  |         let height = this.options.attributePos.height | ||||||
|  |         let positionx = this.options.attributePos.x | ||||||
|  |         this.sdk.viewer._element.onmousemove = (e2) => { | ||||||
|  |           this.options.attributePos.width = width + (x - e2.x) | ||||||
|  |           this.options.attributePos.height = height + (y - e2.y) | ||||||
|  |           if (this.options.attributePos.width < 200) { | ||||||
|  |             this.options.attributePos.width = 200 | ||||||
|  |           } | ||||||
|  |           else { | ||||||
|  |             this.options.attributePos.x = positionx - (x - e2.x) | ||||||
|  |           } | ||||||
|  |           if (this.options.attributePos.height < 120) { | ||||||
|  |             this.options.attributePos.height = 120 | ||||||
|  |           } | ||||||
|  |           // this.options.attributePos.y = positiony + (y - e2.y) | ||||||
|  |         } | ||||||
|  |         document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |         document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |       } | ||||||
|  |       let rightOnmousedown = (e) => { | ||||||
|  |         let x = e.x | ||||||
|  |         let y = e.y | ||||||
|  |         if (this.options.attributePos.width < 200) { | ||||||
|  |           this.options.attributePos.width = 200 | ||||||
|  |         } | ||||||
|  |         if (this.options.attributePos.height < 120) { | ||||||
|  |           this.options.attributePos.height = 120 | ||||||
|  |         } | ||||||
|  |         let width = this.options.attributePos.width | ||||||
|  |         let height = this.options.attributePos.height | ||||||
|  |         this.sdk.viewer._element.onmousemove = (e2) => { | ||||||
|  |           this.options.attributePos.width = width + (e2.x - x) | ||||||
|  |           this.options.attributePos.height = height + (y - e2.y) | ||||||
|  |         } | ||||||
|  |         document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |         document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |       } | ||||||
|  |       // leftTopElm.onmousedown = (e) => { | ||||||
|  |       //   console.log(1111111111) | ||||||
|  |       //   if (this.options.attributePos.width < 200) { | ||||||
|  |       //     this.options.attributePos.width = 200 | ||||||
|  |       //   } | ||||||
|  |       //   if (this.options.attributePos.height < 120) { | ||||||
|  |       //     this.options.attributePos.height = 120 | ||||||
|  |       //   } | ||||||
|  |       //   let x = e.x | ||||||
|  |       //   let y = e.y | ||||||
|  |       //   let width = this.options.attributePos.width | ||||||
|  |       //   let height = this.options.attributePos.height | ||||||
|  |       //   let positionx = this.options.attributePos.x | ||||||
|  |       //   this.sdk.viewer._element.onmousemove = (e2) => { | ||||||
|  |       //     this.options.attributePos.width = width + (x - e2.x) | ||||||
|  |       //     this.options.attributePos.height = height + (y - e2.y) | ||||||
|  |       //     if (this.options.attributePos.width < 200) { | ||||||
|  |       //       this.options.attributePos.width = 200 | ||||||
|  |       //     } | ||||||
|  |       //     else { | ||||||
|  |       //       this.options.attributePos.x = positionx - (x - e2.x) | ||||||
|  |       //     } | ||||||
|  |       //     if (this.options.attributePos.height < 120) { | ||||||
|  |       //       this.options.attributePos.height = 120 | ||||||
|  |       //     } | ||||||
|  |       //     // this.options.attributePos.y = positiony + (y - e2.y) | ||||||
|  |       //   } | ||||||
|  |       //   document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |       //   document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |       // } | ||||||
|  |       // rightTopElm.onmousedown = (e) => { | ||||||
|  |       //   let x = e.x | ||||||
|  |       //   let y = e.y | ||||||
|  |       //   if (this.options.attributePos.width < 200) { | ||||||
|  |       //     this.options.attributePos.width = 200 | ||||||
|  |       //   } | ||||||
|  |       //   if (this.options.attributePos.height < 120) { | ||||||
|  |       //     this.options.attributePos.height = 120 | ||||||
|  |       //   } | ||||||
|  |       //   let width = this.options.attributePos.width | ||||||
|  |       //   let height = this.options.attributePos.height | ||||||
|  |       //   this.sdk.viewer._element.onmousemove = (e2) => { | ||||||
|  |       //     this.options.attributePos.width = width + (e2.x - x) | ||||||
|  |       //     this.options.attributePos.height = height + (y - e2.y) | ||||||
|  |       //   } | ||||||
|  |       //   document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |       //   document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |       // } | ||||||
|  |  | ||||||
|  |       attributeElm.onmousedown = (e) => { | ||||||
|  |         attributeElm.style.pointerEvents = 'none' | ||||||
|  |         if (e.target.className.indexOf('left-top') != -1) { | ||||||
|  |           leftOnmousedown(e) | ||||||
|  |         } | ||||||
|  |         else if (e.target.className.indexOf('right-top') != -1) { | ||||||
|  |           rightOnmousedown(e) | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |           let x = e.x | ||||||
|  |           let y = e.y | ||||||
|  |           let oldX = this.options.attributePos.x | ||||||
|  |           let oldXY = this.options.attributePos.y | ||||||
|  |           let height = this.options.attributePos.height | ||||||
|  |           this.sdk.viewer._element.onmousemove = (e2) => { | ||||||
|  |             this.options.attributePos.x = oldX + (e2.x - x) | ||||||
|  |             this.options.attributePos.y = oldXY - (e2.y - y) | ||||||
|  |           } | ||||||
|  |           document.addEventListener('mouseup', this.#_destroyMouseEvent); | ||||||
|  |           document.addEventListener('mouseleave', this.#_destroyMouseEvent); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| export default BillboardObject | export default BillboardObject | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import EventBinding from '../../Element/Dialog/eventBinding'; | |||||||
| import richText from "../../Element/richText"; | import richText from "../../Element/richText"; | ||||||
| import MouseEvent from '../../../Event/index' | import MouseEvent from '../../../Event/index' | ||||||
| import LabelObject from '../LabelObject' | import LabelObject from '../LabelObject' | ||||||
| import { syncData } from '../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode' | ||||||
| import { legp } from '../../Element/datalist'; | import { legp } from '../../Element/datalist'; | ||||||
| import { getFontList, getFontFamilyName } from '../../Element/fontSelect' | import { getFontList, getFontFamilyName } from '../../Element/fontSelect' | ||||||
| import MouseTip from '../../../MouseTip' | import MouseTip from '../../../MouseTip' | ||||||
| @ -223,16 +223,31 @@ class CircleDiffuse extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|       this.entity.show = v |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|  |         this.entity.show = this.options.show  | ||||||
|  |         if (this.options.label.show) { | ||||||
|  |           this.label.show = this.options.show  | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.entity.show = false | ||||||
|  |         if (this.options.label.show) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       this.isShowView = false | ||||||
|  |        | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|       if (this._DialogObject && this._DialogObject.showBtn) { |       if (this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label.show) { |        | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
| @ -362,6 +377,7 @@ class CircleDiffuse extends Base { | |||||||
|     return this.options.circle |     return this.options.circle | ||||||
|   } |   } | ||||||
|   set circle(v) { |   set circle(v) { | ||||||
|  |     console.log(v) | ||||||
|     this.options.circle = v || [{ radius: 10 }] |     this.options.circle = v || [{ radius: 10 }] | ||||||
|     for (let i = 0; i < this.options.circle.length; i++) { |     for (let i = 0; i < this.options.circle.length; i++) { | ||||||
|       if(this.options.circle[i].radius>999999) { |       if(this.options.circle[i].radius>999999) { | ||||||
| @ -427,8 +443,9 @@ class CircleDiffuse extends Base { | |||||||
|     return this.options.label.show |     return this.options.label.show | ||||||
|   } |   } | ||||||
|   set labelShow(v) { |   set labelShow(v) { | ||||||
|  |     let sdkD = get2DSdk().sdkD | ||||||
|     this.options.label.show = v |     this.options.label.show = v | ||||||
|     if (this.show) { |     if (this.show && (!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|       this.label.show = v |       this.label.show = v | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
| @ -1321,7 +1338,7 @@ class CircleDiffuse extends Base { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async remove() { |   async remove() { | ||||||
|     this.label.remove() |     this.label && this.label.remove() | ||||||
|     this.entity && this.sdk.viewer.entities.remove(this.entity) |     this.entity && this.sdk.viewer.entities.remove(this.entity) | ||||||
|     this.entity2 && this.sdk.viewer.entities.remove(this.entity2) |     this.entity2 && this.sdk.viewer.entities.remove(this.entity2) | ||||||
|     this.entity = null |     this.entity = null | ||||||
| @ -1405,7 +1422,7 @@ class CircleDiffuse extends Base { | |||||||
|                   } |                   } | ||||||
|                 } |                 } | ||||||
|                 this._radius = radius |                 this._radius = radius | ||||||
|                 inputElm.value = value |                 // inputElm.value = value | ||||||
|                 CircleDiffuse.create(this) |                 CircleDiffuse.create(this) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -45,7 +45,7 @@ class CircleObject extends Base { | |||||||
|     this.options.center = options.center || {} |     this.options.center = options.center || {} | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     options.label = options.label || {} |     options.label = options.label || {} | ||||||
|     this._elms = {}; |     this._elms = {}; | ||||||
| @ -333,7 +333,7 @@ class CircleObject extends Base { | |||||||
|   } |   } | ||||||
|   set labelShow(v) { |   set labelShow(v) { | ||||||
|     this.options.label.show = v |     this.options.label.show = v | ||||||
|     if (this.show) { |     if (this.show && (!this.showView || this.showView == 3)) { | ||||||
|       this.label.show = v |       this.label.show = v | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ class CurvelineObject extends Base { | |||||||
|    * @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式) |    * @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式) | ||||||
|    * @param options['nose-to-tail']=false {boolean} 首尾相连 |    * @param options['nose-to-tail']=false {boolean} 首尾相连 | ||||||
|    * @param options.extend=false {boolean} 线缓冲 |    * @param options.extend=false {boolean} 线缓冲 | ||||||
|    * @param options['extend-width']=1 {number} 线缓冲宽度 |    * @param options['extend-width']=10 {number} 线缓冲宽度 | ||||||
|    * @param options['extend-color']=#ffde00 {number} 线缓冲颜色 |    * @param options['extend-color']=#ffde00 {number} 线缓冲颜色 | ||||||
|    * @param options.show=true {boolean} 显隐 |    * @param options.show=true {boolean} 显隐 | ||||||
|    * @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...] |    * @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...] | ||||||
| @ -66,8 +66,8 @@ class CurvelineObject extends Base { | |||||||
|     this.options['extend-width'] = |     this.options['extend-width'] = | ||||||
|       options['extend-width'] || options['extend-width'] === 0 |       options['extend-width'] || options['extend-width'] === 0 | ||||||
|         ? options['extend-width'] |         ? options['extend-width'] | ||||||
|         : 1 |         : 10 | ||||||
|     this.options['extend-color'] = options['extend-color'] || '#ffde00' |     this.options['extend-color'] = options['extend-color'] || 'rgba(255,255,80,0.3)' | ||||||
|     this.options.show = |     this.options.show = | ||||||
|       options.show || options.show === false ? options.show : true |       options.show || options.show === false ? options.show : true | ||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ class EllipseObject extends Base { | |||||||
|    * @param options.name {string} 名称 |    * @param options.name {string} 名称 | ||||||
|    * @param options.show=true {boolean} 显示/隐藏 |    * @param options.show=true {boolean} 显示/隐藏 | ||||||
|    * @param options.center {object} 位置 |    * @param options.center {object} 位置 | ||||||
|    * @param options.color="#ff000080" {string} 颜色 |    * @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色 | ||||||
|    * @param options.center.lng {object} 经度 |    * @param options.center.lng {object} 经度 | ||||||
|    * @param options.center.lat {object} 维度 |    * @param options.center.lat {object} 维度 | ||||||
|    * @param options.semiMinorAxis=10 {number} 短半轴长度 |    * @param options.semiMinorAxis=10 {number} 短半轴长度 | ||||||
| @ -32,14 +32,14 @@ class EllipseObject extends Base { | |||||||
|    * @param options.bearing=0 {number} 旋转角度 |    * @param options.bearing=0 {number} 旋转角度 | ||||||
|    * @param options.line {object} 边框 |    * @param options.line {object} 边框 | ||||||
|    * @param options.line.width=2 {string} 边框宽 |    * @param options.line.width=2 {string} 边框宽 | ||||||
|    * @param options.line.color="#ff000080" {string} 边框颜色 |    * @param options.line.color="rgba(255, 0, 0, 1)" {string} 边框颜色 | ||||||
|    * @param options.label {object} 标注 |    * @param options.label {object} 标注 | ||||||
|    * @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式) |    * @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式) | ||||||
|    */ |    */ | ||||||
|   constructor(sdk, options = {}) { |   constructor(sdk, options = {}) { | ||||||
|     super(sdk, options); |     super(sdk, options); | ||||||
|     this.options.name = options.name || '未命名对象' |     this.options.name = options.name || '未命名对象' | ||||||
|     this.options.color = options.color || "#ff000080" |     this.options.color = options.color || "rgba(255, 0, 0, 0.5)" | ||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
|     this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 |     this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 | ||||||
|     this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 |     this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 | ||||||
| @ -47,7 +47,7 @@ class EllipseObject extends Base { | |||||||
|     this.options.center = options.center || {} |     this.options.center = options.center || {} | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     options.label = options.label || {} |     options.label = options.label || {} | ||||||
|     this._elms = {}; |     this._elms = {}; | ||||||
|  | |||||||
| @ -8,6 +8,8 @@ | |||||||
| import { getHost, getToken } from "../../../on"; | import { getHost, getToken } from "../../../on"; | ||||||
| import Base from '../index' | import Base from '../index' | ||||||
| import Tools from '../../../Tools' | import Tools from '../../../Tools' | ||||||
|  | import { syncSplitData } from "../../../Global/SplitScreen"; | ||||||
|  | import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global' | ||||||
|  |  | ||||||
| class GeoJson extends Base { | class GeoJson extends Base { | ||||||
| @ -27,6 +29,7 @@ class GeoJson extends Base { | |||||||
|     this.primitive = undefined |     this.primitive = undefined | ||||||
|     this.positions = [] |     this.positions = [] | ||||||
|      |      | ||||||
|  |  | ||||||
|     this.loading = true |     this.loading = true | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -48,6 +51,27 @@ class GeoJson extends Base { | |||||||
|     return this.options.show |     return this.options.show | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   // set show(status) { | ||||||
|  |   //   let sdkD = get2DSdk().sdkD | ||||||
|  |   //   if (!this.isShowView || !sdkD) { | ||||||
|  |   //     this.options.show = status | ||||||
|  |   //   } | ||||||
|  |   //   if (this.entity) { | ||||||
|  |   //     if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|  |   //       for (let i = 0; i < this.entity.entities.values.length; i++) { | ||||||
|  |   //         this.entity.entities.values[i].show = this.options.show | ||||||
|  |   //       } | ||||||
|  |   //     } | ||||||
|  |   //     else { | ||||||
|  |   //       for (let i = 0; i < this.entity.entities.values.length; i++) { | ||||||
|  |   //         this.entity.entities.values[i].show = false | ||||||
|  |   //       } | ||||||
|  |   //     } | ||||||
|  |   //   } | ||||||
|  |   //   syncData(this.sdk, this.options.id) | ||||||
|  |   //   syncSplitData(this.sdk, this.options.id) | ||||||
|  |   //   this.isShowView = false | ||||||
|  |   // } | ||||||
|   set show(status) { |   set show(status) { | ||||||
|     this.options.show = status |     this.options.show = status | ||||||
|     if (this.entity) { |     if (this.entity) { | ||||||
| @ -74,6 +98,7 @@ class GeoJson extends Base { | |||||||
|     }) |     }) | ||||||
|     let json = await rsp.json() |     let json = await rsp.json() | ||||||
|     this.geojson = json |     this.geojson = json | ||||||
|  |     // this.sdk.addIncetance(this.options.id, this) | ||||||
|     return GeoJson.addDataToGlobe(this, json.features) |     return GeoJson.addDataToGlobe(this, json.features) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | |||||||
| @ -7,13 +7,21 @@ function html() { | |||||||
|             <span class="label">名称</span> |             <span class="label">名称</span> | ||||||
|             <input class="input" maxlength="40" type="text" @model="name"> |             <input class="input" maxlength="40" type="text" @model="name"> | ||||||
|         </div> |         </div> | ||||||
|         <div class="col"> |         <div class="col"></div> | ||||||
|         </div> |  | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
|   <span class="custom-divider"></span> |   <span class="custom-divider"></span> | ||||||
|   <div class="div-item"> |   <div class="div-item"> | ||||||
|     <div class="row"> |     <div class="row"> | ||||||
|  |         <div class="col"> | ||||||
|  |             <button class="anchor btn">调整锚点</button> | ||||||
|  |         </div> | ||||||
|  |         <div class="col mode-box"> | ||||||
|  |             <span class="label" style="flex: unset;">军标模式</span> | ||||||
|  |             <div class="mode"></div> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  |     <div class="row" mode="0"> | ||||||
|         <div class="col"> |         <div class="col"> | ||||||
|             <span class="label">旋转角度</span> |             <span class="label">旋转角度</span> | ||||||
|             <input type="range" max="360" min="0" step="0.1" @model="angle"> |             <input type="range" max="360" min="0" step="0.1" @model="angle"> | ||||||
| @ -24,16 +32,85 @@ function html() { | |||||||
|             </div> |             </div> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
|     <div class="row"> |     <div class="row" mode="0"> | ||||||
|         <div class="col"> |         <div class="col"> | ||||||
|             <span class="label">调整大小</span> |             <span class="label">调整大小</span> | ||||||
|             <input type="range" max="99999" min="0" step="0.1" @model="scale"> |             <input type="range" max="40000" min="0" step="0.1" @model="scale"> | ||||||
|             <div class="input-number input-number-unit-1" style="width: 100px;flex: 0 0 100px;margin-left: 10px;"> |             <div class="input-number input-number-unit-1" style="width: 100px;flex: 0 0 100px;margin-left: 10px;"> | ||||||
|                 <input class="input" type="number" title="" min="0" max="99999" step="0.1" @model="scale"> |                 <input class="input" type="number" title="" min="0" max="40000" step="0.1" @model="scale"> | ||||||
|                 <span class="arrow"></span> |                 <span class="arrow"></span> | ||||||
|             </div> |             </div> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
|  |         <div class="row" mode="1"> | ||||||
|  |             <div class="col height-mode-box" style="flex: 0 0 155px;margin-right: 10px;"> | ||||||
|  |                 <span class="label" style="flex: 0 0 56px;">高度模式</span> | ||||||
|  |                 <div class="height-mode"></div> | ||||||
|  |             </div> | ||||||
|  |             <div class="col" style="margin: 0 10px;"> | ||||||
|  |                 <div class="height-box" style="display: flex; align-items: center;"> | ||||||
|  |                     <span class="label" style="flex: 0 0 56px;">高度</span> | ||||||
|  |                     <div class="input-number input-number-unit-1"> | ||||||
|  |                         <input class="input height" type="number" title="" min="-9999999" max="999999999"> | ||||||
|  |                         <span class="unit">m</span> | ||||||
|  |                         <span class="arrow"></span> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="col" style="margin-left: 10px;"> | ||||||
|  |                 <span class="label">图标倍数</span> | ||||||
|  |                 <div class="input-number input-number-unit-1"> | ||||||
|  |                     <input class="input" type="number" title="" data-min="0.1" max="99" @model="billboardScale"> | ||||||
|  |                     <span class="unit">倍</span> | ||||||
|  |                     <span class="arrow"></span> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |         <div class="row" mode="1"> | ||||||
|  |             <div class="col" style="flex: 0 0 155px;margin-right: 10px;"> | ||||||
|  |                 <span class="label">视野缩放</span> | ||||||
|  |                 <input class="btn-switch" type="checkbox" @model="billboardScaleByDistance"> | ||||||
|  |             </div> | ||||||
|  |             <div class="col" style="margin: 0 10px;"> | ||||||
|  |                 <span class="label">最近距离</span> | ||||||
|  |                 <div class="input-number input-number-unit-1"> | ||||||
|  |                     <input class="input" type="number" title="" min="1" max="99999999" @model="billboardNear"> | ||||||
|  |                     <span class="unit">m</span> | ||||||
|  |                     <span class="arrow"></span> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="col" style="margin-left: 10px;"> | ||||||
|  |                 <span class="label">最远距离</span> | ||||||
|  |                 <div class="input-number input-number-unit-1"> | ||||||
|  |                     <input class="input" type="number" title="" min="1" max="99999999" @model="billboardFar"> | ||||||
|  |                     <span class="unit">m</span> | ||||||
|  |                     <span class="arrow"></span> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |                 <h4 mode="1">文字设置</h4> | ||||||
|  |                     <div class="row"  mode="1"> | ||||||
|  |                         <div class="col" style="flex: 0 0 80px;margin: 0 10px;"> | ||||||
|  |                             <span class="label" style="flex: none;">显隐</span> | ||||||
|  |                             <input class="btn-switch" type="checkbox" @model="labelShow"> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="col font-select-box" style="margin: 0 0px;flex: 0 0 150px;"> | ||||||
|  |                             <span class="label" style="flex: none;">字体选择</span> | ||||||
|  |                             <div class="input input-select font-select"></div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="col" style="margin: 0 10px;"> | ||||||
|  |                             <span class="label">文字大小</span> | ||||||
|  |                             <div class="input-number input-number-unit-2"> | ||||||
|  |                                 <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;"> | ||||||
|  |                                 <span class="unit">px</span> | ||||||
|  |                                 <span class="arrow"></span> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="col" style="margin-left: 10px;"> | ||||||
|  |                             <span class="label">文字颜色</span> | ||||||
|  |                             <div class="labelColor"></div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|   </div> |   </div> | ||||||
|   <span class="custom-divider"></span> |   <span class="custom-divider"></span> | ||||||
|   ` |   ` | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -54,7 +54,7 @@ function html(that) { | |||||||
|         <div class="row"> |         <div class="row"> | ||||||
|             <div class="col" style="flex: 5;"> |             <div class="col" style="flex: 5;"> | ||||||
|                 <span class="label">文字内容</span> |                 <span class="label">文字内容</span> | ||||||
|                 <input class="input" type="text" @model="textValue"> |                 <input class="input" type="text" @model="textValue" maxlength="30"> | ||||||
|             </div> |             </div> | ||||||
|             <div class="col"> |             <div class="col"> | ||||||
|                 <button class="btn" @click="textPosPick">设置位置</span> |                 <button class="btn" @click="textPosPick">设置位置</span> | ||||||
|  | |||||||
| @ -10,6 +10,7 @@ import { FontLoader } from '../../../../static/3rdparty/three/jsm/loaders/FontLo | |||||||
| import { TextGeometry } from '../../../../static/3rdparty/three/jsm/geometries/TextGeometry.js'; | import { TextGeometry } from '../../../../static/3rdparty/three/jsm/geometries/TextGeometry.js'; | ||||||
| import * as variable from '../../../../static/3rdparty/three/fonts/FZZongYi-M05S_regular.typeface.json' | import * as variable from '../../../../static/3rdparty/three/fonts/FZZongYi-M05S_regular.typeface.json' | ||||||
| import Base from "../index"; | import Base from "../index"; | ||||||
|  | import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' | ||||||
|  |  | ||||||
| class GroundSvg extends Base { | class GroundSvg extends Base { | ||||||
| @ -108,13 +109,19 @@ class GroundSvg extends Base { | |||||||
|     this._isdrag = false |     this._isdrag = false | ||||||
|     this._EventBinding = new EventBinding() |     this._EventBinding = new EventBinding() | ||||||
|  |  | ||||||
|  |     if(this.sdk.entityMap.get(this.options.id)) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|     this.sdk.addIncetance(this.options.id, this) |     this.sdk.addIncetance(this.options.id, this) | ||||||
|     this.picking = true |     this.picking = true | ||||||
|  |  | ||||||
|  |      | ||||||
|     if (this.options.show) { |     if (this.options.show) { | ||||||
|       setSplitDirection(0, this.options.id) |       setSplitDirection(0, this.options.id) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     this._entityArray = [] | ||||||
|  |      | ||||||
|     this.init() |     this.init() | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -153,12 +160,18 @@ class GroundSvg extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|       super.show = v |       if (this.options.text && this.options.text.show) { | ||||||
|       if (this.options.text && this.options.text.show && this.text) { |         if(this.text) { | ||||||
|  |           if((!this.showView || this.showView == 3)) { | ||||||
|             this.text.show = v |             this.text.show = v | ||||||
|           } |           } | ||||||
|       syncData(this.sdk, this.options.id) |           else { | ||||||
|       syncSplitData(this.sdk, this.options.id) |             this.text.show = false | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |       } | ||||||
|  |       super.show = v | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
| @ -304,7 +317,12 @@ class GroundSvg extends Base { | |||||||
|   set textShow(v) { |   set textShow(v) { | ||||||
|     this.options.text.show = v |     this.options.text.show = v | ||||||
|     if (this.show) { |     if (this.show) { | ||||||
|  |       if((!this.showView || this.showView == 3)) { | ||||||
|         this.text && (this.text.show = v) |         this.text && (this.text.show = v) | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.text && (this.text.show = false) | ||||||
|  |       } | ||||||
|       if (this.options.text.position) { |       if (this.options.text.position) { | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|           if (this.options.text.position.alt) { |           if (this.options.text.position.alt) { | ||||||
| @ -820,8 +838,13 @@ class GroundSvg extends Base { | |||||||
|         } |         } | ||||||
|         for (let i = 0; i < this.hierarchys.length; i++) { |         for (let i = 0; i < this.hierarchys.length; i++) { | ||||||
|           for (let m = 0; m < this.hierarchys[i].length; m++) { |           for (let m = 0; m < this.hierarchys[i].length; m++) { | ||||||
|  |             let id = this.options.id + `-${i}_${m}}` | ||||||
|  |             let oldEntity = this.sdk.viewer.entities.getById(id) | ||||||
|  |             if(oldEntity) { | ||||||
|  |               this.sdk.viewer.entities.remove(oldEntity) | ||||||
|  |             } | ||||||
|             let entity = this.sdk.viewer.entities.add({ |             let entity = this.sdk.viewer.entities.add({ | ||||||
|               id: this.options.id + `-${i}_${m}`, |               id: this.options.id + `-${i}_${m}}`, | ||||||
|               show: this.options.show, |               show: this.options.show, | ||||||
|               polygon: { |               polygon: { | ||||||
|                 hierarchy: new Cesium.CallbackProperty(() => { |                 hierarchy: new Cesium.CallbackProperty(() => { | ||||||
| @ -854,6 +877,7 @@ class GroundSvg extends Base { | |||||||
|                 color: this.geojson.features[i].properties.color |                 color: this.geojson.features[i].properties.color | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             this._entityArray.push(entity) | ||||||
|             this.entity.add(entity) |             this.entity.add(entity) | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
| @ -1189,7 +1213,7 @@ class GroundSvg extends Base { | |||||||
|   * @param {boolean} status=false 状态 |   * @param {boolean} status=false 状态 | ||||||
|   */ |   */ | ||||||
|   drag(status, cd) { |   drag(status, cd) { | ||||||
|     if (!this.#loaded) { |     if (!this.#loaded || !this.sdk || !this.sdk.viewer) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     this.ismove = false |     this.ismove = false | ||||||
| @ -1256,6 +1280,9 @@ class GroundSvg extends Base { | |||||||
|           // 中心点到鼠标的距离 |           // 中心点到鼠标的距离 | ||||||
|           let distance = turf.rhumbDistance(pointC, point2, options); |           let distance = turf.rhumbDistance(pointC, point2, options); | ||||||
|  |  | ||||||
|  |           let flag = false | ||||||
|  |           let flag2 = false | ||||||
|  |  | ||||||
|           switch (this.pickPoint.id) { |           switch (this.pickPoint.id) { | ||||||
|             case 'svg-control-points_0': |             case 'svg-control-points_0': | ||||||
|               angle = bearing2_0 - bearing1 |               angle = bearing2_0 - bearing1 | ||||||
| @ -1267,12 +1294,39 @@ class GroundSvg extends Base { | |||||||
|               bearingH = (((turf.rhumbBearing(pointC, turf.point(controlPoints[2])) + 360) - this.angle) % 360) |               bearingH = (((turf.rhumbBearing(pointC, turf.point(controlPoints[2])) + 360) - this.angle) % 360) | ||||||
|               angleW = bearing2 - bearingW |               angleW = bearing2 - bearingW | ||||||
|               angleH = bearing2 - bearingH |               angleH = bearing2 - bearingH | ||||||
|  |  | ||||||
|               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { |               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { | ||||||
|                 angleW = angleW + 180 |                 angleW = angleW + 180 | ||||||
|  |                 flag=true | ||||||
|               } |               } | ||||||
|               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { |               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { | ||||||
|                 angleH = angleH + 180 |                 angleH = angleH + 180 | ||||||
|  |                 flag2=true | ||||||
|  |               } | ||||||
|  |               if(flag && flag2) { | ||||||
|  |                 this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |               } | ||||||
|  |               else { | ||||||
|  |                 if(flag) { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 } | ||||||
|  |                 else if(flag2) { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 } | ||||||
|  |                 else { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 } | ||||||
|               } |               } | ||||||
|  |  | ||||||
|               radiansW = (Math.PI / 180) * angleW |               radiansW = (Math.PI / 180) * angleW | ||||||
| @ -1291,6 +1345,12 @@ class GroundSvg extends Base { | |||||||
|  |  | ||||||
|               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { |               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { | ||||||
|                 angleH = angleH + 180 |                 angleH = angleH + 180 | ||||||
|  |                 this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |               } | ||||||
|  |               else { | ||||||
|  |                 this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                 this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|               } |               } | ||||||
|  |  | ||||||
|               radiansH = (Math.PI / 180) * angleH |               radiansH = (Math.PI / 180) * angleH | ||||||
| @ -1308,9 +1368,37 @@ class GroundSvg extends Base { | |||||||
|  |  | ||||||
|               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { |               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { | ||||||
|                 angleW = angleW + 180 |                 angleW = angleW + 180 | ||||||
|  |                 flag=true | ||||||
|               } |               } | ||||||
|               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { |               if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) { | ||||||
|                 angleH = angleH + 180 |                 angleH = angleH + 180 | ||||||
|  |                 flag2=true | ||||||
|  |               } | ||||||
|  |               if(flag && flag2) { | ||||||
|  |                 this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                 this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |               } | ||||||
|  |               else { | ||||||
|  |                 if(flag) { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 } | ||||||
|  |                 else if(flag2) { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                 } | ||||||
|  |                 else { | ||||||
|  |                   this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |                   this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                   this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 } | ||||||
|               } |               } | ||||||
|  |  | ||||||
|               radiansW = (Math.PI / 180) * angleW |               radiansW = (Math.PI / 180) * angleW | ||||||
| @ -1328,6 +1416,12 @@ class GroundSvg extends Base { | |||||||
|  |  | ||||||
|               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { |               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { | ||||||
|                 angleW = angleW + 180 |                 angleW = angleW + 180 | ||||||
|  |                 this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |               } | ||||||
|  |               else { | ||||||
|  |                 this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|               } |               } | ||||||
|  |  | ||||||
|               radiansW = (Math.PI / 180) * angleW |               radiansW = (Math.PI / 180) * angleW | ||||||
| @ -1358,6 +1452,12 @@ class GroundSvg extends Base { | |||||||
|  |  | ||||||
|               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { |               if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) { | ||||||
|                 angleW = angleW + 180 |                 angleW = angleW + 180 | ||||||
|  |                 this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|  |               } | ||||||
|  |               else { | ||||||
|  |                 this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a') | ||||||
|  |                 this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000') | ||||||
|               } |               } | ||||||
|  |  | ||||||
|               radiansW = (Math.PI / 180) * angleW |               radiansW = (Math.PI / 180) * angleW | ||||||
| @ -1503,6 +1603,9 @@ class GroundSvg extends Base { | |||||||
|       controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates |       controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates | ||||||
|  |  | ||||||
|       this.controlPoints = controlPoints |       this.controlPoints = controlPoints | ||||||
|  |       if(!this.sdk || !this.sdk.viewer) { | ||||||
|  |         return | ||||||
|  |       } | ||||||
|       for (let i = 0; i < this.controlPoints.length; i++) { |       for (let i = 0; i < this.controlPoints.length; i++) { | ||||||
|         let color = '#00ff0a' |         let color = '#00ff0a' | ||||||
|         if (i === 5) { |         if (i === 5) { | ||||||
| @ -1991,21 +2094,25 @@ class GroundSvg extends Base { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async remove() { |   async remove() { | ||||||
|  |     this._worker.onmessage = (event) => {} | ||||||
|  |     await this.sdk.removeIncetance(this.options.id) | ||||||
|     if (!this.entity) { |     if (!this.entity) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     this.drag(false) |     this.drag(false) | ||||||
|  |     if(!this.sdk || !this.sdk.viewer) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|     this.sdk.viewer.entities.remove(this.entity) |     this.sdk.viewer.entities.remove(this.entity) | ||||||
|     this.text && this.text.remove() |     this.text && this.text.remove() | ||||||
|     for (let i = this.entity.values.length; i >= 0; i--) { |     for (let i = this.entity.values.length; i >= 0; i--) { | ||||||
|       this.sdk.viewer.entities.remove(this.entity.values[i]) |       this.sdk.viewer.entities.remove(this.entity.values[i]) | ||||||
|     } |     } | ||||||
|     this.entity = null |  | ||||||
|     if (this._DialogObject && !this._DialogObject.isDestroy) { |     if (this._DialogObject && !this._DialogObject.isDestroy) { | ||||||
|       this._DialogObject.close() |       this._DialogObject.close() | ||||||
|       this._DialogObject = null |       this._DialogObject = null | ||||||
|     } |     } | ||||||
|     await this.sdk.removeIncetance(this.options.id) |      | ||||||
|     await syncData(this.sdk, this.options.id) |     await syncData(this.sdk, this.options.id) | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -2065,6 +2172,59 @@ class GroundSvg extends Base { | |||||||
|     } |     } | ||||||
|     this._update() |     this._update() | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   async flyTo(options = {}) { | ||||||
|  |     if (this._error) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  |     setActiveViewer(0) | ||||||
|  |     closeRotateAround(this.sdk) | ||||||
|  |     closeViewFollow(this.sdk) | ||||||
|  |  | ||||||
|  |     if (this.options.customView && this.options.customView.relativePosition && this.options.customView.orientation) { | ||||||
|  |       let orientation = { | ||||||
|  |         heading: Cesium.Math.toRadians(this.options.customView.orientation.heading || 0.0), | ||||||
|  |         pitch: Cesium.Math.toRadians(this.options.customView.orientation.pitch || -60.0), | ||||||
|  |         roll: Cesium.Math.toRadians(this.options.customView.orientation.roll || 0.0) | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       let lng = this.options.customView.relativePosition.lng | ||||||
|  |       let lat = this.options.customView.relativePosition.lat | ||||||
|  |       let alt = this.options.customView.relativePosition.alt | ||||||
|  |       let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) | ||||||
|  |  | ||||||
|  |       let position = { ...this.options.position } | ||||||
|  |       // 如果没有高度值,则获取紧贴高度计算 | ||||||
|  |       if (!position.hasOwnProperty('alt')) { | ||||||
|  |         position.alt = await this.getClampToHeight(position) | ||||||
|  |       } | ||||||
|  |       lng = this.options.customView.relativePosition.lng + position.lng | ||||||
|  |       lat = this.options.customView.relativePosition.lat + position.lat | ||||||
|  |       alt = this.options.customView.relativePosition.alt + position.alt | ||||||
|  |       destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) | ||||||
|  |       this.sdk.viewer.camera.flyTo({ | ||||||
|  |         destination: destination, | ||||||
|  |         orientation: orientation | ||||||
|  |       }) | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       let array = [] | ||||||
|  |       for (let i = 0; i < this.controlPoints.length; i++) { | ||||||
|  |         let height = await this.getClampToHeight({lng: this.controlPoints[i][0], lat: this.controlPoints[i][1]}) | ||||||
|  |         let cartesian = Cesium.Cartesian3.fromDegrees(this.controlPoints[i][0], this.controlPoints[i][1], height) | ||||||
|  |         array.push(cartesian.x, cartesian.y, cartesian.z) | ||||||
|  |       } | ||||||
|  |       let BoundingSphere = Cesium.BoundingSphere.fromVertices(array) | ||||||
|  |  | ||||||
|  |       this.sdk.viewer.camera.flyToBoundingSphere(BoundingSphere, { | ||||||
|  |         offset: options.orientation || { | ||||||
|  |           heading: Cesium.Math.toRadians(0.0), | ||||||
|  |           pitch: Cesium.Math.toRadians(-60.0), | ||||||
|  |           roll: Cesium.Math.toRadians(0.0) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| export default GroundSvg | export default GroundSvg | ||||||
| @ -14,6 +14,8 @@ import { | |||||||
|  |  | ||||||
| class LabelObject extends Base { | class LabelObject extends Base { | ||||||
|   #updateBillboardImageTimeout |   #updateBillboardImageTimeout | ||||||
|  |   #canvas = document.createElement('canvas') | ||||||
|  |   #canvas2 = document.createElement('canvas') | ||||||
|   constructor(sdk, options = {}, model) { |   constructor(sdk, options = {}, model) { | ||||||
|     super(sdk, options) |     super(sdk, options) | ||||||
|     this.model = model |     this.model = model | ||||||
| @ -65,6 +67,11 @@ class LabelObject extends Base { | |||||||
|     } |     } | ||||||
|     this.originalOptions = copyObj(this.options) |     this.originalOptions = copyObj(this.options) | ||||||
|  |  | ||||||
|  |     let id = this.options.id + '-label' | ||||||
|  |     let oldEntity = this.sdk.viewer.entities.getById(id) | ||||||
|  |     if(oldEntity) { | ||||||
|  |       this.sdk.viewer.entities.remove(oldEntity) | ||||||
|  |     } | ||||||
|     this.entity = this.sdk.viewer.entities.add({ |     this.entity = this.sdk.viewer.entities.add({ | ||||||
|       show: this.options.show, |       show: this.options.show, | ||||||
|       id: this.options.id + '-label', |       id: this.options.id + '-label', | ||||||
| @ -433,11 +440,12 @@ class LabelObject extends Base { | |||||||
|     this.updateBillboardImage() |     this.updateBillboardImage() | ||||||
|   } |   } | ||||||
|   updateBillboardImage() { |   updateBillboardImage() { | ||||||
|     clearTimeout(this.#updateBillboardImageTimeout) |  | ||||||
|     this.#updateBillboardImageTimeout = setTimeout(() => { |  | ||||||
|       clearTimeout(this.#updateBillboardImageTimeout) |  | ||||||
|     this.entity.billboard.image = this.getcanvas() |     this.entity.billboard.image = this.getcanvas() | ||||||
|     }, 500) |     // clearTimeout(this.#updateBillboardImageTimeout) | ||||||
|  |     // this.#updateBillboardImageTimeout = setTimeout(() => { | ||||||
|  |     //   clearTimeout(this.#updateBillboardImageTimeout) | ||||||
|  |     //   this.entity.billboard.image = this.getcanvas() | ||||||
|  |     // }, 500) | ||||||
|   } |   } | ||||||
|   get lineColor() { |   get lineColor() { | ||||||
|     return this.options.pixelOffset |     return this.options.pixelOffset | ||||||
| @ -484,9 +492,8 @@ class LabelObject extends Base { | |||||||
|   // } |   // } | ||||||
|  |  | ||||||
|   getcanvas() { |   getcanvas() { | ||||||
|     const canvas = document.createElement('canvas') |     const ctx = this.#canvas.getContext('2d') | ||||||
|     const ctx = canvas.getContext('2d') |     ctx.clearRect(0, 0, this.#canvas.width, this.#canvas.height); | ||||||
|  |  | ||||||
|     ctx.font = this.options.fontSize + 'px ' + this.font |     ctx.font = this.options.fontSize + 'px ' + this.font | ||||||
|     let texts = this.options.text.split('\n') |     let texts = this.options.text.split('\n') | ||||||
|     let canvasWidth = 0 |     let canvasWidth = 0 | ||||||
| @ -504,9 +511,8 @@ class LabelObject extends Base { | |||||||
|     if (canvasWidth < this.options.lineWidth) { |     if (canvasWidth < this.options.lineWidth) { | ||||||
|       canvasWidth = this.options.lineWidth |       canvasWidth = this.options.lineWidth | ||||||
|     } |     } | ||||||
|     canvas.width = canvasWidth |     this.#canvas.width = canvasWidth | ||||||
|  |     this.#canvas.height = this.options.pixelOffset + canvasHeight | ||||||
|     canvas.height = this.options.pixelOffset + canvasHeight |  | ||||||
|     const linearGradient = ctx.createLinearGradient( |     const linearGradient = ctx.createLinearGradient( | ||||||
|       0, |       0, | ||||||
|       0, |       0, | ||||||
| @ -553,15 +559,14 @@ class LabelObject extends Base { | |||||||
|     ctx.stroke() |     ctx.stroke() | ||||||
|     ctx.closePath() |     ctx.closePath() | ||||||
|  |  | ||||||
|     const canvas2 = document.createElement('canvas') |     const ctx2 = this.#canvas2.getContext('2d') | ||||||
|     const ctx2 = canvas2.getContext('2d') |     this.#canvas2.width = this.#canvas.width + 10 | ||||||
|     canvas2.width = canvas.width + 10 |     this.#canvas2.height = this.#canvas.height + 10 | ||||||
|     canvas2.height = canvas.height + 10 |     ctx2.drawImage(this.#canvas, 5, 5); | ||||||
|     ctx2.drawImage(canvas, 5, 5); |  | ||||||
|  |  | ||||||
|     // const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); |     // const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); | ||||||
|     // ctx.putImageData(imageData, 40, 40); |     // ctx.putImageData(imageData, 40, 40); | ||||||
|     return canvas2 |     return this.#canvas2.toDataURL("image/png") | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   remove() { |   remove() { | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ import EventBinding from './eventBinding' | |||||||
| import Base from "../../index"; | import Base from "../../index"; | ||||||
| import MouseEvent from '../../../../Event/index' | import MouseEvent from '../../../../Event/index' | ||||||
| import { syncPrimitives } from '../../../../Global/MultiViewportMode' | import { syncPrimitives } from '../../../../Global/MultiViewportMode' | ||||||
| import { syncData } from '../../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' | ||||||
| import MouseTip from '../../../../MouseTip' | import MouseTip from '../../../../MouseTip' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | ||||||
| @ -82,18 +82,34 @@ class Flame extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|       if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { |  | ||||||
|         this.entity.show = v |  | ||||||
|       } |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|  |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|  |           this.entity.show = this.options.show | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|  |           this.entity.show = false | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |        | ||||||
|       if (this._DialogObject && this._DialogObject.showBtn) { |       if (this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label && this.options.label.show) { |        | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import { html } from "./_element"; | |||||||
| import EventBinding from './eventBinding' | import EventBinding from './eventBinding' | ||||||
| import Base from "../../index"; | import Base from "../../index"; | ||||||
| import MouseEvent from '../../../../Event/index' | import MouseEvent from '../../../../Event/index' | ||||||
| import { syncData } from '../../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' | ||||||
| import MouseTip from '../../../../MouseTip' | import MouseTip from '../../../../MouseTip' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | ||||||
| @ -83,18 +83,32 @@ class Fountain extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|  |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|         this.entity.show = v |           this.entity.show = this.options.show | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|  |           this.entity.show = false | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|       if(this._DialogObject && this._DialogObject.showBtn) { |       if(this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label && this.options.label.show) { |  | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import { html, css } from "./_element"; | |||||||
| import EventBinding from './eventBinding' | import EventBinding from './eventBinding' | ||||||
| import Base from "../../index"; | import Base from "../../index"; | ||||||
| import MouseEvent from '../../../../Event/index' | import MouseEvent from '../../../../Event/index' | ||||||
| import { syncData } from '../../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' | ||||||
| import MouseTip from '../../../../MouseTip' | import MouseTip from '../../../../MouseTip' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../../Global/global' | ||||||
| @ -81,18 +81,32 @@ class Smoke extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|  |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|         this.entity.show = v |           this.entity.show = this.options.show | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|  |           this.entity.show = false | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|       if(this._DialogObject && this._DialogObject.showBtn) { |       if(this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label && this.options.label.show) { |  | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ import Dialog from '../../../Element/Dialog'; | |||||||
| import { html, css } from "./_element"; | import { html, css } from "./_element"; | ||||||
| import Base from "../../index"; | import Base from "../../index"; | ||||||
| import MouseEvent from '../../../../Event/index' | import MouseEvent from '../../../../Event/index' | ||||||
| import { syncData } from '../../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../../Global/MultiViewportMode' | ||||||
| import MouseTip from '../../../../MouseTip' | import MouseTip from '../../../../MouseTip' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../Global/global' | ||||||
| @ -84,18 +84,32 @@ class Spout extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|  |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|         this.entity.show = v |           this.entity.show = this.options.show | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         if (this.entity && this.sdk.viewer.camera.positionCartographic.height < 10000000) { | ||||||
|  |           this.entity.show = false | ||||||
|  |         } | ||||||
|  |         if (this.options.label && this.options.label.show) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|       if(this._DialogObject && this._DialogObject.showBtn) { |       if(this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label && this.options.label.show) { |  | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ class PincerArrowObject extends Base { | |||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     this.options.height = options.height |     this.options.height = options.height | ||||||
|     this.options.loop = options.loop || false |     this.options.loop = options.loop || false | ||||||
|  | |||||||
| @ -47,7 +47,7 @@ class PolygonObject extends Base { | |||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = |     this.options.line.color = | ||||||
|       this.options.line.color || 'rgba(255, 0, 0, 0.5)' |       this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     this.entity |     this.entity | ||||||
|     this.event = new MouseEvent(this.sdk) |     this.event = new MouseEvent(this.sdk) | ||||||
| @ -1216,7 +1216,6 @@ class PolygonObject extends Base { | |||||||
|             alt: this.label.position[2] |             alt: this.label.position[2] | ||||||
|           } |           } | ||||||
|           this.originalOptions = this.deepCopyObj(this.options) |           this.originalOptions = this.deepCopyObj(this.options) | ||||||
|           console.log('000000000000',this.options.label.scaleByDistance) |  | ||||||
|           this._DialogObject.close() |           this._DialogObject.close() | ||||||
|           this.Dialog.confirmCallBack && |           this.Dialog.confirmCallBack && | ||||||
|             this.Dialog.confirmCallBack(this.originalOptions) |             this.Dialog.confirmCallBack(this.originalOptions) | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ class eventBinding { | |||||||
|       let Event = [] |       let Event = [] | ||||||
|       let isEvent = false |       let isEvent = false | ||||||
|       let removeName = [] |       let removeName = [] | ||||||
|  |       let blurEvent = () => { } | ||||||
|       if (!elements[i] || !elements[i].attributes) { |       if (!elements[i] || !elements[i].attributes) { | ||||||
|         continue  |         continue  | ||||||
|       } |       } | ||||||
| @ -36,7 +37,8 @@ class eventBinding { | |||||||
|               Event.push((e) => { |               Event.push((e) => { | ||||||
|                 let value = e.target.value |                 let value = e.target.value | ||||||
|                 if (e.target.type == 'number') { |                 if (e.target.type == 'number') { | ||||||
|                   if (e.data != '.' && (e.data != '-' || e.target.value)) { |                   let str = e.target.value + '' | ||||||
|  |                   if (e.data != '.' && (e.data != '-' || e.target.value) && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.')) && e.target.value != '0') { | ||||||
|                     value = Number(value) |                     value = Number(value) | ||||||
|                     if((e.target.max) && value>Number(e.target.max)) { |                     if((e.target.max) && value>Number(e.target.max)) { | ||||||
|                       value = Number(e.target.max) |                       value = Number(e.target.max) | ||||||
| @ -57,6 +59,22 @@ class eventBinding { | |||||||
|                   that[m.value] = value |                   that[m.value] = value | ||||||
|                 } |                 } | ||||||
|               }) |               }) | ||||||
|  |               blurEvent = (e) => { | ||||||
|  |                 let value = e.target.value | ||||||
|  |                 if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) { | ||||||
|  |                   value = Number(value) | ||||||
|  |                   if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|  |                     value = Number(e.target.max) | ||||||
|  |                   } | ||||||
|  |                   if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|  |                     value = Number(e.target.min) | ||||||
|  |                   } | ||||||
|  |                   if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |                     value = Number(e.target.dataset.min) | ||||||
|  |                   } | ||||||
|  |                 } | ||||||
|  |                 that[m.value] = value | ||||||
|  |               } | ||||||
|               if(elements[i].nodeName=='IMG') { |               if(elements[i].nodeName=='IMG') { | ||||||
|                 elements[i].src = that[m.value] |                 elements[i].src = that[m.value] | ||||||
|               } |               } | ||||||
| @ -114,6 +132,7 @@ class eventBinding { | |||||||
|             Event[t](e) |             Event[t](e) | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|  |         elements[i].addEventListener('blur', blurEvent) | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -90,27 +90,6 @@ function html(that) { | |||||||
|                         <div class="col" style="flex: 0 0 37%;"> |                         <div class="col" style="flex: 0 0 37%;"> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
|                     <div class="row" id="dashTextureDom"> |  | ||||||
|                         <div class="col"> |  | ||||||
|                             <span class="label">动画顺向</span> |  | ||||||
|                             <input class="btn-switch" type="checkbox" @model="rotate"> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="col" style="flex: 0 0 33%;"> |  | ||||||
|                             <span class="label">流动速率</span> |  | ||||||
|                             <div class="input-number input-number-unit-1" style="width: 80px;"> |  | ||||||
|                                 <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed"> |  | ||||||
|                                 <span class="arrow"></span> |  | ||||||
|                             </div> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="col" style="flex: 0 0 37%;"> |  | ||||||
|                               <span class="label lineSpace">间距</span> |  | ||||||
|                               <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;"> |  | ||||||
|                                   <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space"> |  | ||||||
|                                   <span class="unit">倍</span> |  | ||||||
|                                   <span class="arrow"></span> |  | ||||||
|                               </div> |  | ||||||
|                         </div> |  | ||||||
|                     </div> |  | ||||||
|                     <div class="row"> |                     <div class="row"> | ||||||
|                         <div class="col"> |                         <div class="col"> | ||||||
|                             <span class="label">线段缓冲</span> |                             <span class="label">线段缓冲</span> | ||||||
| @ -129,6 +108,27 @@ function html(that) { | |||||||
|                             <div class="extendColor"></div> |                             <div class="extendColor"></div> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
|  |                     <div class="row" id="dashTextureDom"> | ||||||
|  |                         <div class="col"> | ||||||
|  |                             <span class="label">首尾反向</span> | ||||||
|  |                             <input class="btn-switch" type="checkbox" @model="rotate"> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="col" style="flex: 0 0 33%;"> | ||||||
|  |                             <span class="label">流动速率</span> | ||||||
|  |                             <div class="input-number input-number-unit-1" style="width: 80px;"> | ||||||
|  |                                 <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed"> | ||||||
|  |                                 <span class="arrow"></span> | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                         <div class="col" style="flex: 0 0 37%;"> | ||||||
|  |                               <span class="label lineSpace">线条间距</span> | ||||||
|  |                               <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;"> | ||||||
|  |                                   <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space"> | ||||||
|  |                                   <span class="unit">倍</span> | ||||||
|  |                                   <span class="arrow"></span> | ||||||
|  |                               </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|                 </DIV-cy-tab-pane> |                 </DIV-cy-tab-pane> | ||||||
|                 <DIV-cy-tab-pane label="标注风格"> |                 <DIV-cy-tab-pane label="标注风格"> | ||||||
|                     ${labelStyleElm1()} |                     ${labelStyleElm1()} | ||||||
|  | |||||||
| @ -13,10 +13,12 @@ import MouseTip from '../../../MouseTip' | |||||||
| import Controller from '../../../Controller/index' | import Controller from '../../../Controller/index' | ||||||
| import { syncData, get3DView } from '../../../Global/MultiViewportMode' | import { syncData, get3DView } from '../../../Global/MultiViewportMode' | ||||||
| import { legp } from '../../Element/datalist' | import { legp } from '../../Element/datalist' | ||||||
|  | import { getFontList, getFontFamilyName } from '../../Element/fontSelect' | ||||||
| import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' | import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global' | ||||||
|  |  | ||||||
| class PolylineObject extends Base { | class PolylineObject extends Base { | ||||||
|  |   #unitDataLegpObject | ||||||
|   /** |   /** | ||||||
|    * @constructor |    * @constructor | ||||||
|    * @param sdk |    * @param sdk | ||||||
| @ -30,8 +32,8 @@ class PolylineObject extends Base { | |||||||
|    * @param options['nose-to-tail']=false {boolean} 首尾相连 |    * @param options['nose-to-tail']=false {boolean} 首尾相连 | ||||||
|    * @param options.smooth=false {boolean} 线段圆滑 |    * @param options.smooth=false {boolean} 线段圆滑 | ||||||
|    * @param options.extend=false {boolean} 线缓冲 |    * @param options.extend=false {boolean} 线缓冲 | ||||||
|    * @param options['extend-width']=1 {number} 线缓冲宽度 |    * @param options['extend-width']=10 {number} 线缓冲宽度 | ||||||
|    * @param options['extend-color']=#ffde00 {number} 线缓冲颜色 |    * @param options['extend-color']=rgba(255,255,80,0.3) {number} 线缓冲颜色 | ||||||
|    * @param options.show=true {boolean} 显隐 |    * @param options.show=true {boolean} 显隐 | ||||||
|    * @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...] |    * @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...] | ||||||
|    * @param options.label {object} 标注 |    * @param options.label {object} 标注 | ||||||
| @ -67,8 +69,8 @@ class PolylineObject extends Base { | |||||||
|     this.options['extend-width'] = |     this.options['extend-width'] = | ||||||
|       options['extend-width'] || options['extend-width'] === 0 |       options['extend-width'] || options['extend-width'] === 0 | ||||||
|         ? options['extend-width'] |         ? options['extend-width'] | ||||||
|         : 1 |         : 10 | ||||||
|     this.options['extend-color'] = options['extend-color'] || '#ffde00' |     this.options['extend-color'] = options['extend-color'] || 'rgba(255,255,80,0.3)' | ||||||
|     this.options.show = |     this.options.show = | ||||||
|       options.show || options.show === false ? options.show : true |       options.show || options.show === false ? options.show : true | ||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
| @ -82,6 +84,7 @@ class PolylineObject extends Base { | |||||||
|         options.label.fontSize || options.label.fontSize === 0 |         options.label.fontSize || options.label.fontSize === 0 | ||||||
|           ? options.label.fontSize |           ? options.label.fontSize | ||||||
|           : 20, |           : 20, | ||||||
|  |       fontFamily: options.label.fontFamily ? options.label.fontFamily : 0, | ||||||
|       color: options.label.color || '#ffffff', |       color: options.label.color || '#ffffff', | ||||||
|       lineWidth: |       lineWidth: | ||||||
|         options.label.lineWidth || options.label.lineWidth === 0 |         options.label.lineWidth || options.label.lineWidth === 0 | ||||||
| @ -268,6 +271,7 @@ class PolylineObject extends Base { | |||||||
|       this._elms.lengthUnit.forEach(item => { |       this._elms.lengthUnit.forEach(item => { | ||||||
|         item.value = v |         item.value = v | ||||||
|       }) |       }) | ||||||
|  |     this.#unitDataLegpObject && this.#unitDataLegpObject.legp_searchActive(v) | ||||||
|     if (this.options.lengthByMeter) { |     if (this.options.lengthByMeter) { | ||||||
|       if (this.unitNum > 2) { |       if (this.unitNum > 2) { | ||||||
|         switch (v) { |         switch (v) { | ||||||
| @ -715,6 +719,21 @@ class PolylineObject extends Base { | |||||||
|       }) |       }) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   get labelFontFamily() { | ||||||
|  |     return this.options.label.fontFamily | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   set labelFontFamily(v) { | ||||||
|  |     this.options.label.fontFamily = v || 0 | ||||||
|  |     this.label && (this.label.fontFamily = this.options.label.fontFamily) | ||||||
|  |  | ||||||
|  |     let name = getFontFamilyName(this.labelFontFamily) || '' | ||||||
|  |     this._elms.labelFontFamily && | ||||||
|  |       this._elms.labelFontFamily.forEach(item => { | ||||||
|  |         item.value = name | ||||||
|  |       }) | ||||||
|  |   } | ||||||
|  |  | ||||||
|   get labelColor() { |   get labelColor() { | ||||||
|     return this.options.label.color |     return this.options.label.color | ||||||
|   } |   } | ||||||
| @ -825,7 +844,6 @@ class PolylineObject extends Base { | |||||||
|   set labelLineColor(v) { |   set labelLineColor(v) { | ||||||
|     this.options.label.lineColor = v |     this.options.label.lineColor = v | ||||||
|     this.label.lineColor = v |     this.label.lineColor = v | ||||||
|     let _this = this |  | ||||||
|     if (this._elms.labelLineColor) { |     if (this._elms.labelLineColor) { | ||||||
|       this._elms.labelLineColor.forEach((item, i) => { |       this._elms.labelLineColor.forEach((item, i) => { | ||||||
|         let lineColorPicker = new YJColorPicker({ |         let lineColorPicker = new YJColorPicker({ | ||||||
| @ -840,6 +858,29 @@ class PolylineObject extends Base { | |||||||
|           }, //点击确认按钮事件回调 |           }, //点击确认按钮事件回调 | ||||||
|           clear: () => { |           clear: () => { | ||||||
|             this.labelLineColor = 'rgba(0,255,255,0.5)' |             this.labelLineColor = 'rgba(0,255,255,0.5)' | ||||||
|  |           } //点击清空按钮事件回调 | ||||||
|  |         }) | ||||||
|  |         this._elms.labelLineColor[i] = lineColorPicker | ||||||
|  |       }) | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   get labelBackgroundColorStart() { | ||||||
|  |     return this.options.label.backgroundColor[0] | ||||||
|  |   } | ||||||
|  |   set labelBackgroundColorStart(v) { | ||||||
|  |     this.options.label.backgroundColor[0] = v | ||||||
|  |     this.label.backgroundColor = [v, this.label.backgroundColor[1]] | ||||||
|  |     if (this._elms.labelBackgroundColorStart) { | ||||||
|  |       this._elms.labelBackgroundColorStart.forEach((item, i) => { | ||||||
|  |         let labelBackgroundColorStartPicker = new YJColorPicker({ | ||||||
|  |           el: item.el, | ||||||
|  |           size: 'mini', //颜色box类型 | ||||||
|  |           alpha: true, //是否开启透明度 | ||||||
|  |           defaultColor: this.labelBackgroundColorStart, | ||||||
|  |           disabled: false, //是否禁止打开颜色选择器 | ||||||
|  |           openPickerAni: 'opacity', //打开颜色选择器动画 | ||||||
|  |           sure: color => { | ||||||
|             this.labelBackgroundColorStart = color |             this.labelBackgroundColorStart = color | ||||||
|           }, //点击确认按钮事件回调 |           }, //点击确认按钮事件回调 | ||||||
|           clear: () => { |           clear: () => { | ||||||
| @ -848,7 +889,7 @@ class PolylineObject extends Base { | |||||||
|         }) |         }) | ||||||
|         this._elms.labelBackgroundColorStart[ |         this._elms.labelBackgroundColorStart[ | ||||||
|           i |           i | ||||||
|         ] = _this.labelBackgroundColorStartPicker |         ] = labelBackgroundColorStartPicker | ||||||
|       }) |       }) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @ -1312,6 +1353,7 @@ class PolylineObject extends Base { | |||||||
|       ], |       ], | ||||||
|       text: that.options.name, |       text: that.options.name, | ||||||
|       fontSize: that.options.label.fontSize, |       fontSize: that.options.label.fontSize, | ||||||
|  |       fontFamily: that.options.label.fontFamily, | ||||||
|       color: that.options.label.color, |       color: that.options.label.color, | ||||||
|       pixelOffset: that.options.label.pixelOffset, |       pixelOffset: that.options.label.pixelOffset, | ||||||
|       backgroundColor: that.options.label.backgroundColor, |       backgroundColor: that.options.label.backgroundColor, | ||||||
| @ -1565,6 +1607,9 @@ class PolylineObject extends Base { | |||||||
|           } |           } | ||||||
|           this.nodePoints = [] |           this.nodePoints = [] | ||||||
|           this.positionEditing = false |           this.positionEditing = false | ||||||
|  |           YJ.Measure.SetMeasureStatus(false) | ||||||
|  |           this.event && this.event.destroy() | ||||||
|  |           this.tip && this.tip.destroy() | ||||||
|         }, |         }, | ||||||
|         showCallBack: show => { |         showCallBack: show => { | ||||||
|           this.options.show = show |           this.options.show = show | ||||||
| @ -1799,6 +1844,7 @@ class PolylineObject extends Base { | |||||||
|           '.input-select-unit', |           '.input-select-unit', | ||||||
|           1 |           1 | ||||||
|         ) |         ) | ||||||
|  |         this.#unitDataLegpObject = unitDataLegpObject | ||||||
|         if (unitDataLegpObject) { |         if (unitDataLegpObject) { | ||||||
|           unitDataLegpObject.legp_search(unitData) |           unitDataLegpObject.legp_search(unitData) | ||||||
|           let unitDataLegpElm = this._DialogObject._element.content |           let unitDataLegpElm = this._DialogObject._element.content | ||||||
| @ -2221,6 +2267,37 @@ class PolylineObject extends Base { | |||||||
|           this._elms.altInput.push(altInput) |           this._elms.altInput.push(altInput) | ||||||
|           tBodyElm.appendChild(tr) |           tBodyElm.appendChild(tr) | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         let fontData = getFontList() | ||||||
|  |         let fontObject = legp( | ||||||
|  |           this._DialogObject._element.content.getElementsByClassName( | ||||||
|  |             'font-select-box' | ||||||
|  |           )[0], | ||||||
|  |           '.font-select' | ||||||
|  |         ) | ||||||
|  |         if (fontObject) { | ||||||
|  |           fontObject.legp_search(fontData) | ||||||
|  |           let fontDataLegpElm = this._DialogObject._element.content | ||||||
|  |             .getElementsByClassName('font-select')[0] | ||||||
|  |             .getElementsByTagName('input')[0] | ||||||
|  |           fontDataLegpElm.value = fontData[this.labelFontFamily].value | ||||||
|  |           for (let i = 0; i < fontData.length; i++) { | ||||||
|  |             if (fontData[i].value == fontDataLegpElm.value) { | ||||||
|  |               fontObject.legp_searchActive(fontData[i].value) | ||||||
|  |               break | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |           fontDataLegpElm.addEventListener('input', () => { | ||||||
|  |             for (let i = 0; i < fontData.length; i++) { | ||||||
|  |               if (fontData[i].value === fontDataLegpElm.value) { | ||||||
|  |                 this.labelFontFamily = fontData[i].key | ||||||
|  |                 break | ||||||
|  |               } | ||||||
|  |             } | ||||||
|  |           }) | ||||||
|  |           this._elms.labelFontFamily = [fontDataLegpElm] | ||||||
|  |         } | ||||||
|       }, 0) |       }, 0) | ||||||
|     } else { |     } else { | ||||||
|       if (this._DialogObject && this._DialogObject.close) { |       if (this._DialogObject && this._DialogObject.close) { | ||||||
| @ -2422,6 +2499,7 @@ class PolylineObject extends Base { | |||||||
|     this.labelShow = this.originalOptions.label.show |     this.labelShow = this.originalOptions.label.show | ||||||
|     this.labelColor = this.originalOptions.label.color |     this.labelColor = this.originalOptions.label.color | ||||||
|     this.labelFontSize = this.originalOptions.label.fontSize |     this.labelFontSize = this.originalOptions.label.fontSize | ||||||
|  |     this.labelFontFamily = this.originalOptions.label.fontFamily | ||||||
|     this.labelLineWidth = this.originalOptions.label.lineWidth |     this.labelLineWidth = this.originalOptions.label.lineWidth | ||||||
|     this.labelPixelOffset = this.originalOptions.label.pixelOffset |     this.labelPixelOffset = this.originalOptions.label.pixelOffset | ||||||
|     this.labelLineColor = this.originalOptions.label.lineColor |     this.labelLineColor = this.originalOptions.label.lineColor | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import EventBinding from '../../Element/Dialog/eventBinding'; | |||||||
| import richText from "../../Element/richText"; | import richText from "../../Element/richText"; | ||||||
| import MouseEvent from '../../../Event/index' | import MouseEvent from '../../../Event/index' | ||||||
| import LabelObject from '../LabelObject' | import LabelObject from '../LabelObject' | ||||||
| import { syncData } from '../../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../../Global/MultiViewportMode' | ||||||
| import { legp } from '../../Element/datalist'; | import { legp } from '../../Element/datalist'; | ||||||
| import { getFontList, getFontFamilyName } from '../../Element/fontSelect' | import { getFontList, getFontFamilyName } from '../../Element/fontSelect' | ||||||
| import MouseTip from '../../../MouseTip' | import MouseTip from '../../../MouseTip' | ||||||
| @ -246,16 +246,29 @@ class RadarScan extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|       this.entity.show = v |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|  |         this.entity.show = this.options.show | ||||||
|  |         if (this.options.label.show && this.label) { | ||||||
|  |           this.label.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.entity.show = false | ||||||
|  |         if (this.options.label.show && this.label) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|  |       } | ||||||
|       if (this._DialogObject && this._DialogObject.showBtn) { |       if (this._DialogObject && this._DialogObject.showBtn) { | ||||||
|         this._DialogObject.showBtn.checked = v |         this._DialogObject.showBtn.checked = v | ||||||
|       } |       } | ||||||
|       if (this.options.label.show && this.label) { |        | ||||||
|         this.label.show = v |  | ||||||
|       } |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
| @ -448,8 +461,9 @@ class RadarScan extends Base { | |||||||
|     return this.options.label.show |     return this.options.label.show | ||||||
|   } |   } | ||||||
|   set labelShow(v) { |   set labelShow(v) { | ||||||
|  |     let sdkD = get2DSdk().sdkD | ||||||
|     this.options.label.show = v |     this.options.label.show = v | ||||||
|     if (this.show) { |     if (this.show && (!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|       this.label.show = v |       this.label.show = v | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
| @ -1374,7 +1388,7 @@ class RadarScan extends Base { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async remove() { |   async remove() { | ||||||
|     this.label.remove() |     this.label && this.label.remove() | ||||||
|     this.entity && this.sdk.viewer.entities.remove(this.entity) |     this.entity && this.sdk.viewer.entities.remove(this.entity) | ||||||
|     this.entity2 && this.sdk.viewer.entities.remove(this.entity2) |     this.entity2 && this.sdk.viewer.entities.remove(this.entity2) | ||||||
|     this.entity = null |     this.entity = null | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ class SectorObject extends Base { | |||||||
|    * @param options.id {string} 标注id |    * @param options.id {string} 标注id | ||||||
|    * @param options.name {string} 名称 |    * @param options.name {string} 名称 | ||||||
|    * @param options.show=true {boolean} 显示/隐藏 |    * @param options.show=true {boolean} 显示/隐藏 | ||||||
|    * @param options.color="#ff000080" {string} 颜色 |    * @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色 | ||||||
|    * @param options.center {object} 位置 |    * @param options.center {object} 位置 | ||||||
|    * @param options.center.lng {object} 经度 |    * @param options.center.lng {object} 经度 | ||||||
|    * @param options.center.lat {object} 维度 |    * @param options.center.lat {object} 维度 | ||||||
| @ -39,7 +39,7 @@ class SectorObject extends Base { | |||||||
|   constructor(sdk, options = {}) { |   constructor(sdk, options = {}) { | ||||||
|     super(sdk, options); |     super(sdk, options); | ||||||
|     this.options.name = options.name || '未命名对象' |     this.options.name = options.name || '未命名对象' | ||||||
|     this.options.color = options.color || "#ff000080" |     this.options.color = options.color || "rgba(255, 0, 0, 0.5)" | ||||||
|     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 |     this.options.heightMode = (options.heightMode || options.heightMode == 0) ? options.heightMode : 2 | ||||||
|     this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 |     this.options.semiMinorAxis = (options.semiMinorAxis || options.semiMinorAxis === 0) ? options.semiMinorAxis : 10 | ||||||
|     this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 |     this.options.semiMajorAxis = (options.semiMajorAxis || options.semiMajorAxis === 0) ? options.semiMajorAxis : 20 | ||||||
| @ -47,7 +47,7 @@ class SectorObject extends Base { | |||||||
|     this.options.center = options.center || {} |     this.options.center = options.center || {} | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     options.label = options.label || {} |     options.label = options.label || {} | ||||||
|     this._elms = {}; |     this._elms = {}; | ||||||
| @ -1922,6 +1922,19 @@ class SectorObject extends Base { | |||||||
|         that.cartesian3Towgs84(positions[1], that.sdk.viewer), |         that.cartesian3Towgs84(positions[1], that.sdk.viewer), | ||||||
|         that.cartesian3Towgs84(positions[positions.length - 4], that.sdk.viewer) |         that.cartesian3Towgs84(positions[positions.length - 4], that.sdk.viewer) | ||||||
|       ] |       ] | ||||||
|  |       let objectsToExclude = [...that.sdk.viewer.entities.values] | ||||||
|  |       that | ||||||
|  |         .getClampToHeight({ | ||||||
|  |           lng: that.options.center.lng, | ||||||
|  |           lat: that.options.center.lat | ||||||
|  |         }, objectsToExclude) | ||||||
|  |         .then(height => { | ||||||
|  |           that.label.position = [ | ||||||
|  |             that.options.center.lng, | ||||||
|  |             that.options.center.lat, | ||||||
|  |             height | ||||||
|  |           ] | ||||||
|  |         }) | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|         createNodePoints(positions[1], 'sector-start') |         createNodePoints(positions[1], 'sector-start') | ||||||
|         createNodePoints(positions[positions.length - 4], 'sector-end') |         createNodePoints(positions[positions.length - 4], 'sector-end') | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ class StraightArrowObject extends Base { | |||||||
|     this.options.positions = options.positions || [] |     this.options.positions = options.positions || [] | ||||||
|     this.options.line = options.line || {} |     this.options.line = options.line || {} | ||||||
|     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) |     this.options.line.width = ((this.options.line.width || this.options.line.width === 0) ? this.options.line.width : 3) | ||||||
|     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 0.5)' |     this.options.line.color = this.options.line.color || 'rgba(255, 0, 0, 1)' | ||||||
|     this.options['area-unit'] = options['area-unit'] || '平方米' |     this.options['area-unit'] = options['area-unit'] || '平方米' | ||||||
|     this.entity |     this.entity | ||||||
|     this.event = new MouseEvent(this.sdk) |     this.event = new MouseEvent(this.sdk) | ||||||
|  | |||||||
| @ -417,71 +417,11 @@ class StandText extends Base { | |||||||
|           this.color = 'rgba(255,255,255,1)' |           this.color = 'rgba(255,255,255,1)' | ||||||
|         },//点击清空按钮事件回调 |         },//点击清空按钮事件回调 | ||||||
|       }) |       }) | ||||||
|       let labelColorPicker = new YJColorPicker({ |  | ||||||
|         el: contentElm.getElementsByClassName("labelColor")[0], |  | ||||||
|         size: 'mini',//颜色box类型 |  | ||||||
|         alpha: true,//是否开启透明度 |  | ||||||
|         defaultColor: this.labelColor, |  | ||||||
|         disabled: false,//是否禁止打开颜色选择器 |  | ||||||
|         openPickerAni: 'opacity',//打开颜色选择器动画 |  | ||||||
|         sure: (color) => { |  | ||||||
|           this.labelColor = color |  | ||||||
|         },//点击确认按钮事件回调 |  | ||||||
|         clear: () => { |  | ||||||
|           this.labelColor = 'rgba(255,255,255,1)' |  | ||||||
|         },//点击清空按钮事件回调 |  | ||||||
|       }) |  | ||||||
|       let lineColorPicker = new YJColorPicker({ |  | ||||||
|         el: contentElm.getElementsByClassName("labelLineColor")[0], |  | ||||||
|         size: 'mini',//颜色box类型 |  | ||||||
|         alpha: true,//是否开启透明度 |  | ||||||
|         defaultColor: this.labelLineColor, |  | ||||||
|         disabled: false,//是否禁止打开颜色选择器 |  | ||||||
|         openPickerAni: 'opacity',//打开颜色选择器动画 |  | ||||||
|         sure: (color) => { |  | ||||||
|           this.labelLineColor = color |  | ||||||
|         },//点击确认按钮事件回调 |  | ||||||
|         clear: () => { |  | ||||||
|           this.labelLineColor = 'rgba(255,255,255,1)' |  | ||||||
|         },//点击清空按钮事件回调 |  | ||||||
|       }) |  | ||||||
|       let labelBackgroundColorStartPicker = new YJColorPicker({ |  | ||||||
|         el: contentElm.getElementsByClassName("labelBackgroundColorStart")[0], |  | ||||||
|         size: 'mini', |  | ||||||
|         alpha: true, |  | ||||||
|         defaultColor: this.labelBackgroundColorStart, |  | ||||||
|         disabled: false, |  | ||||||
|         openPickerAni: 'opacity', |  | ||||||
|         sure: (color) => { |  | ||||||
|           this.labelBackgroundColorStart = color |  | ||||||
|         }, |  | ||||||
|         clear: () => { |  | ||||||
|           this.labelBackgroundColorStart = 'rgba(255,255,255,1)' |  | ||||||
|         }, |  | ||||||
|       }) |  | ||||||
|       let labelBackgroundColorEndPicker = new YJColorPicker({ |  | ||||||
|         el: contentElm.getElementsByClassName("labelBackgroundColorEnd")[0], |  | ||||||
|         size: 'mini', |  | ||||||
|         alpha: true, |  | ||||||
|         defaultColor: this.labelBackgroundColorEnd, |  | ||||||
|         disabled: false, |  | ||||||
|         openPickerAni: 'opacity', |  | ||||||
|         sure: (color) => { |  | ||||||
|           this.labelBackgroundColorEnd = color |  | ||||||
|         }, |  | ||||||
|         clear: () => { |  | ||||||
|           this.labelBackgroundColorEnd = 'rgba(255,255,255,1)' |  | ||||||
|         }, |  | ||||||
|       }) |  | ||||||
|  |  | ||||||
|       let all_elm = contentElm.getElementsByTagName("*") |       let all_elm = contentElm.getElementsByTagName("*") | ||||||
|       this._EventBinding.on(this, all_elm) |       this._EventBinding.on(this, all_elm) | ||||||
|       this._elms = this._EventBinding.element |       this._elms = this._EventBinding.element | ||||||
|       this._elms.color = [colorPicker] |       this._elms.color = [colorPicker] | ||||||
|       this._elms.labelColor = [labelColorPicker] |  | ||||||
|       this._elms.labelLineColor = [lineColorPicker] |  | ||||||
|       this._elms.labelBackgroundColorStart = [labelBackgroundColorStartPicker] |  | ||||||
|       this._elms.labelBackgroundColorEnd = [labelBackgroundColorEndPicker] |  | ||||||
|     } else { |     } else { | ||||||
|       if (this._DialogObject && this._DialogObject.remove) { |       if (this._DialogObject && this._DialogObject.remove) { | ||||||
|         this._DialogObject.remove() |         this._DialogObject.remove() | ||||||
|  | |||||||
| @ -182,6 +182,23 @@ function html() { | |||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <span class="custom-divider"></span> |     <span class="custom-divider"></span> | ||||||
|  |     <div class="div-item"> | ||||||
|  |       <div class="row"> | ||||||
|  |         <div class="col"> | ||||||
|  |           <span class="label">油耗</span> | ||||||
|  |           <div class="input-number input-number-unit-6" style="width: 170px;"> | ||||||
|  |             <input class="input" type="number" title="" min="1" max="99999999" @model="unitFuelConsumption"> | ||||||
|  |             <span class="unit">L/100km</span> | ||||||
|  |             <span class="arrow"></span> | ||||||
|  |           </div> | ||||||
|  |         </div> | ||||||
|  |         <div class="col" style="flex: 0 0 0;"> | ||||||
|  |           <span class="label">总油耗</span> | ||||||
|  |           <input class="btn-switch" type="checkbox" @model="fuelShow"> | ||||||
|  |         </div> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     <span class="custom-divider"></span> | ||||||
|     ` |     ` | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -78,6 +78,7 @@ class TrajectoryMotion extends Base { | |||||||
|     this.options.line.smooth = options.line.smooth ? options.line.smooth : false |     this.options.line.smooth = options.line.smooth ? options.line.smooth : false | ||||||
|     this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false |     this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false | ||||||
|     this.positions_smooth = [] |     this.positions_smooth = [] | ||||||
|  |     this.options.unitFuelConsumption = options.unitFuelConsumption || 0 | ||||||
|     this.options.ground = options.ground || false |     this.options.ground = options.ground || false | ||||||
|     this.options.state = (options.state || options.state === false) ? options.state : true |     this.options.state = (options.state || options.state === false) ? options.state : true | ||||||
|     this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true |     this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true | ||||||
| @ -99,7 +100,7 @@ class TrajectoryMotion extends Base { | |||||||
|       color: options.label.color || '#ffffff', |       color: options.label.color || '#ffffff', | ||||||
|       lineWidth: (options.label.lineWidth || options.label.lineWidth === 0) ? options.label.lineWidth : 4, |       lineWidth: (options.label.lineWidth || options.label.lineWidth === 0) ? options.label.lineWidth : 4, | ||||||
|       pixelOffset: (options.label.pixelOffset || options.label.pixelOffset === 0) ? options.label.pixelOffset : 20, |       pixelOffset: (options.label.pixelOffset || options.label.pixelOffset === 0) ? options.label.pixelOffset : 20, | ||||||
|       backgroundColor: options.label.backgroundColor || ['#42c6ef', '#42c6ef'], |       backgroundColor: options.label.backgroundColor || ['#00ffff80', '#00ffff80'], | ||||||
|       lineColor: options.label.lineColor || '#00ffff80', |       lineColor: options.label.lineColor || '#00ffff80', | ||||||
|       scaleByDistance: options.label.scaleByDistance || false, |       scaleByDistance: options.label.scaleByDistance || false, | ||||||
|       near: (options.label.near || options.label.near === 0) ? options.label.near : 2000, |       near: (options.label.near || options.label.near === 0) ? options.label.near : 2000, | ||||||
| @ -144,18 +145,22 @@ class TrajectoryMotion extends Base { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DView() | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|         if (this.originalOptions) { |         if (this.originalOptions) { | ||||||
|           this.originalOptions.show = v |           this.originalOptions.show = v | ||||||
|         } |         } | ||||||
|       if (v) { |       } | ||||||
|  |       if (this.options.show) { | ||||||
|         if (this.firstPersonView) { |         if (this.firstPersonView) { | ||||||
|           this.model.show = false |           this.model.show = false | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           this.model.show = this.modelShow |           this.model.show = (!this.showView || this.showView == 3 || !sdkD) ? this.modelShow : false | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         if ((!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|           this.line.polyline.material = this.lineShow ? new Cesium.PolylineDashMaterialProperty({ |           this.line.polyline.material = this.lineShow ? new Cesium.PolylineDashMaterialProperty({ | ||||||
|             color: new Cesium.Color.fromCssColorString('#00ffff'), |             color: new Cesium.Color.fromCssColorString('#00ffff'), | ||||||
|             dashLength: 20, |             dashLength: 20, | ||||||
| @ -163,18 +168,33 @@ class TrajectoryMotion extends Base { | |||||||
|             color: new Cesium.Color.fromCssColorString('#00ffff00'), |             color: new Cesium.Color.fromCssColorString('#00ffff00'), | ||||||
|             dashLength: 20, |             dashLength: 20, | ||||||
|           }) |           }) | ||||||
|         for (let i = 0; i < this.keyPoints.length; i++) { |  | ||||||
|           this.keyPoints[i].show = this.keyPointShow |  | ||||||
|         } |  | ||||||
|         if (this.realTimeRoute) { |  | ||||||
|           this.realTimeLine && (this.realTimeLine.show = true) |  | ||||||
|         } |  | ||||||
|         this.label && (this.label.show = this.options.label.show) |  | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|         this.model.show = v |           this.line.polyline.material = new Cesium.PolylineDashMaterialProperty({ | ||||||
|  |             color: new Cesium.Color.fromCssColorString('#00ffff00'), | ||||||
|  |             dashLength: 20, | ||||||
|  |           }) | ||||||
|  |         } | ||||||
|  |         for (let i = 0; i < this.keyPoints.length; i++) { | ||||||
|  |           this.keyPoints[i].show = (!this.showView || this.showView == 3 || !sdkD) ? this.keyPointShow : false | ||||||
|  |         } | ||||||
|  |         if (this.realTimeRoute) { | ||||||
|  |           this.realTimeLine && (this.realTimeLine.show = (!this.showView || this.showView == 3 || !sdkD) ? true : false) | ||||||
|  |         } | ||||||
|  |         this.label && (this.label.show = (!this.showView || this.showView == 3) ? this.options.label.show : false) | ||||||
|  |         this.fuelLabel && (this.fuelLabel.show = (!this.showView || this.showView == 3) ? this.options.fuelShow : false) | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.model.show = (!this.showView || this.showView == 3 || !sdkD) ? this.options.show : false | ||||||
|  |         let show = this.options.show | ||||||
|  |         if ((!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|  |           show = this.options.show | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |           show = false | ||||||
|  |         } | ||||||
|         this.realTimeLine && (this.realTimeLine.show = false) |         this.realTimeLine && (this.realTimeLine.show = false) | ||||||
|         this.line.polyline.material = v ? new Cesium.PolylineDashMaterialProperty({ |         this.line.polyline.material = show ? new Cesium.PolylineDashMaterialProperty({ | ||||||
|           color: new Cesium.Color.fromCssColorString('#00ffff'), |           color: new Cesium.Color.fromCssColorString('#00ffff'), | ||||||
|           dashLength: 20, |           dashLength: 20, | ||||||
|         }) : new Cesium.PolylineDashMaterialProperty({ |         }) : new Cesium.PolylineDashMaterialProperty({ | ||||||
| @ -182,9 +202,10 @@ class TrajectoryMotion extends Base { | |||||||
|           dashLength: 20, |           dashLength: 20, | ||||||
|         }) |         }) | ||||||
|         for (let i = 0; i < this.keyPoints.length; i++) { |         for (let i = 0; i < this.keyPoints.length; i++) { | ||||||
|           this.keyPoints[i].show = v |           this.keyPoints[i].show = (!this.showView || this.showView == 3) ? show : false | ||||||
|         } |         } | ||||||
|         this.label && (this.label.show = false) |         this.label && (this.label.show = false) | ||||||
|  |         this.fuelLabel && (this.fuelLabel.show = false) | ||||||
|         this.viewFollow = false |         this.viewFollow = false | ||||||
|       } |       } | ||||||
|  |  | ||||||
| @ -193,6 +214,7 @@ class TrajectoryMotion extends Base { | |||||||
|       } |       } | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
| @ -238,14 +260,17 @@ class TrajectoryMotion extends Base { | |||||||
|       // Cesium.Matrix4.multiplyByTranslation(this.model.modelMatrix, new Cesium.Cartesian3(0, 0, -difference), this.model.modelMatrix) |       // Cesium.Matrix4.multiplyByTranslation(this.model.modelMatrix, new Cesium.Cartesian3(0, 0, -difference), this.model.modelMatrix) | ||||||
|       // Cesium.Matrix4.getTranslation(this.model.modelMatrix, this.model.position) |       // Cesium.Matrix4.getTranslation(this.model.modelMatrix, this.model.position) | ||||||
|       this.label && (this.label.show = this.label.show) |       this.label && (this.label.show = this.label.show) | ||||||
|  |       this.fuelLabel && (this.fuelLabel.show = this.fuelLabel.show) | ||||||
|       if (this.options.label.position) { |       if (this.options.label.position) { | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|           if (this.options.label.position.alt) { |           if (this.options.label.position.alt) { | ||||||
|             this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) |             this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) | ||||||
|  |             this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) | ||||||
|           } |           } | ||||||
|           else { |           else { | ||||||
|             this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { |             this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { | ||||||
|               this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, height]) |               this.label && (this.label.position = [this.options.label.position.lng, this.options.label.position.lat, height]) | ||||||
|  |               this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, height]) | ||||||
|             }) |             }) | ||||||
|           } |           } | ||||||
|         }, 0) |         }, 0) | ||||||
| @ -636,7 +661,7 @@ class TrajectoryMotion extends Base { | |||||||
|         }) |         }) | ||||||
|         this.TweenAnimate.pause() |         this.TweenAnimate.pause() | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|           _this.model.isMove = false |           _this.model && (_this.model.isMove = false) | ||||||
|         }, 200); |         }, 200); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| @ -655,9 +680,17 @@ class TrajectoryMotion extends Base { | |||||||
|     return this.options.model.show |     return this.options.model.show | ||||||
|   } |   } | ||||||
|   set modelShow(v) { |   set modelShow(v) { | ||||||
|  |     let sdkD = get2DView() | ||||||
|     this.options.model.show = v |     this.options.model.show = v | ||||||
|  |     let show = v | ||||||
|  |     if (this.show && (!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|  |       show = v | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       show = false | ||||||
|  |     } | ||||||
|     if (this.model && this.show) { |     if (this.model && this.show) { | ||||||
|       this.model.show = v |       this.model.show = show | ||||||
|     } |     } | ||||||
|     this._elms.modelShow && this._elms.modelShow.forEach((item) => { |     this._elms.modelShow && this._elms.modelShow.forEach((item) => { | ||||||
|       item.checked = v |       item.checked = v | ||||||
| @ -723,8 +756,16 @@ class TrajectoryMotion extends Base { | |||||||
|       this.realTimeRoute = false |       this.realTimeRoute = false | ||||||
|     } |     } | ||||||
|     this.options.line.show = v |     this.options.line.show = v | ||||||
|  |     let show = v | ||||||
|  |     let sdkD = get2DView() | ||||||
|  |     if ((!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|  |       show = v | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       show = false | ||||||
|  |     } | ||||||
|     if (this.line && this.show) { |     if (this.line && this.show) { | ||||||
|       this.line.polyline.material = v ? new Cesium.PolylineDashMaterialProperty({ |       this.line.polyline.material = show ? new Cesium.PolylineDashMaterialProperty({ | ||||||
|         color: new Cesium.Color.fromCssColorString('#00ffff'), |         color: new Cesium.Color.fromCssColorString('#00ffff'), | ||||||
|         dashLength: 20, //短划线长度 |         dashLength: 20, //短划线长度 | ||||||
|       }) : new Cesium.PolylineDashMaterialProperty({ |       }) : new Cesium.PolylineDashMaterialProperty({ | ||||||
| @ -941,6 +982,7 @@ class TrajectoryMotion extends Base { | |||||||
|  |  | ||||||
|   set firstPersonView(v) { |   set firstPersonView(v) { | ||||||
|     // this.state = true |     // this.state = true | ||||||
|  |     let sdkD = get2DView() | ||||||
|     let splitSdk = getSdk() |     let splitSdk = getSdk() | ||||||
|     if (get2DView() || splitSdk.sdkD || !this.show) { |     if (get2DView() || splitSdk.sdkD || !this.show) { | ||||||
|       v = false |       v = false | ||||||
| @ -994,7 +1036,14 @@ class TrajectoryMotion extends Base { | |||||||
|     else { |     else { | ||||||
|       CameraController(this.sdk, true) |       CameraController(this.sdk, true) | ||||||
|       if (this.model && this.modelShow && this.show) { |       if (this.model && this.modelShow && this.show) { | ||||||
|         this.model.show = true |         let show = true | ||||||
|  |         if (this.show && (!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|  |           show = true | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |           show = false | ||||||
|  |         } | ||||||
|  |         this.model.show = show | ||||||
|       } |       } | ||||||
|       if (this._DialogObject && this._DialogObject._element.content) { |       if (this._DialogObject && this._DialogObject._element.content) { | ||||||
|         let e_firstPerson = this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']") |         let e_firstPerson = this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']") | ||||||
| @ -1116,8 +1165,18 @@ class TrajectoryMotion extends Base { | |||||||
|   } |   } | ||||||
|   set labelShow(v) { |   set labelShow(v) { | ||||||
|     this.options.label.show = v |     this.options.label.show = v | ||||||
|  |     let sdkD = get2DView() | ||||||
|  |     let show = v | ||||||
|  |     if (this.show && (!this.showView || this.showView == 3 || !sdkD)) { | ||||||
|  |       show = v | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       show = false | ||||||
|  |     } | ||||||
|     if (this.show) { |     if (this.show) { | ||||||
|       this.label && (this.label.show = v) |       if (this.label) { | ||||||
|  |         this.label.show = show | ||||||
|  |         this.label.pixelOffset = this.options.label.pixelOffset + (this.fuelShow ? this.labelFontSize + 20 : 0) | ||||||
|         if (this.options.label.position) { |         if (this.options.label.position) { | ||||||
|           setTimeout(() => { |           setTimeout(() => { | ||||||
|             if (this.options.label.position.alt) { |             if (this.options.label.position.alt) { | ||||||
| @ -1131,6 +1190,7 @@ class TrajectoryMotion extends Base { | |||||||
|           }, 0); |           }, 0); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  |     } | ||||||
|     else { |     else { | ||||||
|       this.label && (this.label.show = false) |       this.label && (this.label.show = false) | ||||||
|     } |     } | ||||||
| @ -1146,6 +1206,7 @@ class TrajectoryMotion extends Base { | |||||||
|   set labelFontFamily(v) { |   set labelFontFamily(v) { | ||||||
|     this.options.label.fontFamily = v || 0 |     this.options.label.fontFamily = v || 0 | ||||||
|     this.label && (this.label.fontFamily = this.options.label.fontFamily) |     this.label && (this.label.fontFamily = this.options.label.fontFamily) | ||||||
|  |     this.fuelLabel && (this.fuelLabel.fontFamily = this.options.label.fontFamily) | ||||||
|  |  | ||||||
|     let name = getFontFamilyName(this.labelFontFamily) || '' |     let name = getFontFamilyName(this.labelFontFamily) || '' | ||||||
|     this._elms.labelFontFamily && |     this._elms.labelFontFamily && | ||||||
| @ -1160,6 +1221,7 @@ class TrajectoryMotion extends Base { | |||||||
|   set labelColor(v) { |   set labelColor(v) { | ||||||
|     this.options.label.color = v |     this.options.label.color = v | ||||||
|     this.label && (this.label.color = v) |     this.label && (this.label.color = v) | ||||||
|  |     this.fuelLabel && (this.fuelLabel.color = v) | ||||||
|     if (this._elms.labelColor) { |     if (this._elms.labelColor) { | ||||||
|       this._elms.labelColor.forEach((item, i) => { |       this._elms.labelColor.forEach((item, i) => { | ||||||
|         let labelColorPicker = new YJColorPicker({ |         let labelColorPicker = new YJColorPicker({ | ||||||
| @ -1187,6 +1249,13 @@ class TrajectoryMotion extends Base { | |||||||
|   set labelFontSize(v) { |   set labelFontSize(v) { | ||||||
|     this.options.label.fontSize = v |     this.options.label.fontSize = v | ||||||
|     this.label && (this.label.fontSize = v) |     this.label && (this.label.fontSize = v) | ||||||
|  |     if (this.fuelLabel) { | ||||||
|  |       this.fuelLabel.fontSize = v | ||||||
|  |       this.label.pixelOffset = this.options.label.pixelOffset + v + 20 | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       this.label.pixelOffset = this.options.label.pixelOffset | ||||||
|  |     } | ||||||
|     this._elms.labelFontSize && this._elms.labelFontSize.forEach((item) => { |     this._elms.labelFontSize && this._elms.labelFontSize.forEach((item) => { | ||||||
|       item.value = v |       item.value = v | ||||||
|     }) |     }) | ||||||
| @ -1198,6 +1267,7 @@ class TrajectoryMotion extends Base { | |||||||
|   set labelScaleByDistance(v) { |   set labelScaleByDistance(v) { | ||||||
|     this.options.label.scaleByDistance = v |     this.options.label.scaleByDistance = v | ||||||
|     this.label && (this.label.scaleByDistance = v) |     this.label && (this.label.scaleByDistance = v) | ||||||
|  |     this.fuelLabel && (this.fuelLabel.scaleByDistance = v) | ||||||
|     this._elms.labelScaleByDistance && this._elms.labelScaleByDistance.forEach((item) => { |     this._elms.labelScaleByDistance && this._elms.labelScaleByDistance.forEach((item) => { | ||||||
|       item.checked = v |       item.checked = v | ||||||
|     }) |     }) | ||||||
| @ -1213,6 +1283,7 @@ class TrajectoryMotion extends Base { | |||||||
|     } |     } | ||||||
|     this.options.label.near = near |     this.options.label.near = near | ||||||
|     this.label && (this.label.near = near) |     this.label && (this.label.near = near) | ||||||
|  |     this.fuelLabel && (this.fuelLabel.near = near) | ||||||
|     this._elms.labelNear && this._elms.labelNear.forEach((item) => { |     this._elms.labelNear && this._elms.labelNear.forEach((item) => { | ||||||
|       item.value = near |       item.value = near | ||||||
|     }) |     }) | ||||||
| @ -1228,11 +1299,66 @@ class TrajectoryMotion extends Base { | |||||||
|     } |     } | ||||||
|     this.options.label.far = far |     this.options.label.far = far | ||||||
|     this.label && (this.label.far = far) |     this.label && (this.label.far = far) | ||||||
|  |     this.fuelLabel && (this.fuelLabel.far = far) | ||||||
|     this._elms.labelFar && this._elms.labelFar.forEach((item) => { |     this._elms.labelFar && this._elms.labelFar.forEach((item) => { | ||||||
|       item.value = far |       item.value = far | ||||||
|     }) |     }) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   get unitFuelConsumption() { | ||||||
|  |     return this.options.unitFuelConsumption | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   set unitFuelConsumption(v) { | ||||||
|  |     this.options.unitFuelConsumption = v | ||||||
|  |     this._elms.unitFuelConsumption && this._elms.unitFuelConsumption.forEach((item) => { | ||||||
|  |       item.value = v | ||||||
|  |     }) | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   get fuelShow() { | ||||||
|  |     return this.options.fuelShow | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   set fuelShow(v) { | ||||||
|  |     this.options.fuelShow = v | ||||||
|  |     let show = v | ||||||
|  |     if (this.show && (!this.showView || this.showView == 3)) { | ||||||
|  |       show = v | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       show = false | ||||||
|  |     } | ||||||
|  |     if (this.show) { | ||||||
|  |       if (this.fuelLabel) { | ||||||
|  |         this.fuelLabel.show = show | ||||||
|  |         this.label.pixelOffset = this.options.label.pixelOffset + (show ? this.labelFontSize + 20 : 0) | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.label.pixelOffset = this.options.label.pixelOffset | ||||||
|  |       } | ||||||
|  |       if (this.options.label.position) { | ||||||
|  |         setTimeout(() => { | ||||||
|  |           if (this.options.label.position.alt) { | ||||||
|  |             this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, this.options.label.position.alt]) | ||||||
|  |           } | ||||||
|  |           else { | ||||||
|  |             this.getClampToHeight({ lng: this.options.label.position.lng, lat: this.options.label.position.lat }).then((height) => { | ||||||
|  |               this.fuelLabel && (this.fuelLabel.position = [this.options.label.position.lng, this.options.label.position.lat, height]) | ||||||
|  |             }) | ||||||
|  |           } | ||||||
|  |         }, 0); | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       this.fuelLabel && (this.fuelLabel.show = false) | ||||||
|  |       this.label.pixelOffset = this.options.label.pixelOffset | ||||||
|  |     } | ||||||
|  |     this._elms.fuelShow && this._elms.fuelShow.forEach((item) => { | ||||||
|  |       item.checked = v | ||||||
|  |     }) | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // 创建路径 |   // 创建路径 | ||||||
|   static addLine(that) { |   static addLine(that) { | ||||||
|     let positions_smooth = that.renewLinePositions(that.options.line.positions) |     let positions_smooth = that.renewLinePositions(that.options.line.positions) | ||||||
| @ -1351,6 +1477,7 @@ class TrajectoryMotion extends Base { | |||||||
|     } |     } | ||||||
|     let pos = that.smooth ? that.positions_smooth : Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArrayHeights) |     let pos = that.smooth ? that.positions_smooth : Cesium.Cartesian3.fromDegreesArrayHeights(fromDegreesArrayHeights) | ||||||
|     TrajectoryMotion.createLabel(that) |     TrajectoryMotion.createLabel(that) | ||||||
|  |     TrajectoryMotion.createFuelLabel(that) | ||||||
|     that.modelMove(pos) |     that.modelMove(pos) | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -1360,13 +1487,13 @@ class TrajectoryMotion extends Base { | |||||||
|   static async createLabel(that) { |   static async createLabel(that) { | ||||||
|     let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer) |     let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer) | ||||||
|     that.label = new LabelObject(that.sdk, { |     that.label = new LabelObject(that.sdk, { | ||||||
|       show: that.options.show ? (that.options.model.show ? that.options.label.show : false) : false, |       show: that.options.show ? (that.options.label.show ? true : false) : false, | ||||||
|       position: [labelPosition.lng, labelPosition.lat, labelPosition.alt], |       position: [labelPosition.lng, labelPosition.lat, labelPosition.alt], | ||||||
|       text: that.options.name, |       text: that.options.name, | ||||||
|       fontSize: that.options.label.fontSize, |       fontSize: that.options.label.fontSize, | ||||||
|       fontFamily: that.options.label.fontFamily, |       fontFamily: that.options.label.fontFamily, | ||||||
|       color: that.options.label.color, |       color: that.options.label.color, | ||||||
|       pixelOffset: that.options.label.pixelOffset, |       pixelOffset: that.options.label.pixelOffset + (that.options.fuelShow ? that.options.label.fontSize + 20 : 0), | ||||||
|       backgroundColor: that.options.label.backgroundColor, |       backgroundColor: that.options.label.backgroundColor, | ||||||
|       lineColor: that.options.label.lineColor, |       lineColor: that.options.label.lineColor, | ||||||
|       lineWidth: that.options.label.lineWidth, |       lineWidth: that.options.label.lineWidth, | ||||||
| @ -1376,6 +1503,26 @@ class TrajectoryMotion extends Base { | |||||||
|     }, that.model) |     }, that.model) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   static async createFuelLabel(that) { | ||||||
|  |     let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer) | ||||||
|  |     that.fuelLabel = new LabelObject(that.sdk, { | ||||||
|  |       show: that.options.show ? (that.options.fuelShow ? true : false) : false, | ||||||
|  |       // show: true, | ||||||
|  |       position: [labelPosition.lng, labelPosition.lat, labelPosition.alt], | ||||||
|  |       text: '总油耗:', | ||||||
|  |       fontSize: that.options.label.fontSize, | ||||||
|  |       fontFamily: that.options.label.fontFamily, | ||||||
|  |       color: that.options.label.color, | ||||||
|  |       pixelOffset: 0, | ||||||
|  |       backgroundColor: ['#6e6e6e', '#6e6e6e'], | ||||||
|  |       lineColor: '#00ffff00', | ||||||
|  |       lineWidth: 0, | ||||||
|  |       scaleByDistance: that.options.label.scaleByDistance, | ||||||
|  |       near: that.options.label.near, | ||||||
|  |       far: that.options.label.far | ||||||
|  |     }, that.model) | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // 创建关键点 |   // 创建关键点 | ||||||
|   static async addKeyPoint(that) { |   static async addKeyPoint(that) { | ||||||
|     for (let i = 0; i < that.options.line.positions.length; i++) { |     for (let i = 0; i < that.options.line.positions.length; i++) { | ||||||
| @ -1481,7 +1628,7 @@ class TrajectoryMotion extends Base { | |||||||
|       setPosition(startDistance) |       setPosition(startDistance) | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|         _this.model.isMove = false |         _this.model.isMove = false | ||||||
|       }, 500); |       }, 1000); | ||||||
|  |  | ||||||
|  |  | ||||||
|       animateUpdate() |       animateUpdate() | ||||||
| @ -1504,6 +1651,8 @@ class TrajectoryMotion extends Base { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     async function setPosition(distance) { |     async function setPosition(distance) { | ||||||
|  |       _this.totalFuelConsumption = Number((distance / 100 * _this.unitFuelConsumption).toFixed(2)) | ||||||
|  |       _this.fuelLabel.text = '总油耗:' + _this.totalFuelConsumption + ' L' | ||||||
|       _this.model.isMove = true |       _this.model.isMove = true | ||||||
|       let sdk2D = get2DView() |       let sdk2D = get2DView() | ||||||
|       let splitSdk = getSdk() |       let splitSdk = getSdk() | ||||||
| @ -1715,6 +1864,7 @@ class TrajectoryMotion extends Base { | |||||||
|       } |       } | ||||||
|       let labelPosition = _this.cartesian3Towgs84(position, _this.sdk.viewer) |       let labelPosition = _this.cartesian3Towgs84(position, _this.sdk.viewer) | ||||||
|       _this.label.position = [labelPosition.lng, labelPosition.lat, labelPosition.alt] |       _this.label.position = [labelPosition.lng, labelPosition.lat, labelPosition.alt] | ||||||
|  |       _this.fuelLabel.position = [labelPosition.lng, labelPosition.lat, labelPosition.alt] | ||||||
|       lastDistance = distance |       lastDistance = distance | ||||||
|       // console.log(position) |       // console.log(position) | ||||||
|       _this.realTimeRouteArray.push(position) |       _this.realTimeRouteArray.push(position) | ||||||
| @ -2036,7 +2186,7 @@ class TrajectoryMotion extends Base { | |||||||
|       rubricElm.style.color = '#ff5733'; |       rubricElm.style.color = '#ff5733'; | ||||||
|       rubricElm.style.display = 'none' |       rubricElm.style.display = 'none' | ||||||
|  |  | ||||||
|       rubricElm.innerHTML = `场景正北方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>` |       rubricElm.innerHTML = `场景正东方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>` | ||||||
|       let iconRubric = contentElm.getElementsByClassName('icon-rubric')[0] |       let iconRubric = contentElm.getElementsByClassName('icon-rubric')[0] | ||||||
|       iconRubric.addEventListener('mouseenter', (e) => { |       iconRubric.addEventListener('mouseenter', (e) => { | ||||||
|         rubricElm.style.display = 'block' |         rubricElm.style.display = 'block' | ||||||
| @ -2111,6 +2261,7 @@ class TrajectoryMotion extends Base { | |||||||
|     this.sdk.viewer.entities.remove(this.line) |     this.sdk.viewer.entities.remove(this.line) | ||||||
|     this.sdk.viewer.entities.remove(this.realTimeLine) |     this.sdk.viewer.entities.remove(this.realTimeLine) | ||||||
|     this.label && this.label.remove() |     this.label && this.label.remove() | ||||||
|  |     this.fuelLabel && this.fuelLabel.remove() | ||||||
|     for (let i = 0; i < this.keyPointShow.length; i++) { |     for (let i = 0; i < this.keyPointShow.length; i++) { | ||||||
|       this.sdk.viewer.entities.remove(this.keyPointShow[i]) |       this.sdk.viewer.entities.remove(this.keyPointShow[i]) | ||||||
|     } |     } | ||||||
| @ -2118,6 +2269,7 @@ class TrajectoryMotion extends Base { | |||||||
|     this.realTimeLine = null |     this.realTimeLine = null | ||||||
|     this.model = null |     this.model = null | ||||||
|     this.label = null |     this.label = null | ||||||
|  |     this.fuelLabel = null | ||||||
|     if (this._DialogObject && !this._DialogObject.isDestroy) { |     if (this._DialogObject && !this._DialogObject.isDestroy) { | ||||||
|       this._DialogObject.close() |       this._DialogObject.close() | ||||||
|       this._DialogObject = null |       this._DialogObject = null | ||||||
| @ -2171,6 +2323,7 @@ class TrajectoryMotion extends Base { | |||||||
|       this.model && (this.model.show = false) |       this.model && (this.model.show = false) | ||||||
|     } |     } | ||||||
|     this.labelShow = this.originalOptions.label.show |     this.labelShow = this.originalOptions.label.show | ||||||
|  |     this.fuelLabelShow = this.originalOptions.fuelShow | ||||||
|     this.labelColor = this.originalOptions.label.color |     this.labelColor = this.originalOptions.label.color | ||||||
|     this.labelFontSize = this.originalOptions.label.fontSize |     this.labelFontSize = this.originalOptions.label.fontSize | ||||||
|     this.labelFontFamily = this.originalOptions.label.fontFamily |     this.labelFontFamily = this.originalOptions.label.fontFamily | ||||||
| @ -2229,7 +2382,6 @@ class TrajectoryMotion extends Base { | |||||||
|           this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].innerHTML = '结束调整' |           this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].innerHTML = '结束调整' | ||||||
|           this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].className = 'btn model-rotate-btn is-active' |           this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].className = 'btn model-rotate-btn is-active' | ||||||
|         } |         } | ||||||
|         console.log(this._DialogObject._element.content, this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0]) |  | ||||||
|         this.state = false |         this.state = false | ||||||
|         this.editObj = new EditGltf(this.sdk, this.model) |         this.editObj = new EditGltf(this.sdk, this.model) | ||||||
|         this.editObj.editRtation() |         this.editObj.editRtation() | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ class eventBinding { | |||||||
|       let Event = [] |       let Event = [] | ||||||
|       let isEvent = false |       let isEvent = false | ||||||
|       let removeName = [] |       let removeName = [] | ||||||
|  |       let blurEvent = ()=>{} | ||||||
|       if (!elements[i] ||!elements[i].attributes) { |       if (!elements[i] ||!elements[i].attributes) { | ||||||
|         continue;  |         continue;  | ||||||
|       } |       } | ||||||
| @ -37,6 +38,26 @@ class eventBinding { | |||||||
|                 let value = e.target.value |                 let value = e.target.value | ||||||
|                 if (e.target.type == 'number') { |                 if (e.target.type == 'number') { | ||||||
|                   if (e.data != '.' && (e.data != '-' || e.target.value)) { |                   if (e.data != '.' && (e.data != '-' || e.target.value)) { | ||||||
|  |                     let v = Number(value) | ||||||
|  |                     if((e.target.max) && v>Number(e.target.max)) { | ||||||
|  |                       value = Number(e.target.max) | ||||||
|  |                     } | ||||||
|  |                     if((e.target.min) && v<Number(e.target.min)) { | ||||||
|  |                       value = Number(e.target.min) | ||||||
|  |                     } | ||||||
|  |                     if((e.target.dataset.min) && v<Number(e.target.dataset.min)) { | ||||||
|  |                       value = Number(e.target.dataset.min) | ||||||
|  |                     } | ||||||
|  |                     that[m.value] = value | ||||||
|  |                   } | ||||||
|  |                 } | ||||||
|  |                 else { | ||||||
|  |                   that[m.value] = value | ||||||
|  |                 } | ||||||
|  |               }) | ||||||
|  |               blurEvent = (e) => { | ||||||
|  |                 let value = e.target.value | ||||||
|  |                 if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) { | ||||||
|                   value = Number(value) |                   value = Number(value) | ||||||
|                   if ((e.target.max) && value > Number(e.target.max)) { |                   if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|                     value = Number(e.target.max) |                     value = Number(e.target.max) | ||||||
| @ -47,13 +68,9 @@ class eventBinding { | |||||||
|                   if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { |                   if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|                     value = Number(e.target.dataset.min) |                     value = Number(e.target.dataset.min) | ||||||
|                   } |                   } | ||||||
|  |                 } | ||||||
|                 that[m.value] = value |                 that[m.value] = value | ||||||
|               } |               } | ||||||
|                 } |  | ||||||
|                 else { |  | ||||||
|                   that[m.value] = value |  | ||||||
|                 } |  | ||||||
|               }) |  | ||||||
|               if(elements[i].nodeName=='IMG') { |               if(elements[i].nodeName=='IMG') { | ||||||
|                 elements[i].src = that[m.value] |                 elements[i].src = that[m.value] | ||||||
|               } |               } | ||||||
| @ -111,6 +128,9 @@ class eventBinding { | |||||||
|             Event[t](e) |             Event[t](e) | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|  |         elements[i].addEventListener('blur', (e) => { | ||||||
|  |           blurEvent(e) | ||||||
|  |         }); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ class eventBinding { | |||||||
|       let Event = [] |       let Event = [] | ||||||
|       let isEvent = false |       let isEvent = false | ||||||
|       let removeName = [] |       let removeName = [] | ||||||
|  |       let blurEvent = () => { } | ||||||
|       if (!elements[i] || !elements[i].attributes) { |       if (!elements[i] || !elements[i].attributes) { | ||||||
|         continue; |         continue; | ||||||
|       } |       } | ||||||
| @ -37,11 +38,11 @@ class eventBinding { | |||||||
|                 let value = e.target.value |                 let value = e.target.value | ||||||
|                 if (e.target.type == 'number') { |                 if (e.target.type == 'number') { | ||||||
|                   if (e.data != '.' && (e.data != '-' || e.target.value)) { |                   if (e.data != '.' && (e.data != '-' || e.target.value)) { | ||||||
|                     value = Number(value) |                     let v = Number(value) | ||||||
|                     if((e.target.max) && value>Number(e.target.max)) { |                     if ((e.target.max) && v > Number(e.target.max)) { | ||||||
|                       value = Number(e.target.max) |                       value = Number(e.target.max) | ||||||
|                     } |                     } | ||||||
|                     if((e.target.min) && value<Number(e.target.min)) { |                     if ((e.target.min) && v < Number(e.target.min)) { | ||||||
|                       value = Number(e.target.min) |                       value = Number(e.target.min) | ||||||
|                     } |                     } | ||||||
|                     that[m.value] = value |                     that[m.value] = value | ||||||
| @ -51,6 +52,24 @@ class eventBinding { | |||||||
|                   that[m.value] = value |                   that[m.value] = value | ||||||
|                 } |                 } | ||||||
|               }) |               }) | ||||||
|  |               blurEvent = (e) => { | ||||||
|  |                 let value = e.target.value | ||||||
|  |                 if ((e.target.type == 'number') && (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null)))) { | ||||||
|  |                   value = Number(value) | ||||||
|  |                   if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|  |                     value = Number(e.target.max) | ||||||
|  |                   } | ||||||
|  |                   if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|  |                     value = Number(e.target.min) | ||||||
|  |                   } | ||||||
|  |                   if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |                     value = Number(e.target.dataset.min) | ||||||
|  |                   } | ||||||
|  |                 } | ||||||
|  |                 that[m.value] = value | ||||||
|  |               } | ||||||
|  |  | ||||||
|  |  | ||||||
|               if (elements[i].nodeName == 'IMG') { |               if (elements[i].nodeName == 'IMG') { | ||||||
|                 elements[i].src = that[m.value] |                 elements[i].src = that[m.value] | ||||||
|               } |               } | ||||||
| @ -108,6 +127,9 @@ class eventBinding { | |||||||
|             Event[t](e) |             Event[t](e) | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|  |         elements[i].addEventListener('blur', (e) => { | ||||||
|  |           blurEvent(e) | ||||||
|  |         }); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -88,6 +88,10 @@ class WallStereoscopic extends Base { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   get type() { | ||||||
|  |     return 'wallStereoscopic' | ||||||
|  |   } | ||||||
|  |  | ||||||
|   static createLabel(that) { |   static createLabel(that) { | ||||||
|     // 标签 |     // 标签 | ||||||
|     that.label = new LabelObject(that.sdk, { |     that.label = new LabelObject(that.sdk, { | ||||||
|  | |||||||
| @ -35,7 +35,8 @@ class eventBinding { | |||||||
|             else { |             else { | ||||||
|               Event.push((e) => { |               Event.push((e) => { | ||||||
|                 let value = e.target.value |                 let value = e.target.value | ||||||
|                 if (e.target.type == 'number') { |                 let str = e.target.value + '' | ||||||
|  |                 if (e.target.type == 'number' && !(str.charAt(str.length - 1) == '0' && e.target.value.toString().includes('.'))) { | ||||||
|                   value = Number(value) |                   value = Number(value) | ||||||
|                 } |                 } | ||||||
|                 that[m.value] = value |                 that[m.value] = value | ||||||
|  | |||||||
| @ -10,10 +10,12 @@ import { getHost, getToken } from "../../on"; | |||||||
| import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback"; | import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback"; | ||||||
| import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback"; | import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback"; | ||||||
| import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen"; | import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen"; | ||||||
| import { syncData } from '../../Global/MultiViewportMode' | import { syncData, getSdk as get2DSdk } from '../../Global/MultiViewportMode' | ||||||
| import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../Global/global' | import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../Global/global' | ||||||
|  |  | ||||||
| class Base extends Tools { | class Base extends Tools { | ||||||
|  |   #_showView | ||||||
|  |   #_isShowView | ||||||
|   constructor(sdk, options = {}) { |   constructor(sdk, options = {}) { | ||||||
|     super(sdk, options); |     super(sdk, options); | ||||||
|     if (!sdk || !sdk.viewer) { |     if (!sdk || !sdk.viewer) { | ||||||
| @ -29,6 +31,7 @@ class Base extends Tools { | |||||||
|     this.rightClickCallBack = null |     this.rightClickCallBack = null | ||||||
|     this.picking = true |     this.picking = true | ||||||
|     this.options.host = this.options.host || getHost() |     this.options.host = this.options.host || getHost() | ||||||
|  |     // this.#_showView = this.options.showView || 0 | ||||||
|     this.setDefaultValue() |     this.setDefaultValue() | ||||||
|  |  | ||||||
|     // this.sdk.addIncetance(this.options.id, this) |     // this.sdk.addIncetance(this.options.id, this) | ||||||
| @ -55,6 +58,60 @@ class Base extends Tools { | |||||||
|   //   setSplitDirection(this._splitDirection, this.options.id) |   //   setSplitDirection(this._splitDirection, this.options.id) | ||||||
|   // } |   // } | ||||||
|  |  | ||||||
|  |   get showView() { | ||||||
|  |     return this.#_showView | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   set showView(v) { | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     let sdk2D = get2DSdk().sdkD | ||||||
|  |     if (!sdk2D) { | ||||||
|  |       this.#_showView = v | ||||||
|  |       if(this.entity) { | ||||||
|  |         this.entity._showView = v | ||||||
|  |       } | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  |     if (this.sdk === sdk2D) { | ||||||
|  |       this.#_showView = 0 | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  |     if (!this.#_showView && !this.show) { | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  |     if (this.sdk === sdk2D) { | ||||||
|  |       this.#_showView = 0 | ||||||
|  |       return | ||||||
|  |     } | ||||||
|  |     if (v != 2 && v != 3) { | ||||||
|  |       this.#_showView = 0 | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       this.#_showView = v | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     this.isShowView = true | ||||||
|  |  | ||||||
|  |     // if(!this.show) { | ||||||
|  |     //   return | ||||||
|  |     // } | ||||||
|  |  | ||||||
|  |     if (!this.#_showView) { | ||||||
|  |       this.show = true | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       if (v == 2) { | ||||||
|  |         this.show = false | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.show = true | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   get name() { |   get name() { | ||||||
|     return this.options.name |     return this.options.name | ||||||
|   } |   } | ||||||
| @ -72,19 +129,60 @@ class Base extends Tools { | |||||||
|  |  | ||||||
|   set show(v) { |   set show(v) { | ||||||
|     if (typeof v === "boolean") { |     if (typeof v === "boolean") { | ||||||
|  |       let sdkD = get2DSdk().sdkD | ||||||
|  |       if (!this.isShowView || !sdkD) { | ||||||
|         this.options.show = v |         this.options.show = v | ||||||
|         if (this.originalOptions) { |         if (this.originalOptions) { | ||||||
|           this.originalOptions.show = v |           this.originalOptions.show = v | ||||||
|         } |         } | ||||||
|       this.entity && (this.entity.show = v) |  | ||||||
|       if (this._DialogObject && this._DialogObject.showBtn) { |  | ||||||
|         this._DialogObject.showBtn.checked = v |  | ||||||
|       } |       } | ||||||
|  |       this.entity._showView = this.showView | ||||||
|  |       if (this.type == 'layer') { | ||||||
|  |         if (this.entity) { | ||||||
|  |           this.entity._objectState = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       if (!this.showView || this.showView == 3 || !sdkD) { | ||||||
|  |         this.entity && (this.entity.show = this.options.show) | ||||||
|         if (this.options.label && this.options.label.show && this.label) { |         if (this.options.label && this.options.label.show && this.label) { | ||||||
|         this.label.show = v |           this.label.show = this.options.show | ||||||
|         } |         } | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         this.entity && (this.entity.show = false) | ||||||
|  |         if (this.options.label && this.options.label.show && this.label) { | ||||||
|  |           this.label.show = false | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       if (this._DialogObject && this._DialogObject.showBtn) { | ||||||
|  |         this._DialogObject.showBtn.checked = this.options.show | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |  | ||||||
|       syncData(this.sdk, this.options.id) |       syncData(this.sdk, this.options.id) | ||||||
|       syncSplitData(this.sdk, this.options.id) |       syncSplitData(this.sdk, this.options.id) | ||||||
|  |       this.isShowView = false | ||||||
|  |  | ||||||
|  |       if (this.type == 'layer' && sdkD) { | ||||||
|  |         let layer2d = sdkD.viewer.imageryLayers._layers[this.layerIndex] | ||||||
|  |         let layer3d = this.entity | ||||||
|  |  | ||||||
|  |         if (!layer2d) { | ||||||
|  |           return | ||||||
|  |         } | ||||||
|  |         if (layer3d._objectState) { | ||||||
|  |           if (!layer3d._showView || layer3d._showView == 2) { | ||||||
|  |             layer2d.show = true | ||||||
|  |           } | ||||||
|  |           if (layer3d._showView == 3) { | ||||||
|  |             layer2d.show = false | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |           layer2d.show = this.options.show | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     } else { |     } else { | ||||||
|       console.error("参数必须为boolean") |       console.error("参数必须为boolean") | ||||||
|     } |     } | ||||||
| @ -192,7 +290,7 @@ class Base extends Tools { | |||||||
|       let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) |       let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt) | ||||||
|  |  | ||||||
|       let position = { lng: 0, lat: 0 } |       let position = { lng: 0, lat: 0 } | ||||||
|       if (this.options.position) { |       if (this.options.position && Object.prototype.toString.call(this.options.position) === '[object Object]') { | ||||||
|         position = { ...this.options.position } |         position = { ...this.options.position } | ||||||
|       } |       } | ||||||
|       else if (this.options.positions) { |       else if (this.options.positions) { | ||||||
| @ -338,7 +436,7 @@ class Base extends Tools { | |||||||
|  |  | ||||||
|       let position = { lng: 0, lat: 0 } |       let position = { lng: 0, lat: 0 } | ||||||
|       let relativePosition = { ...cameraPosition84 } |       let relativePosition = { ...cameraPosition84 } | ||||||
|       if (this.options.position) { |       if (this.options.position && Object.prototype.toString.call(this.options.position) === '[object Object]') { | ||||||
|         position = { ...this.options.position } |         position = { ...this.options.position } | ||||||
|       } |       } | ||||||
|       else if (this.options.positions) { |       else if (this.options.positions) { | ||||||
|  | |||||||
| @ -55,6 +55,9 @@ class EventBinding { | |||||||
|                       if ((e.target.min) && value < Number(e.target.min)) { |                       if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|                         value = Number(e.target.min) |                         value = Number(e.target.min) | ||||||
|                       } |                       } | ||||||
|  |                       if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |                         value = Number(e.target.dataset.min) | ||||||
|  |                       } | ||||||
|                       that[m.value] = value |                       that[m.value] = value | ||||||
|                     } |                     } | ||||||
|                   } |                   } | ||||||
|  | |||||||
| @ -2,13 +2,10 @@ import BaseDialog from '../../../BaseDialog'; | |||||||
|  |  | ||||||
| class Dialog extends BaseDialog { | class Dialog extends BaseDialog { | ||||||
|   constructor(sdk, info, options, only) { |   constructor(sdk, info, options, only) { | ||||||
|     super(sdk.viewer._container, options); |     super(sdk.viewer._container, options, only); | ||||||
|     this.sdk = sdk |     this.sdk = sdk | ||||||
|     this.viewer = sdk.viewer |     this.viewer = sdk.viewer | ||||||
|     this.info = info |     this.info = info | ||||||
|     if (only) { |  | ||||||
|       this.closeAll() |  | ||||||
|     } |  | ||||||
|     this._init() |     this._init() | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,6 +1,13 @@ | |||||||
| class cy_tabs { | class cy_tabs { | ||||||
|   constructor(id, clickTabCallBack, sdk) { |   constructor(boxElm, clickTabCallBack, sdk) { | ||||||
|     let elm = document.getElementById(id); |     let elm | ||||||
|  |     if(typeof boxElm === 'string') { | ||||||
|  |       elm = document.getElementById(boxElm); | ||||||
|  |     } | ||||||
|  |     else { | ||||||
|  |       elm = boxElm | ||||||
|  |     } | ||||||
|  |     // let elm = document.getElementById(id); | ||||||
|     let pane = elm.getElementsByTagName('DIV-cy-tab-pane') |     let pane = elm.getElementsByTagName('DIV-cy-tab-pane') | ||||||
|  |  | ||||||
|     let tabTop = `<div class="DIV-cy-tab-top">` |     let tabTop = `<div class="DIV-cy-tab-top">` | ||||||
| @ -37,7 +44,9 @@ | |||||||
|     tabContent = tabContent + `</div>` |     tabContent = tabContent + `</div>` | ||||||
|  |  | ||||||
|     let BoxElm = document.createElement('div'); |     let BoxElm = document.createElement('div'); | ||||||
|     BoxElm.setAttribute('id', id) |     if(typeof boxElm === 'string') { | ||||||
|  |       BoxElm.setAttribute('id', boxElm) | ||||||
|  |     } | ||||||
|     BoxElm.setAttribute('class', 'DIV-cy-tabs') |     BoxElm.setAttribute('class', 'DIV-cy-tabs') | ||||||
|     BoxElm.innerHTML = tabTop + tabContent |     BoxElm.innerHTML = tabTop + tabContent | ||||||
|     elm.parentNode.insertBefore(BoxElm, elm); |     elm.parentNode.insertBefore(BoxElm, elm); | ||||||
|  | |||||||
| @ -56,8 +56,8 @@ class richText { | |||||||
|       MENU_CONF: { |       MENU_CONF: { | ||||||
|         uploadImage: { |         uploadImage: { | ||||||
|           fieldName: 'file', |           fieldName: 'file', | ||||||
|           maxFileSize: 50 * 1024 * 1024, |           // maxFileSize: 50 * 1024 * 1024, | ||||||
|           base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 |           // base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 | ||||||
|           server: this.uploadImageServer, |           server: this.uploadImageServer, | ||||||
|           // // 上传之前触发 |           // // 上传之前触发 | ||||||
|           // onBeforeUpload(file) { // TS 语法 |           // onBeforeUpload(file) { // TS 语法 | ||||||
| @ -95,18 +95,18 @@ class richText { | |||||||
|           //   console.log(`${file.name} 上传出错`, err, res) |           //   console.log(`${file.name} 上传出错`, err, res) | ||||||
|           // }, |           // }, | ||||||
|  |  | ||||||
|           // // 自定义上传 |           // 自定义上传 | ||||||
|           // async customUpload(file, insertFn) {  // TS 语法 |           async customUpload(file, insertFn) {  // TS 语法 | ||||||
|           //   // async customUpload(file, insertFn) {                   // JS 语法 |             // async customUpload(file, insertFn) {                   // JS 语法 | ||||||
|           //   // file 即选中的文件 |             // file 即选中的文件 | ||||||
|           //   // 自己实现上传,并得到图片 url alt href |             // 自己实现上传,并得到图片 url alt href | ||||||
|           //   // 最后插入图片 |             // 最后插入图片 | ||||||
|           //   console.log(file, insertFn) |             let url = await _this.upload(file) | ||||||
|           //   insertFn(url, file.name) |             insertFn((_this.host = _this.host || getHost()) + '/' + url) | ||||||
|           // } |           } | ||||||
|         }, |         }, | ||||||
|         uploadVideo: { |         uploadVideo: { | ||||||
|           maxFileSize: 500 * 1024 * 1024, |           // maxFileSize: 500 * 1024 * 1024, | ||||||
|           server: this.uploadVideoServer, |           server: this.uploadVideoServer, | ||||||
|           allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'], |           allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'], | ||||||
|           // 自定义上传 |           // 自定义上传 | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| let list = ['icon-py', 'icon-edit', 'icon-add', 'icon-add2', 'icon-minus', 'icon-play', 'icon-pause', 'icon-updateheight', 'icon-draw', 'icon-positions', 'icon-reset', 'icon-xj', 'icon-yj', 'icon-zj', 'icon-close', 'icon-query', 'icon-route', 'icon-copy', 'icon-load', 'icon-rubric', 'icon-pen', 'icon-cross'] | let list = ['icon-py', 'icon-edit', 'icon-add', 'icon-add2', 'icon-minus', 'icon-play', 'icon-pause', 'icon-updateheight', 'icon-draw', 'icon-positions', 'icon-reset', 'icon-xj', 'icon-yj', 'icon-zj', 'icon-close', 'icon-query', 'icon-route', 'icon-copy', 'icon-load', 'icon-rubric', 'icon-pen', 'icon-cross', 'icom-confirm'] | ||||||
| function setSvg() { | function setSvg() { | ||||||
|   let svgElm = document.createElement('svg'); |   let svgElm = document.createElement('svg'); | ||||||
|   svgElm.xmlns = 'http://www.w3.org/2000/svg' |   svgElm.xmlns = 'http://www.w3.org/2000/svg' | ||||||
|  | |||||||
| @ -1,7 +1,11 @@ | |||||||
| class YJColorPicker { | class YJColorPicker { | ||||||
|   constructor(options = {}) { |   constructor(options = {}) { | ||||||
|     let _this = this |     let _this = this | ||||||
|     let pickAlphaInput |     let RInput | ||||||
|  |     let GInput | ||||||
|  |     let BInput | ||||||
|  |     let AInput | ||||||
|  |  | ||||||
|     let config = { |     let config = { | ||||||
|       el: options.el, |       el: options.el, | ||||||
|       size: "mini", |       size: "mini", | ||||||
| @ -12,18 +16,22 @@ class YJColorPicker { | |||||||
|       hasClear: true, |       hasClear: true, | ||||||
|       openPickerAni: 'opacity', |       openPickerAni: 'opacity', | ||||||
|       defaultColor: options.defaultColor, |       defaultColor: options.defaultColor, | ||||||
|  |       pickerInputChange: pickerInputChange, | ||||||
|       startMainCallback: (t) => { |       startMainCallback: (t) => { | ||||||
|  |         _this.colorPicker && (_this.colorPicker.picker.style.opacity = 0) | ||||||
|  |         setTimeout(() => { | ||||||
|           customizeStyle() |           customizeStyle() | ||||||
|  |         }, 0); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     this.el = options.el |     this.el = options.el | ||||||
|     if (options.sure) { |     if (options.sure) { | ||||||
|       config.sure = (color) => { |       config.sure = (color) => { | ||||||
|         this.colorPicker.config.defaultColor = this.colorPicker.pickerInput.value |         // this.colorPicker.config.defaultColor = this.colorPicker.pickerInput.value | ||||||
|         let c = Cesium.Color.fromCssColorString(color) |         let c = Cesium.Color.fromCssColorString(color) | ||||||
|         if (pickAlphaInput) { |         if (AInput) { | ||||||
|           c = c.withAlpha(pickAlphaInput.value / 100) |           c = c.withAlpha(AInput.value) | ||||||
|           this.pickAlphaInputValue = pickAlphaInput.value |           this.pickAlphaInputValue = AInput.value | ||||||
|         } |         } | ||||||
|         color = c.toCssHexString() |         color = c.toCssHexString() | ||||||
|         if (typeof options.sure == 'function') { |         if (typeof options.sure == 'function') { | ||||||
| @ -34,8 +42,8 @@ class YJColorPicker { | |||||||
|     } |     } | ||||||
|     if (options.clear) { |     if (options.clear) { | ||||||
|       config.clear = () => { |       config.clear = () => { | ||||||
|         if (pickAlphaInput) { |         if (AInput) { | ||||||
|           pickAlphaInput.value = this.pickAlphaInputValue = 100 |           AInput.value = this.pickAlphaInputValue = 1 | ||||||
|         } |         } | ||||||
|         this.colorPicker.config.defaultColor = '' |         this.colorPicker.config.defaultColor = '' | ||||||
|         customizeStyle() |         customizeStyle() | ||||||
| @ -66,42 +74,93 @@ class YJColorPicker { | |||||||
|     customizeStyle() |     customizeStyle() | ||||||
|  |  | ||||||
|     function customizeStyle() { |     function customizeStyle() { | ||||||
|       if (!_this.colorPicker) { |       if (!_this.colorPicker || !_this.colorPicker.picker) { | ||||||
|         return |         return | ||||||
|       } |       } | ||||||
|       let isSubtract = false |       let isSubtract = false | ||||||
|       let box = _this.colorPicker.box |       let box = _this.colorPicker.box | ||||||
|       let picker = _this.colorPicker.picker |       let picker = _this.colorPicker.picker | ||||||
|  |       let x = box.getBoundingClientRect().x | ||||||
|  |       let y = box.getBoundingClientRect().y | ||||||
|  |       let height = 0 | ||||||
|  |  | ||||||
|  |       // if (picker.style.display === 'none') { | ||||||
|  |       //   picker.style.display = 'block' | ||||||
|  |       //   height = picker.offsetHeight | ||||||
|  |       //   console.log('picker.style.display.opacity', picker.style.display.opacity) | ||||||
|  |       //   picker.style.display = 'none' | ||||||
|  |       // } | ||||||
|  |       // console.log('===========================================') | ||||||
|  |       // console.log((y + box.offsetHeight + 4),  height, window.innerHeight) | ||||||
|  |       // if ((y + box.offsetHeight + 4) + height > window.innerHeight) { | ||||||
|  |       //   console.log(y, height) | ||||||
|  |       //   picker.style.top = y - height + 'px' | ||||||
|  |       // } | ||||||
|  |       // else { | ||||||
|  |       //   picker.style.top = (y + box.offsetHeight + 4) + 'px' | ||||||
|  |       // } | ||||||
|  |  | ||||||
|  |       picker.style.left = x + 'px' | ||||||
|       picker.style.minWidth = '325px' |       picker.style.minWidth = '325px' | ||||||
|       let pickerContent = picker.getElementsByClassName('ew-color-picker-content')[0] |       // let pickerContent = picker.getElementsByClassName('ew-color-picker-content')[0] | ||||||
|       let pickAlphaSliderBar = picker.getElementsByClassName('ew-alpha-slider-bar')[0] |       let pickAlphaSliderBar = picker.getElementsByClassName('ew-alpha-slider-bar')[0] | ||||||
|       if (pickAlphaSliderBar) { |       if (pickAlphaSliderBar) { | ||||||
|         pickAlphaSliderBar.parentNode.style.width = '16px' |         pickAlphaSliderBar.parentNode.style.width = '16px' | ||||||
|         pickAlphaSliderBar.parentNode.removeChild(pickAlphaSliderBar) |         pickAlphaSliderBar.parentNode.removeChild(pickAlphaSliderBar) | ||||||
|       } |       } | ||||||
|       // let customDivider = document.createElement('span') |  | ||||||
|       // customDivider.className = 'custom-divider' |  | ||||||
|       // customDivider.style.margin = '10px 0' |  | ||||||
|       // pickerContent.parentNode.insertBefore(customDivider, pickerContent.nextSibling) |  | ||||||
|       let pickPen = document.createElement('div') |       let pickPen = document.createElement('div') | ||||||
|       pickPen.className = 'icon-pen-box' |       pickPen.className = 'icon-pen-box' | ||||||
|       pickPen.innerHTML = '<svg class="icon-pen"><use xlink:href="#yj-icon-pen"></use></svg>' |       pickPen.innerHTML = '<svg class="icon-pen"><use xlink:href="#yj-icon-pen"></use></svg>' | ||||||
|  |  | ||||||
|  |       /** 为完成、暂时隐藏 */////// | ||||||
|  |       pickPen.style.display = 'none' | ||||||
|  |       pickPen.style.cursor = 'unset' | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|       let pickerInput = _this.colorPicker.pickerInput |       let pickerInput = _this.colorPicker.pickerInput | ||||||
|       pickerInput.parentNode.insertBefore(pickPen, pickerInput) |       pickerInput.parentNode.insertBefore(pickPen, pickerInput) | ||||||
|       pickerInput.style.width = '188px' |       pickerInput.style.width = '188px' | ||||||
|  |       pickerInput.style.display = 'none' | ||||||
|  |  | ||||||
|       if (options.alpha) { |       let colorInputBox = document.createElement('div') | ||||||
|         let pickAlpha = document.createElement('div') |       let row1Elm = document.createElement('div') | ||||||
|         pickAlpha.className = 'input-number input-number-unit-1 color-alpha' |       row1Elm.className = 'row' | ||||||
|         pickAlpha.innerHTML = ` |       row1Elm.style.margin = '6px 0 0 0' | ||||||
|         <input class="input" type="number" title="" step="0.01" min="0" max="100"> |       row1Elm.innerHTML = ` | ||||||
|         <span class="unit">%</span> |           <div class="col">R</div> | ||||||
|         <span class="arrow"></span>` |           <div class="col">G</div> | ||||||
|         pickerInput.parentNode.insertBefore(pickAlpha, pickerInput.nextSibling) |           <div class="col">B</div> | ||||||
|         pickerInput.style.width = '106px' |           <div class="col" style="flex: 0 0 92px;"></div> | ||||||
|         pickAlpha.style.width = '80px' |       ` | ||||||
|         pickAlphaInput = pickAlpha.getElementsByClassName('input')[0] |       let row2Elm = document.createElement('div') | ||||||
|         pickAlphaInput.addEventListener('blur', (e) => { |       row2Elm.className = 'row' | ||||||
|  |       row2Elm.innerHTML = ` | ||||||
|  |           <div class="col"> | ||||||
|  |             <input type="number" step="1" min="0" max="255"> | ||||||
|  |           </div> | ||||||
|  |           <div class="col"> | ||||||
|  |             <input type="number" step="1" min="0" max="255"> | ||||||
|  |           </div> | ||||||
|  |           <div class="col"> | ||||||
|  |             <input type="number" step="1" min="0" max="255"> | ||||||
|  |           </div> | ||||||
|  |       ` | ||||||
|  |       colorInputBox.appendChild(row1Elm) | ||||||
|  |       colorInputBox.appendChild(row2Elm) | ||||||
|  |       let Inputs = row2Elm.getElementsByTagName('input') | ||||||
|  |       Inputs[0].style.width = '72px' | ||||||
|  |       Inputs[1].style.width = '72px' | ||||||
|  |       Inputs[2].style.width = '72px' | ||||||
|  |       RInput = Inputs[0] | ||||||
|  |       GInput = Inputs[1] | ||||||
|  |       BInput = Inputs[2] | ||||||
|  |  | ||||||
|  |       let dropbtns = picker.getElementsByClassName('ew-color-dropbtns')[0] | ||||||
|  |       picker.insertBefore(colorInputBox, dropbtns) | ||||||
|  |  | ||||||
|  |       RInput.addEventListener('blur', (e) => { | ||||||
|         let value = e.target.value |         let value = e.target.value | ||||||
|         if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { |         if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { | ||||||
|           value = Number(value) |           value = Number(value) | ||||||
| @ -114,23 +173,105 @@ class YJColorPicker { | |||||||
|           if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { |           if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|             value = Number(e.target.dataset.min) |             value = Number(e.target.dataset.min) | ||||||
|           } |           } | ||||||
|             pickAlphaInput.value = Number(value.toFixed(2)) |           RInput.value = parseInt(value) | ||||||
|  |           _this.colorPicker.hsba = colorRgbaToHsba(`rgb(${RInput.value}, ${GInput.value}, ${BInput.value})`) | ||||||
|  |           _this.colorPicker.changeColor(_this.colorPicker, _this.colorPicker.pickerPanel.offsetWidth,_this.colorPicker.pickerPanel.offsetHeight) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |       GInput.addEventListener('blur', (e) => { | ||||||
|  |         let value = e.target.value | ||||||
|  |         if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { | ||||||
|  |           value = Number(value) | ||||||
|  |           if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|  |             value = Number(e.target.max) | ||||||
|  |           } | ||||||
|  |           if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|  |             value = Number(e.target.min) | ||||||
|  |           } | ||||||
|  |           if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |             value = Number(e.target.dataset.min) | ||||||
|  |           } | ||||||
|  |           GInput.value = parseInt(value) | ||||||
|  |           _this.colorPicker.hsba = colorRgbaToHsba(`rgb(${RInput.value}, ${GInput.value}, ${BInput.value})`) | ||||||
|  |           _this.colorPicker.changeColor(_this.colorPicker, _this.colorPicker.pickerPanel.offsetWidth,_this.colorPicker.pickerPanel.offsetHeight) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |       BInput.addEventListener('blur', (e) => { | ||||||
|  |         let value = e.target.value | ||||||
|  |         if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { | ||||||
|  |           value = Number(value) | ||||||
|  |           if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|  |             value = Number(e.target.max) | ||||||
|  |           } | ||||||
|  |           if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|  |             value = Number(e.target.min) | ||||||
|  |           } | ||||||
|  |           if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |             value = Number(e.target.dataset.min) | ||||||
|  |           } | ||||||
|  |           BInput.value = parseInt(value) | ||||||
|  |           _this.colorPicker.hsba = colorRgbaToHsba(`rgb(${RInput.value}, ${GInput.value}, ${BInput.value})`) | ||||||
|  |           _this.colorPicker.changeColor(_this.colorPicker, _this.colorPicker.pickerPanel.offsetWidth,_this.colorPicker.pickerPanel.offsetHeight) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |       if (options.alpha) { | ||||||
|  |         Inputs[0].style.width = '52px' | ||||||
|  |         Inputs[1].style.width = '52px' | ||||||
|  |         Inputs[2].style.width = '52px' | ||||||
|  |         let pickAlpha = document.createElement('div') | ||||||
|  |         pickAlpha.className = 'input-number input-number-unit color-alpha' | ||||||
|  |         pickAlpha.innerHTML = ` | ||||||
|  |         <input class="input" type="number" title="" step="0.01" min="0" max="1"> | ||||||
|  |         <span class="arrow"></span>` | ||||||
|  |         pickerInput.parentNode.insertBefore(pickAlpha, pickerInput.nextSibling) | ||||||
|  |         pickAlpha.style.width = '66px' | ||||||
|  |         pickAlpha.style.margin = '0 6px 0 0' | ||||||
|  |         AInput = pickAlpha.getElementsByClassName('input')[0] | ||||||
|  |         row1Elm.innerHTML = ` | ||||||
|  |           <div class="col">R</div> | ||||||
|  |           <div class="col">G</div> | ||||||
|  |           <div class="col">B</div> | ||||||
|  |           <div class="col">A</div> | ||||||
|  |           <div class="col" style="flex: 0 0 106px;"></div> | ||||||
|  |         ` | ||||||
|  |         row2Elm.appendChild(pickAlpha) | ||||||
|  |         AInput.addEventListener('blur', (e) => { | ||||||
|  |           let value = e.target.value | ||||||
|  |           if (e.target.value || (e.target.dataset.null !== 'undefined' && e.target.dataset.null !== '' && !Boolean(e.target.dataset.null))) { | ||||||
|  |             value = Number(value) | ||||||
|  |             if ((e.target.max) && value > Number(e.target.max)) { | ||||||
|  |               value = Number(e.target.max) | ||||||
|  |             } | ||||||
|  |             if ((e.target.min) && value < Number(e.target.min)) { | ||||||
|  |               value = Number(e.target.min) | ||||||
|  |             } | ||||||
|  |             if ((e.target.dataset.min) && value < Number(e.target.dataset.min)) { | ||||||
|  |               value = Number(e.target.dataset.min) | ||||||
|  |             } | ||||||
|  |             AInput.value = parseInt(value * 100) / 100 | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|         if (_this.pickAlphaInputValue || _this.pickAlphaInputValue === 0 || _this.pickAlphaInputValue === '0') { |         if (_this.pickAlphaInputValue || _this.pickAlphaInputValue === 0 || _this.pickAlphaInputValue === '0') { | ||||||
|           pickAlphaInput.value = Number(Number(_this.pickAlphaInputValue).toFixed(2)) |           AInput.value = parseInt(_this.pickAlphaInputValue * 100) / 100 | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           pickAlphaInput.value = CesiumColor ? Number((CesiumColor.alpha * 100).toFixed(2)) : 100 |           AInput.value = CesiumColor ? parseInt(Number(CesiumColor.alpha.toFixed(2)) * 100) / 100 : 1 | ||||||
|         } |         } | ||||||
|         _this.pickAlphaInputValue = pickAlphaInput.value |         _this.pickAlphaInputValue = AInput.value | ||||||
|         box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').withAlpha(pickAlphaInput.value / 100).toCssColorString() |         box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').withAlpha(AInput.value).toCssColorString() | ||||||
|       } |       } | ||||||
|       else { |       else { | ||||||
|         CesiumColor = CesiumColor ? CesiumColor.withAlpha(1) : '' |         CesiumColor = CesiumColor ? CesiumColor.withAlpha(1) : '' | ||||||
|         box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').toCssColorString() |         box.style.background = Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').toCssColorString() | ||||||
|       } |       } | ||||||
|  |  | ||||||
|  |       let btngroup = picker.getElementsByClassName('ew-color-dropbtngroup')[0] | ||||||
|  |       row2Elm.appendChild(btngroup) | ||||||
|  |  | ||||||
|       let defineColorContainer = picker.getElementsByClassName('ew-pre-define-color-container')[0] |       let defineColorContainer = picker.getElementsByClassName('ew-pre-define-color-container')[0] | ||||||
|       if (defineColorContainer) { |       if (defineColorContainer) { | ||||||
|         let colorList = localStorage.getItem('custom-color') |         let colorList = localStorage.getItem('custom-color') | ||||||
| @ -157,8 +298,10 @@ class YJColorPicker { | |||||||
|         addColorBtn.className = 'yj-pre-collect-color add' |         addColorBtn.className = 'yj-pre-collect-color add' | ||||||
|  |  | ||||||
|         let subtractColorBtn = document.createElement('div') |         let subtractColorBtn = document.createElement('div') | ||||||
|         subtractColorBtn.innerHTML = '<svg class="icon-minus"><use xlink:href="#yj-icon-minus"></use></svg>' |         subtractColorBtn.innerHTML = '<svg class="icon-minus" style="display: unset;"><use xlink:href="#yj-icon-minus"></use></svg><svg class="icon-confirm" style="display: none;"><use xlink:href="#yj-icom-confirm"></use></svg>' | ||||||
|         subtractColorBtn.className = 'yj-pre-collect-color subtract' |         subtractColorBtn.className = 'yj-pre-collect-color subtract' | ||||||
|  |         let minusIcon = subtractColorBtn.getElementsByClassName('icon-minus')[0] | ||||||
|  |         let confirmIcon = subtractColorBtn.getElementsByClassName('icon-confirm')[0] | ||||||
|         collectColorContainer.appendChild(addColorBtn) |         collectColorContainer.appendChild(addColorBtn) | ||||||
|         collectColorContainer.appendChild(subtractColorBtn) |         collectColorContainer.appendChild(subtractColorBtn) | ||||||
|  |  | ||||||
| @ -217,8 +360,8 @@ class YJColorPicker { | |||||||
|  |  | ||||||
|           let color = colorRgbaToHex(colorHsbaToRgba(_this.colorPicker.hsba)) |           let color = colorRgbaToHex(colorHsbaToRgba(_this.colorPicker.hsba)) | ||||||
|           let c = Cesium.Color.fromCssColorString(color || '#ffffff') |           let c = Cesium.Color.fromCssColorString(color || '#ffffff') | ||||||
|           if (pickAlphaInput) { |           if (AInput) { | ||||||
|             c = c.withAlpha(pickAlphaInput.value / 100) |             c = c.withAlpha(AInput.value) | ||||||
|           } |           } | ||||||
|           let colorString = c.toCssHexString() |           let colorString = c.toCssHexString() | ||||||
|           colorItemElm.style.backgroundColor = colorString |           colorItemElm.style.backgroundColor = colorString | ||||||
| @ -252,23 +395,43 @@ class YJColorPicker { | |||||||
|         subtractColorBtn.addEventListener('click', () => { |         subtractColorBtn.addEventListener('click', () => { | ||||||
|           isSubtract = !isSubtract |           isSubtract = !isSubtract | ||||||
|           if (isSubtract) { |           if (isSubtract) { | ||||||
|  |             minusIcon.style.display = 'none' | ||||||
|  |             confirmIcon.style.display = 'unset' | ||||||
|             for (let i = 0; i < subtractElmList.length; i++) { |             for (let i = 0; i < subtractElmList.length; i++) { | ||||||
|               subtractElmList[i].style.display = 'block' |               subtractElmList[i].style.display = 'block' | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|           else { |           else { | ||||||
|  |             minusIcon.style.display = 'unset' | ||||||
|  |             confirmIcon.style.display = 'none' | ||||||
|             for (let i = 0; i < subtractElmList.length; i++) { |             for (let i = 0; i < subtractElmList.length; i++) { | ||||||
|               subtractElmList[i].style.display = 'none' |               subtractElmList[i].style.display = 'none' | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|  |  | ||||||
|  |       height = picker.offsetHeight | ||||||
|  |       if (picker.style.display === 'none') { | ||||||
|  |         picker.style.display = 'block' | ||||||
|  |         height = picker.offsetHeight | ||||||
|  |         picker.style.display = 'none' | ||||||
|  |       } | ||||||
|  |       if ((y + box.offsetHeight + 4) + height > window.innerHeight) { | ||||||
|  |         picker.style.top = y - height + 'px' | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         picker.style.top = (y + box.offsetHeight + 4) + 'px' | ||||||
|  |       } | ||||||
|  |       _this.colorPicker.pancelTop = parseFloat(picker.style.top) - 2 | ||||||
|  |  | ||||||
|  |       pickerInputChange(Cesium.Color.fromCssColorString(_this.colorPicker.config.defaultColor || '#ffffff').toCssHexString()) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     function clickDefineColor(color) { |     function clickDefineColor(color) { | ||||||
|       if (pickAlphaInput) { |       if (AInput) { | ||||||
|         let c = Cesium.Color.fromCssColorString(color) |         let c = Cesium.Color.fromCssColorString(color) | ||||||
|         pickAlphaInput.value = Number((c.alpha * 100).toFixed(2)) |         AInput.value = parseInt(Number(c.alpha.toFixed(2)) * 100) / 100 | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @ -321,6 +484,84 @@ class YJColorPicker { | |||||||
|           "#" + n |           "#" + n | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     function colorHexToRgba(hex, alpha) { | ||||||
|  |       let a = alpha || 1, | ||||||
|  |         hColor = hex.toLowerCase(), | ||||||
|  |         hLen = hex.length, | ||||||
|  |         rgbaColor = []; | ||||||
|  |       hColor = Cesium.Color.fromCssColorString(hColor).toCssHexString().substring(0, 7) | ||||||
|  |       const colorRegExp = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; | ||||||
|  |       if (hex && colorRegExp.test(hColor)) { | ||||||
|  |         //the hex length may be 4 or 7,contained the symbol of # | ||||||
|  |         if (hLen === 4) { | ||||||
|  |           let hSixColor = '#'; | ||||||
|  |  | ||||||
|  |           for (let i = 1; i < hLen; i++) { | ||||||
|  |             let sColor = hColor.slice(i, i + 1); | ||||||
|  |             hSixColor += sColor.concat(sColor); | ||||||
|  |           } | ||||||
|  |  | ||||||
|  |           hColor = hSixColor; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         for (let j = 1, len = hColor.length; j < len; j += 2) { | ||||||
|  |           rgbaColor.push(parseInt('0X' + hColor.slice(j, j + 2), 16)); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         // return "rgba(" + rgbaColor.join(",") + ',' + a + ")"; | ||||||
|  |         return rgbaColor; | ||||||
|  |       } else { | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     function colorRgbaToHsba(e) { | ||||||
|  |       var t = e.slice(e.indexOf("(") + 1, e.lastIndexOf(")")).split(",") | ||||||
|  |         , r = t.length < 4 ? 1 : Number(t[3]) | ||||||
|  |         , n = Number(t[0]) / 255 | ||||||
|  |         , o = Number(t[1]) / 255 | ||||||
|  |         , i = Number(t[2]) / 255 | ||||||
|  |         , a = void 0 | ||||||
|  |         , s = void 0 | ||||||
|  |         , l = void 0 | ||||||
|  |         , c = Math.min(n, o, i) | ||||||
|  |         , d = l = Math.max(n, o, i) | ||||||
|  |         , u = d - c; | ||||||
|  |       if (d === c) | ||||||
|  |           a = 0; | ||||||
|  |       else { | ||||||
|  |           switch (d) { | ||||||
|  |           case n: | ||||||
|  |               a = (o - i) / u + (o < i ? 6 : 0); | ||||||
|  |               break; | ||||||
|  |           case o: | ||||||
|  |               a = 2 + (i - n) / u; | ||||||
|  |               break; | ||||||
|  |           case i: | ||||||
|  |               a = 4 + (n - o) / u | ||||||
|  |           } | ||||||
|  |           a = Math.round(60 * a) | ||||||
|  |       } | ||||||
|  |       s = 0 === d ? 0 : 1 - c / d; | ||||||
|  |       return s = Math.round(100 * s), | ||||||
|  |       l = Math.round(100 * l), | ||||||
|  |       { | ||||||
|  |           h: a, | ||||||
|  |           s: s, | ||||||
|  |           b: l, | ||||||
|  |           a: r | ||||||
|  |       } | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |     function pickerInputChange(v) { | ||||||
|  |       if (_this.colorPicker && _this.colorPicker.pickerInput) { | ||||||
|  |         let rgbaColor = colorHexToRgba(v || _this.colorPicker.pickerInput.value) | ||||||
|  |         RInput.value = rgbaColor[0] | ||||||
|  |         GInput.value = rgbaColor[1] | ||||||
|  |         BInput.value = rgbaColor[2] | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -70,7 +70,7 @@ function StreamWall1() { | |||||||
|       fragColor.rgb = color.rgb / 1.0;\n\ |       fragColor.rgb = color.rgb / 1.0;\n\ | ||||||
|       fragColor = czm_gammaCorrect(fragColor);\n\ |       fragColor = czm_gammaCorrect(fragColor);\n\ | ||||||
|       material.alpha = colorImage.a * color.a;\n\ |       material.alpha = colorImage.a * color.a;\n\ | ||||||
|       material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\ |       material.diffuse = color.rgb/20.0;\n\ | ||||||
|       material.emission = fragColor.rgb;\n\ |       material.emission = fragColor.rgb;\n\ | ||||||
|       return material;\n\ |       return material;\n\ | ||||||
|       }"; |       }"; | ||||||
| @ -208,6 +208,14 @@ function StreamWall2() { | |||||||
|           Property.equals(this.repeat, other._repeat) && |           Property.equals(this.repeat, other._repeat) && | ||||||
|           Property.equals(this.repeats, other._repeats) |           Property.equals(this.repeats, other._repeats) | ||||||
|       }; |       }; | ||||||
|  |       // let code2 = 'material.diffuse = color.rgb*1.0;' | ||||||
|  |       // if (uniforms.is2D) { | ||||||
|  |       //   code2 = ` | ||||||
|  |       //     material.diffuse = color.rgb*0.0; | ||||||
|  |       //     material.emission = color.rgb * 1.0; | ||||||
|  |       //   ` | ||||||
|  |       // } | ||||||
|  |       // console.log(code2, uniforms.is2D) | ||||||
|       // 将定义的材质对象添加到cesium的材质队列中 |       // 将定义的材质对象添加到cesium的材质队列中 | ||||||
|       Material._materialCache.addMaterial(MaterialType, { |       Material._materialCache.addMaterial(MaterialType, { | ||||||
|         fabric: { |         fabric: { | ||||||
| @ -230,8 +238,8 @@ function StreamWall2() { | |||||||
|               else { |               else { | ||||||
|                 material.alpha = 1.0; |                 material.alpha = 1.0; | ||||||
|               } |               } | ||||||
|               material.diffuse = colorImage.rgb*color.rgb*0.0; |               material.diffuse = color.rgb*0.0; | ||||||
|               material.emission = colorImage.rgb*color.rgb * 1.4; |               material.emission = color.rgb * 1.0; | ||||||
|               return material; |               return material; | ||||||
|           }`, |           }`, | ||||||
|           components: { |           components: { | ||||||
|  | |||||||
							
								
								
									
										33
									
								
								static/3rdparty/ewPlugins.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										33
									
								
								static/3rdparty/ewPlugins.min.js
									
									
									
									
										vendored
									
									
								
							| @ -746,6 +746,7 @@ | |||||||
|         o.colorHsbaToRgba)(e.hsba) : e.pickerInput.value = (0, |         o.colorHsbaToRgba)(e.hsba) : e.pickerInput.value = (0, | ||||||
|         o.colorRgbaToHex)((0, |         o.colorRgbaToHex)((0, | ||||||
|         o.colorHsbaToRgba)(e.hsba)) |         o.colorHsbaToRgba)(e.hsba)) | ||||||
|  |         e.config.pickerInputChange && e.config.pickerInputChange() | ||||||
|     } |     } | ||||||
|     function f(e) { |     function f(e) { | ||||||
|         if (this.pickerFlag = !1, |         if (this.pickerFlag = !1, | ||||||
| @ -795,6 +796,8 @@ | |||||||
|                 n.isFunction)(e.sure) ? e.sure : null, |                 n.isFunction)(e.sure) ? e.sure : null, | ||||||
|                 clear: (0, |                 clear: (0, | ||||||
|                 n.isFunction)(e.clear) ? e.clear : null, |                 n.isFunction)(e.clear) ? e.clear : null, | ||||||
|  |                 pickerInputChange: (0, | ||||||
|  |                     n.isFunction)(e.pickerInputChange) ? e.pickerInputChange : null, | ||||||
|                 startMainCallback: (0, |                 startMainCallback: (0, | ||||||
|                   n.isFunction)(e.startMainCallback) ? e.startMainCallback : null, |                   n.isFunction)(e.startMainCallback) ? e.startMainCallback : null, | ||||||
|                 clickDefineColor: (0, |                 clickDefineColor: (0, | ||||||
| @ -807,8 +810,10 @@ | |||||||
|             else |             else | ||||||
|                 this.init(o, this.config) |                 this.init(o, this.config) | ||||||
|         } |         } | ||||||
|  |         this.changeColor = g | ||||||
|         this.close = () => { |         this.close = () => { | ||||||
|           this.pickerFlag = !this.pickerFlag, |           this.pickerFlag = !this.pickerFlag, | ||||||
|  |           this.picker.style.opacity = 0 | ||||||
|           this.render(this.box.parentNode, this.config), |           this.render(this.box.parentNode, this.config), | ||||||
|           d(this), |           d(this), | ||||||
|           g(this, this.panelWidth, this.panelHeight) |           g(this, this.panelWidth, this.panelHeight) | ||||||
| @ -890,6 +895,7 @@ | |||||||
|             var u = i - e.hsba.a * i; |             var u = i - e.hsba.a * i; | ||||||
|             c(e.alphaBarThumb, "top", u + "px") |             c(e.alphaBarThumb, "top", u + "px") | ||||||
|         } |         } | ||||||
|  |         e.config.pickerInputChange && e.config.pickerInputChange() | ||||||
|     } |     } | ||||||
|     function b(e, t) { |     function b(e, t) { | ||||||
|         var r = e.hueBar.offsetHeight |         var r = e.hueBar.offsetHeight | ||||||
| @ -965,6 +971,7 @@ | |||||||
|     } |     } | ||||||
|     , |     , | ||||||
|     f.prototype.startMain = function(e, t) { |     f.prototype.startMain = function(e, t) { | ||||||
|  |         // console.log(e,t) | ||||||
|         var r = this; |         var r = this; | ||||||
|         this.box = l(e, "ew-color-picker-box"), |         this.box = l(e, "ew-color-picker-box"), | ||||||
|         this.box.setAttribute("color-box-id", this.uid), |         this.box.setAttribute("color-box-id", this.uid), | ||||||
| @ -1002,8 +1009,21 @@ | |||||||
|             c += s.offsetParent.offsetTop, |             c += s.offsetParent.offsetTop, | ||||||
|             f += s.offsetParent.offsetLeft, |             f += s.offsetParent.offsetLeft, | ||||||
|             s = s.offsetParent; |             s = s.offsetParent; | ||||||
|         this.pancelLeft = f, |         this.pancelLeft = f; | ||||||
|         this.pancelTop = c + e.offsetHeight, |         let defineColorContainer = this.picker.getElementsByClassName('ew-pre-define-color-container')[0] | ||||||
|  |         let customColorHeight = 0 | ||||||
|  |         if(defineColorContainer) { | ||||||
|  |             let colorList = localStorage.getItem('custom-color') || '{}' | ||||||
|  |             colorList = JSON.parse(colorList) | ||||||
|  |             customColorHeight = (Math.floor((Object.keys(colorList).length+2) / 11)+1) * 30 | ||||||
|  |         } | ||||||
|  |         this.picker.style.display = 'block' | ||||||
|  |         this.pancelTop = e.getBoundingClientRect().y + (e.offsetHeight + customColorHeight) + 2 | ||||||
|  |         if((this.picker.offsetHeight + customColorHeight) + this.pancelTop > window.innerHeight) { | ||||||
|  |             this.pancelTop = e.getBoundingClientRect().y - (this.picker.offsetHeight + customColorHeight) | ||||||
|  |             this.picker.style.top = this.pancelTop + 2 + 'px' | ||||||
|  |         } | ||||||
|  |         this.picker.style.display = 'none' | ||||||
|         this.preDefineItem = l(e, "ew-pre-define-color", !0), |         this.preDefineItem = l(e, "ew-pre-define-color", !0), | ||||||
|         this.preDefineItem.length && (0, |         this.preDefineItem.length && (0, | ||||||
|         n.ewObjToArray)(this.preDefineItem).map(function(e) { |         n.ewObjToArray)(this.preDefineItem).map(function(e) { | ||||||
| @ -1054,7 +1074,7 @@ | |||||||
|         }, !1), |         }, !1), | ||||||
|         this.pickerClear.addEventListener("click", function() { |         this.pickerClear.addEventListener("click", function() { | ||||||
|             !function(e, t) { |             !function(e, t) { | ||||||
|                 t.config.defaultColor = "rgba(255,255,255,1)", |                 t.config.defaultColor = "", | ||||||
|                 t.pickerFlag = !t.pickerFlag, |                 t.pickerFlag = !t.pickerFlag, | ||||||
|                 t.render(e, t.config), |                 t.render(e, t.config), | ||||||
|                 d(t), |                 d(t), | ||||||
| @ -1070,6 +1090,9 @@ | |||||||
|                 o.colorHsbaToRgba)(e.hsba) : (0, |                 o.colorHsbaToRgba)(e.hsba) : (0, | ||||||
|                 o.colorRgbaToHex)((0, |                 o.colorRgbaToHex)((0, | ||||||
|                 o.colorHsbaToRgba)(e.hsba)); |                 o.colorHsbaToRgba)(e.hsba)); | ||||||
|  |                 e.config.defaultColor = e.pickerInput.value | ||||||
|  |                 e.config.pickerInputChange && e.config.pickerInputChange() | ||||||
|  |                 e.render(e.box.parentNode, e.config), | ||||||
|                 e.config.sure(t, e) |                 e.config.sure(t, e) | ||||||
|             }(r) |             }(r) | ||||||
|         }), |         }), | ||||||
| @ -1097,6 +1120,7 @@ | |||||||
|             }(r, e) |             }(r, e) | ||||||
|         }, !1), |         }, !1), | ||||||
|         this.bindEvent(this.pickerCursor, function(e, t, r, n) { |         this.bindEvent(this.pickerCursor, function(e, t, r, n) { | ||||||
|  |             // console.log(e) | ||||||
|           r=r-7 |           r=r-7 | ||||||
|           n=n-7 |           n=n-7 | ||||||
|             u(e, Math.max(0, Math.min(r - e.pancelLeft, i)), Math.max(0, Math.min(n - e.pancelTop, a)), i, a) |             u(e, Math.max(0, Math.min(r - e.pancelLeft, i)), Math.max(0, Math.min(n - e.pancelTop, a)), i, a) | ||||||
| @ -1119,7 +1143,8 @@ | |||||||
|                 a = i, |                 a = i, | ||||||
|                 o.moveX = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientX : a.clientX, |                 o.moveX = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientX : a.clientX, | ||||||
|                 o.moveY = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientY : a.clientY, |                 o.moveY = n.eventType[0].indexOf("touch") > -1 ? a.changedTouches[0].clientY : a.clientY, | ||||||
|                 r ? t(o, o.moveX, o.moveY) : t(o, e, o.moveX, o.moveY) |                 r ? t(o, o.moveX, o.moveY) : t(o, e, o.moveX, o.moveY); | ||||||
|  |                 // console.log('222222', i, t,e,  o.moveX, o.moveY) | ||||||
|             }; |             }; | ||||||
|             document.addEventListener(n.eventType[1], a, { |             document.addEventListener(n.eventType[1], a, { | ||||||
|                 capture: !1, |                 capture: !1, | ||||||
|  | |||||||
| @ -68,7 +68,6 @@ | |||||||
|   z-index: 999999; |   z-index: 999999; | ||||||
|   background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); |   background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); | ||||||
|   border: 1.5px solid; |   border: 1.5px solid; | ||||||
|   backdrop-filter: blur(2px); |  | ||||||
|   border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; |   border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; | ||||||
|   text-align: left; |   text-align: left; | ||||||
|   font-family: 'sy-boldface'; |   font-family: 'sy-boldface'; | ||||||
| @ -1033,11 +1032,26 @@ | |||||||
|   background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); |   background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); | ||||||
|   border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; |   border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; | ||||||
|   padding: 5px; |   padding: 5px; | ||||||
|  |   position: fixed !important; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog>.content .ew-color-picker input { | ||||||
|  |   font-size: 14px; | ||||||
|  |   line-height: 28px; | ||||||
|  |   height: 28px; | ||||||
|  |   padding: 0 8px; | ||||||
|  |   font-weight: 400; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog>.content .ew-color-picker .input-number-unit input[type=number] { | ||||||
|  |   padding: 0 20px 0 8px; | ||||||
|  |   width: 66px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.ew-color-picker>.ew-color-picker-content { | .YJ-custom-base-dialog.ew-color-picker>.ew-color-picker-content { | ||||||
|   margin-bottom: 10px; |   margin-bottom: 10px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { | .YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { | ||||||
|   width: 302px; |   width: 302px; | ||||||
| } | } | ||||||
| @ -1058,13 +1072,16 @@ | |||||||
| .YJ-custom-base-dialog .ew-color-picker .icon-pen-box { | .YJ-custom-base-dialog .ew-color-picker .icon-pen-box { | ||||||
|   display: inline-block; |   display: inline-block; | ||||||
|   /* cursor: pointer; */ |   /* cursor: pointer; */ | ||||||
|   cursor: no-drop; |  | ||||||
|   width: 24px; |   width: 24px; | ||||||
|   height: 24px; |   height: 24px; | ||||||
|   text-align: center; |   text-align: center; | ||||||
|   line-height: 24px; |   line-height: 24px; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog>.content>div .ew-color-picker .row>.col { | ||||||
|  |   margin: 0 !important; | ||||||
|  | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker .icon-pen-box .icon-pen { | .YJ-custom-base-dialog .ew-color-picker .icon-pen-box .icon-pen { | ||||||
|   margin: 0; |   margin: 0; | ||||||
| } | } | ||||||
| @ -1080,9 +1097,9 @@ | |||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker .color-alpha>input { | .YJ-custom-base-dialog .ew-color-picker .color-alpha>input { | ||||||
|   font-weight: 400; |   font-weight: 400 !important; | ||||||
|   font-family: Arial; |   font-family: Arial !important; | ||||||
|   font-size: 14px; |   font-size: 14px !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container { | .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container { | ||||||
| @ -1095,6 +1112,7 @@ | |||||||
|   margin: 0 0 8px 8px; |   margin: 0 0 8px 8px; | ||||||
|   border: 1px solid #9b979b; |   border: 1px solid #9b979b; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container>.ew-pre-define-color:nth-child(11n+1) { | .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container>.ew-pre-define-color:nth-child(11n+1) { | ||||||
|   width: 22px; |   width: 22px; | ||||||
|   height: 22px; |   height: 22px; | ||||||
| @ -1124,6 +1142,7 @@ | |||||||
|   text-align: center; |   text-align: center; | ||||||
|   background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg=="); |   background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg=="); | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:nth-child(11n+1) { | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:nth-child(11n+1) { | ||||||
|   margin: 0 0 8px 0; |   margin: 0 0 8px 0; | ||||||
| } | } | ||||||
| @ -1132,7 +1151,9 @@ | |||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract { | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract { | ||||||
|   border-color: rgba(var(--color-sdk-base-rgb), 0.2); |   border-color: rgba(var(--color-sdk-base-rgb), 0.2); | ||||||
|   background: unset; |   background: unset; | ||||||
|  |   line-height: 22px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { | ||||||
|   border-color: rgba(var(--color-sdk-base-rgb), 0.4); |   border-color: rgba(var(--color-sdk-base-rgb), 0.4); | ||||||
| @ -1156,10 +1177,12 @@ | |||||||
|   border-radius: 3px; |   border-radius: 3px; | ||||||
|   cursor: pointer; |   cursor: pointer; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color>.yj-pre-define-color-item.subtract-btn { | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color>.yj-pre-define-color-item.subtract-btn { | ||||||
|   position: absolute; |   position: absolute; | ||||||
|   top: 0; |   top: 0; | ||||||
|   left: 0; |   left: 0; | ||||||
|  |   line-height: 20px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:hover { | .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:hover { | ||||||
| @ -1168,11 +1191,15 @@ | |||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup { | .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup { | ||||||
|   display: flex; |   display: flex; | ||||||
|  |   position: unset; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button { | .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button { | ||||||
|   padding: 5px 10px 4px 10px; |   padding: 0 8px; | ||||||
|  |   height: 28px; | ||||||
|  |   line-height: 28px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { | .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { | ||||||
|   margin-right: 8px; |   margin-right: 8px; | ||||||
| } | } | ||||||
| @ -1180,6 +1207,7 @@ | |||||||
| .YJ-custom-base-dialog .ew-color-picker-box { | .YJ-custom-base-dialog .ew-color-picker-box { | ||||||
|   border-width: 4px; |   border-width: 4px; | ||||||
|   border-color: #ffffff; |   border-color: #ffffff; | ||||||
|  |   display: block; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog .ew-color-picker-box>.ew-color-picker-no, | .YJ-custom-base-dialog .ew-color-picker-box>.ew-color-picker-no, | ||||||
| @ -1401,6 +1429,24 @@ | |||||||
|   margin-bottom: 10px; |   margin-bottom: 10px; | ||||||
|   display: flex; |   display: flex; | ||||||
|   position: relative; |   position: relative; | ||||||
|  |   overflow-y: auto; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar { | ||||||
|  |   width: 4px; | ||||||
|  |   height: 4px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-thumb { | ||||||
|  |   border-radius: 5px; | ||||||
|  |   -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||||||
|  |   background-color: rgba(var(--color-sdk-base-rgb)); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-track { | ||||||
|  |   -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||||||
|  |   border-radius: 5px; | ||||||
|  |   background-color: rgba(var(--color-sdk-base-rgb), 0.1); | ||||||
| } | } | ||||||
|  |  | ||||||
| .DIV-cy-tabs .DIV-cy-tab-top::after { | .DIV-cy-tabs .DIV-cy-tab-top::after { | ||||||
| @ -1445,7 +1491,14 @@ | |||||||
|   border-bottom: 2px solid #dddddd00; |   border-bottom: 2px solid #dddddd00; | ||||||
|   position: relative; |   position: relative; | ||||||
|   z-index: 2; |   z-index: 2; | ||||||
|  |   white-space: nowrap; | ||||||
|  |   user-select: none; | ||||||
|   cursor: pointer; |   cursor: pointer; | ||||||
|  |   -webkit-pointer-events: auto; | ||||||
|  |   -moz-pointer-events: auto; | ||||||
|  |   -ms-pointer-events: auto; | ||||||
|  |   -o-pointer-events: auto; | ||||||
|  |   pointer-events: auto; | ||||||
| } | } | ||||||
|  |  | ||||||
| .DIV-cy-tabs .DIV-cy-tab-pane-title-p span { | .DIV-cy-tabs .DIV-cy-tab-pane-title-p span { | ||||||
| @ -1935,6 +1988,7 @@ | |||||||
| .YJ-custom-base-dialog.water-surface>.content>div .row .label { | .YJ-custom-base-dialog.water-surface>.content>div .row .label { | ||||||
|   flex: 0 0 60px; |   flex: 0 0 60px; | ||||||
| } | } | ||||||
|  |  | ||||||
| /* 流光飞线 */ | /* 流光飞线 */ | ||||||
| .YJ-custom-base-dialog.flow-line-surface>.content { | .YJ-custom-base-dialog.flow-line-surface>.content { | ||||||
|   width: 586px; |   width: 586px; | ||||||
| @ -2104,6 +2158,10 @@ | |||||||
|   width: 200px; |   width: 200px; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog.particle-effects>.content .ew-color-picker .row>.col { | ||||||
|  |   width: auto; | ||||||
|  | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.particle-effects>.content [type="range"] { | .YJ-custom-base-dialog.particle-effects>.content [type="range"] { | ||||||
|   margin-top: 10px; |   margin-top: 10px; | ||||||
| } | } | ||||||
| @ -2749,6 +2807,7 @@ | |||||||
| .YJ-custom-base-dialog.polyline>.content { | .YJ-custom-base-dialog.polyline>.content { | ||||||
|   width: 580px; |   width: 580px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div #dashTextureDom { | .YJ-custom-base-dialog.polyline>.content>div #dashTextureDom { | ||||||
|   display: none; |   display: none; | ||||||
| } | } | ||||||
| @ -2800,6 +2859,7 @@ | |||||||
| .YJ-custom-base-dialog.polyline>.content>div .spatial-info-table .table-body { | .YJ-custom-base-dialog.polyline>.content>div .spatial-info-table .table-body { | ||||||
|   max-height: 185px; |   max-height: 185px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { | .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { | ||||||
|   border-radius: unset !important; |   border-radius: unset !important; | ||||||
| } | } | ||||||
| @ -2935,10 +2995,12 @@ | |||||||
|   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; |   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; | ||||||
|   border-radius: 4px 0px 0px 4px !important; |   border-radius: 4px 0px 0px 4px !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { | .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { | ||||||
|   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; |   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; | ||||||
|   border-radius: 4px 0px, 0px, 4px !important; |   border-radius: 4px 0px, 0px, 4px !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { | .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { | ||||||
|   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; |   background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; | ||||||
|   border-radius: 0px 4px 4px 0px !important; |   border-radius: 0px 4px 4px 0px !important; | ||||||
| @ -2947,6 +3009,7 @@ | |||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { | .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { | ||||||
|   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; |   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { | .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { | ||||||
|   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; |   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; | ||||||
| } | } | ||||||
| @ -2979,65 +3042,78 @@ | |||||||
|   height: 13px; |   height: 13px; | ||||||
|   margin-right: 7px; |   margin-right: 7px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line { | ||||||
|   border: 1px solid rgba(var(--color-sdk-base-rgb), 1); |   border: 1px solid rgba(var(--color-sdk-base-rgb), 1); | ||||||
|   height: 0px; |   height: 0px; | ||||||
|   margin-top: 4px; |   margin-top: 4px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line { | ||||||
|   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); |   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); | ||||||
|   height: 0px; |   height: 0px; | ||||||
|   margin-top: 4px; |   margin-top: 4px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line { | ||||||
|   border: 1px solid rgba(var(--color-sdk-base-rgb), 1); |   border: 1px solid rgba(var(--color-sdk-base-rgb), 1); | ||||||
|   height: 0px; |   height: 0px; | ||||||
|   margin-top: 4px; |   margin-top: 4px; | ||||||
|   box-shadow: 0 0 3px #fff |   box-shadow: 0 0 3px #fff | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.tail-line { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.tail-line { | ||||||
|   background: url(../../img/arrow/tail.png) 100% 100% no-repeat; |   background: url(../../img/arrow/tail.png) 100% 100% no-repeat; | ||||||
|   background-size: 100% 100%; |   background-size: 100% 100%; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.mult-tail-line { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.mult-tail-line { | ||||||
|   background: url(../../img/arrow/tail.png) 100% 100% no-repeat; |   background: url(../../img/arrow/tail.png) 100% 100% no-repeat; | ||||||
|   background-size: 100% 100%; |   background-size: 100% 100%; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 { | ||||||
|   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); |   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); | ||||||
|   height: 0px; |   height: 0px; | ||||||
|   margin-top: 4px; |   margin-top: 4px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 { | ||||||
|   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); |   border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); | ||||||
|   height: 0px; |   height: 0px; | ||||||
|   margin-top: 4px; |   margin-top: 4px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line1 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line1 { | ||||||
|   background: url(../../img/arrow/1.png); |   background: url(../../img/arrow/1.png); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   background-position: center; |   background-position: center; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line2 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line2 { | ||||||
|   background: url(../../img/arrow/2.png); |   background: url(../../img/arrow/2.png); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   background-position: center; |   background-position: center; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line3 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line3 { | ||||||
|   background: url(../../img/arrow/3.png); |   background: url(../../img/arrow/3.png); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   background-position: center; |   background-position: center; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line4 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line4 { | ||||||
|   background: url(../../img/arrow/4.png); |   background: url(../../img/arrow/4.png); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   background-position: center; |   background-position: center; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line5 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line5 { | ||||||
|   background: url(../../img/arrow/5.png); |   background: url(../../img/arrow/5.png); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|   background-position: center; |   background-position: center; | ||||||
| } | } | ||||||
|  |  | ||||||
| .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line6 { | .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line6 { | ||||||
|   background: url(../../img/arrow/6.png) 100% 100% no-repeat; |   background: url(../../img/arrow/6.png) 100% 100% no-repeat; | ||||||
|   background-size: 100% 100%; |   background-size: 100% 100%; | ||||||
| @ -3083,7 +3159,7 @@ | |||||||
|  |  | ||||||
| /* 贴地图片 */ | /* 贴地图片 */ | ||||||
| .YJ-custom-base-dialog.ground-image>.content { | .YJ-custom-base-dialog.ground-image>.content { | ||||||
|   width: 500px; |   width: 560px; | ||||||
| } | } | ||||||
|  |  | ||||||
| /* 模型 */ | /* 模型 */ | ||||||
| @ -3505,3 +3581,184 @@ | |||||||
| .YJ-custom-base-dialog.contour>.content .label { | .YJ-custom-base-dialog.contour>.content .label { | ||||||
|   flex: unset; |   flex: unset; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /* 锚点设置 */ | ||||||
|  | .YJ-custom-base-dialog.anchor-point { | ||||||
|  |   user-select: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog.anchor-point>.content { | ||||||
|  |   padding: 14px 40px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog.anchor-point>.content>div { | ||||||
|  |   border: 1px solid #757575; | ||||||
|  |   position: relative; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .YJ-custom-base-dialog.anchor-point>.content>div>.point { | ||||||
|  |   width: 10px; | ||||||
|  |   height: 10px; | ||||||
|  |   position: absolute; | ||||||
|  |   background: #FFDF53; | ||||||
|  |   border-radius: 50%; | ||||||
|  |   border: 1px solid #ff7300; | ||||||
|  |   cursor: pointer; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box { | ||||||
|  |   position: absolute; | ||||||
|  |   z-index: 1; | ||||||
|  |   background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); | ||||||
|  |   border: 1.5px solid; | ||||||
|  |   border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; | ||||||
|  |   color: #fff; | ||||||
|  |   min-width: 200px; | ||||||
|  |   min-height: 120px; | ||||||
|  |   box-sizing: border-box; | ||||||
|  |   /* -webkit-pointer-events: none; | ||||||
|  |   -moz-pointer-events: none; | ||||||
|  |   -ms-pointer-events: none; | ||||||
|  |   -o-pointer-events: none; | ||||||
|  |   pointer-events: none; */ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs { | ||||||
|  |   height: 100%; | ||||||
|  |   display: flex; | ||||||
|  |   flex-direction: column; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title { | ||||||
|  |   padding: 0 2px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:first-child { | ||||||
|  |   padding-left: 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:last-child { | ||||||
|  |   padding-right: 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span { | ||||||
|  |   margin: 0 5px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content { | ||||||
|  |   padding: 0 5px 5px 5px; | ||||||
|  |   box-sizing: border-box; | ||||||
|  |   flex: 1; | ||||||
|  |   overflow: auto; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar { | ||||||
|  |   width: 8px; | ||||||
|  |   height: 8px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-thumb { | ||||||
|  |   border-radius: 5px; | ||||||
|  |   -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||||||
|  |   background-color: rgba(var(--color-sdk-base-rgb)); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-track { | ||||||
|  |   -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||||||
|  |   border-radius: 5px; | ||||||
|  |   background-color: rgba(var(--color-sdk-base-rgb), 0.1); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane { | ||||||
|  |   width: 100%; | ||||||
|  |   height: 100%; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane iframe { | ||||||
|  |   border: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .billboard-attribute-box-line { | ||||||
|  |   position: absolute; | ||||||
|  |   width: 0px; | ||||||
|  |   /* border-left: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); */ | ||||||
|  |   border-left: 1px solid rgba(var(--color-sdk-base-rgb), 1); | ||||||
|  |   /* transform: rotate(45deg); */ | ||||||
|  |   transform-origin: 0px 0px; | ||||||
|  |   -webkit-pointer-events: none; | ||||||
|  |   -moz-pointer-events: none; | ||||||
|  |   -ms-pointer-events: none; | ||||||
|  |   -o-pointer-events: none; | ||||||
|  |   pointer-events: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .drag-nook { | ||||||
|  |   position: absolute; | ||||||
|  |   width: 12px; | ||||||
|  |   height: 12px; | ||||||
|  |   display: block; | ||||||
|  |   user-select: none; | ||||||
|  |   -webkit-pointer-events: auto; | ||||||
|  |   -moz-pointer-events: auto; | ||||||
|  |   -ms-pointer-events: auto; | ||||||
|  |   -o-pointer-events: auto; | ||||||
|  |   pointer-events: auto; | ||||||
|  |   z-index: 3; | ||||||
|  |   clip-path: polygon(0% 100%, 100% 100%, 50% 50%); | ||||||
|  |   background-image: linear-gradient(to top, #ffffff 1px, #00000000 1px); | ||||||
|  |   background-size: 100% 3px; | ||||||
|  |   /* background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAJRJREFUWEftltsJgFAMQ5NNdBJ1Eh3NTdRJdJPIBQXF50/p/WgHSNNDCSGch877EQbyIyCpBtAa/cZEsj9qXwhImgEURgZA8rTzzkAiYGVgITm+ErC6/Ek3vycMAkHAnYCkAUDKAosZSTaeSZiCqIwgCgJBIG8CWyXzKySSZBGBu+afStYBqIxMfJdSo8WPslHJgsAKWjkmIRBy/c8AAAAASUVORK5CYII='); */ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .drag-nook.left-top { | ||||||
|  |   top: -6px; | ||||||
|  |   left: -6px; | ||||||
|  |   cursor: se-resize; | ||||||
|  |   transform: rotate(-45deg); | ||||||
|  |   display: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .drag-nook.right-top { | ||||||
|  |   top: -6px; | ||||||
|  |   right: -6px; | ||||||
|  |   cursor: ne-resize; | ||||||
|  |   transform: rotate(45deg); | ||||||
|  |   display: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .table { | ||||||
|  |   background-color: #ffffff00; | ||||||
|  |   color: #ffffff; | ||||||
|  |   overflow: hidden; | ||||||
|  |   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .table .table-head .tr { | ||||||
|  |   border-top: none; | ||||||
|  |   border-left: none; | ||||||
|  |   border-right: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .table .tr { | ||||||
|  |   display: flex; | ||||||
|  |   border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); | ||||||
|  |   border-right: none; | ||||||
|  | } | ||||||
|  | .billboard-attribute-box .table .tr .th, .billboard-attribute-box .table .tr .td { | ||||||
|  |   border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); | ||||||
|  |   display: flex; | ||||||
|  |   justify-content: center; | ||||||
|  | } | ||||||
|  | .billboard-attribute-box .table .tr .th:last-child, .billboard-attribute-box .table .tr .td:last-child { | ||||||
|  |   border-right: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .table .table-body .tr { | ||||||
|  |   border-bottom: none; | ||||||
|  |   border-left: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .billboard-attribute-box .table .table-body .tr:first-child { | ||||||
|  |   border-top: none; | ||||||
|  | } | ||||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										4
									
								
								static/custom/img/icom-confirm.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								static/custom/img/icom-confirm.svg
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="9.19921875" viewBox="0 0 12 9.19921875" fill="none"> | ||||||
|  | <path d="M4.66806 9.2C4.47815 9.2 4.29548 9.12926 4.15776 9.00078L0.22761 5.35124C-0.0666872 5.0784 -0.0768368 4.62509 0.204411 4.33925C0.485649 4.0534 0.953909 4.04474 1.2482 4.31759L4.60427 7.43442L10.6916 0.260945C10.9511 -0.0436629 11.4165 -0.0884161 11.731 0.162779C12.0457 0.413972 12.0905 0.864388 11.8325 1.17044L5.23924 8.94014C5.10877 9.09461 4.91741 9.18845 4.713 9.2L4.66806 9.2Z"   fill="#FFFFFF" > | ||||||
|  | </path> | ||||||
|  | </svg> | ||||||
| After Width: | Height: | Size: 582 B | 
		Reference in New Issue
	
	Block a user