Compare commits
10 Commits
master
...
24a0078eea
Author | SHA1 | Date | |
---|---|---|---|
24a0078eea | |||
6c84baa3c2 | |||
22e4652528 | |||
1a394336ff | |||
1d6b635f7a | |||
5b788a74d4 | |||
65ee6b70ba | |||
ed18fd776b | |||
dd7af5aa4d | |||
56ad8ae7a0 |
@ -135,6 +135,7 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
tools.message({text: '操作成功'})
|
||||
})
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
|
578
src/Global/MultiViewportMode/ClickCallback/index.js
Normal file
578
src/Global/MultiViewportMode/ClickCallback/index.js
Normal file
@ -0,0 +1,578 @@
|
||||
/**
|
||||
* @name: click
|
||||
* @author: Administrator
|
||||
* @date: 2023-05-28 11:05
|
||||
* @description:click
|
||||
* @update: 2023-05-28 11:05
|
||||
*/
|
||||
let leftClickHandler = null
|
||||
let rightClickHandler = null
|
||||
let MoveHandler = null
|
||||
let leftClickCallbackMap = new Map()
|
||||
let rightClickCallbackMap = new Map()
|
||||
let MoveCallbackMap = new Map()
|
||||
let selectedFeature;
|
||||
|
||||
|
||||
function cartesian3Towgs84(cartesian, viewer) {
|
||||
var ellipsoid = viewer.scene.globe.ellipsoid
|
||||
var cartesian3 = new Cesium.Cartesian3(
|
||||
cartesian.x,
|
||||
cartesian.y,
|
||||
cartesian.z
|
||||
)
|
||||
var cartographic = ellipsoid.cartesianToCartographic(cartesian3)
|
||||
var lat = Cesium.Math.toDegrees(cartographic.latitude)
|
||||
var lng = Cesium.Math.toDegrees(cartographic.longitude)
|
||||
var alt = cartographic.height < 0 ? 0 : cartographic.height
|
||||
return {
|
||||
lng: lng,
|
||||
lat: lat,
|
||||
alt: alt,
|
||||
}
|
||||
}
|
||||
|
||||
function getcartesian(sdk, movement) {
|
||||
if (movement.endPosition) {
|
||||
movement.endPosition.y -= 2
|
||||
}
|
||||
let position = movement.position || movement.endPosition
|
||||
// 获取世界坐标系地表坐标,考虑地形,不包括模型,倾斜摄影模型表面;
|
||||
let cartesian = sdk.viewer.scene.pickPosition(position)
|
||||
if (!cartesian) {
|
||||
const ray = sdk.viewer.camera.getPickRay(position); //相交的射线
|
||||
cartesian = sdk.viewer.scene.globe.pick(ray, sdk.viewer.scene);
|
||||
}
|
||||
return cartesian
|
||||
}
|
||||
|
||||
function openLeftClick(sdk, cb) {
|
||||
if (!sdk || !sdk.viewer) {
|
||||
return
|
||||
}
|
||||
let click = true
|
||||
leftClickHandler = new Cesium.ScreenSpaceEventHandler(sdk.viewer.canvas)
|
||||
leftClickHandler.setInputAction((movement) => {
|
||||
let cartesian = sdk.viewer.scene.pickPosition(movement.position)
|
||||
if (!cartesian) {
|
||||
const ray = sdk.viewer.camera.getPickRay(movement.position); //相交的射线
|
||||
cartesian = sdk.viewer.scene.globe.pick(ray, sdk.viewer.scene);
|
||||
}
|
||||
if (!cartesian) {
|
||||
return
|
||||
}
|
||||
|
||||
let pos84 = cartesian3Towgs84(cartesian, sdk.viewer)
|
||||
|
||||
cb && cb(pos84)
|
||||
|
||||
if (click) {
|
||||
click = false
|
||||
setTimeout(() => {
|
||||
click = true
|
||||
}, 600);
|
||||
if (!YJ.Measure.GetMeasureStatus() && cartesian) {
|
||||
let flag = false
|
||||
for (let i = leftClickCallbackMap.size - 1; i >= 0; i--) {
|
||||
let key = Array.from(leftClickCallbackMap.keys())[i]
|
||||
let obj = leftClickCallbackMap.get(key)
|
||||
if (obj) {
|
||||
|
||||
if (obj.that) {
|
||||
// 是否为多边形
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < obj.that.options.positions.length; i++) {
|
||||
polyPos.push([
|
||||
obj.that.options.positions[i].lng,
|
||||
obj.that.options.positions[i].lat
|
||||
])
|
||||
}
|
||||
polyPos.push([
|
||||
obj.that.options.positions[0].lng,
|
||||
obj.that.options.positions[0].lat
|
||||
])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 聚集地
|
||||
else if (obj.that.type === 'AssembleObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let positions = obj.that.computeAssemble(obj.that.options.positions, true)
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < positions.length; i += 2) {
|
||||
polyPos.push([
|
||||
positions[i],
|
||||
positions[i + 1]
|
||||
])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 单箭头
|
||||
else if (obj.that.type === 'AttackArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computeAttackArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 双箭头
|
||||
else if (obj.that.type === 'PincerArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 5) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computePincerArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let pos84_0 = cartesian3Towgs84(positions[0], sdk.viewer)
|
||||
polyPos.push([pos84_0.lng, pos84_0.lat])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 圆
|
||||
else if (obj.that.type === 'CircleObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius) {
|
||||
let center = [obj.that.options.center.lng, obj.that.options.center.lat];
|
||||
let radius = obj.that.options.radius / 1000;
|
||||
let options = { steps: 360, units: 'kilometers' };
|
||||
let circle = turf.circle(center, radius, options);
|
||||
let contain = turf.booleanPointInPolygon(pt, circle);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 扇形
|
||||
else if (obj.that.type === 'SectorObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius && obj.that.options.startAngle && obj.that.options.endAngle) {
|
||||
let positions = obj.that.calSector(obj.that.options.center, obj.that.options.radius, obj.that.options.startAngle, obj.that.options.endAngle, undefined, true)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
polyPos.push([positions[m].lng, positions[m].lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (click) {
|
||||
// click = false
|
||||
// setTimeout(() => {
|
||||
// click = true
|
||||
// }, 300);
|
||||
// if (!YJ.Measure.GetMeasureStatus()) {
|
||||
|
||||
// }
|
||||
// }
|
||||
}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
|
||||
|
||||
// leftClickHandler.setInputAction(function (movement) {
|
||||
// const feature = sdk.viewer.scene.pick(movement.endPosition);
|
||||
// // unselectFeature(selectedFeature);
|
||||
// if (selectedFeature) {
|
||||
// selectedFeature.color = Cesium.Color.WHITE;
|
||||
// }
|
||||
// selectedFeature = feature
|
||||
// if (feature) {
|
||||
// feature.color = Cesium.Color.YELLOW;
|
||||
// }
|
||||
// }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
function closeLeftClick(sdk) {
|
||||
leftClickHandler.destroy() //关闭事件句柄
|
||||
leftClickHandler = null
|
||||
// }
|
||||
}
|
||||
|
||||
function openRightClick(sdk) {
|
||||
if (!sdk || !sdk.viewer) {
|
||||
return
|
||||
}
|
||||
rightClickHandler = new Cesium.ScreenSpaceEventHandler(sdk.viewer.canvas)
|
||||
rightClickHandler.setInputAction((movement) => {
|
||||
if (!YJ.Measure.GetMeasureStatus()) {
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick && pick.id) {
|
||||
let id
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = rightClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (typeof pick.id === 'string') {
|
||||
id = pick.id
|
||||
}
|
||||
else {
|
||||
id = pick.id.id
|
||||
}
|
||||
if (rightClickCallbackMap.has(id)) {
|
||||
let obj = rightClickCallbackMap.get(id)
|
||||
if (obj.that.picking) {
|
||||
let cartesian = getcartesian(sdk, movement)
|
||||
if (!cartesian) {
|
||||
return
|
||||
}
|
||||
obj.callback(
|
||||
movement,
|
||||
id,
|
||||
cartesian3Towgs84(cartesian, sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick && pick.content) {
|
||||
if (rightClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = rightClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
let cartesian = getcartesian(sdk, movement)
|
||||
if (!cartesian) {
|
||||
return
|
||||
}
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.getProperty('id'),
|
||||
cartesian3Towgs84(cartesian, sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
let cartesian = getcartesian(sdk, movement)
|
||||
if (!cartesian) {
|
||||
return
|
||||
}
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(cartesian, sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
|
||||
}
|
||||
|
||||
function closeRightClick() {
|
||||
if (rightClickHandler) {
|
||||
rightClickHandler.destroy() //关闭事件句柄
|
||||
rightClickHandler = null
|
||||
}
|
||||
}
|
||||
|
||||
function openMove(sdk) {
|
||||
MoveHandler = new Cesium.ScreenSpaceEventHandler(sdk.viewer.canvas)
|
||||
MoveHandler.setInputAction(function (movement) {
|
||||
const pick = sdk.viewer.scene.pick(movement.endPosition);
|
||||
// unselectFeature(selectedFeature);
|
||||
// if (selectedFeature) {
|
||||
// let color = '#fff'
|
||||
// let state = selectedFeature.getProperty('state')
|
||||
// switch (state) {
|
||||
// case '0':
|
||||
// color = '#fff'
|
||||
// break;
|
||||
// case '1':
|
||||
// color = '#f00'
|
||||
// break;
|
||||
// case '2':
|
||||
// color = '#0f0'
|
||||
// break;
|
||||
// case '3':
|
||||
// color = '#00f'
|
||||
// break;
|
||||
// default:
|
||||
// }
|
||||
// selectedFeature.color = Cesium.Color.fromCssColorString(color).withAlpha(selectedFeature.tileset.transparency)
|
||||
// }
|
||||
// if (pick && pick.id) { }
|
||||
// if (pick && pick.content) {
|
||||
// if (MoveCallbackMap.has(pick.content.tileset.id)) {
|
||||
// let obj = MoveCallbackMap.get(pick.content.tileset.id)
|
||||
// if (obj.that.picking) {
|
||||
// if (obj.that.type === 'bim') {
|
||||
// if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
// selectedFeature = pick
|
||||
// pick.color = Cesium.Color.YELLOW;
|
||||
// }
|
||||
// else {
|
||||
// selectedFeature = null
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// selectedFeature = pick
|
||||
// pick.color = Cesium.Color.YELLOW;
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// selectedFeature = null
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
||||
}
|
||||
|
||||
function closeMove() {
|
||||
if (MoveHandler) {
|
||||
MoveHandler.destroy() //关闭事件句柄
|
||||
MoveHandler = null
|
||||
}
|
||||
}
|
||||
|
||||
/*注册左键回调*/
|
||||
function regLeftClickCallback(id, callback, that) {
|
||||
|
||||
leftClickCallbackMap.set(id, { callback, that })
|
||||
}/*取消左键回调*/
|
||||
function unRegLeftClickCallback(id,) {
|
||||
leftClickCallbackMap.delete(id,)
|
||||
}
|
||||
|
||||
/*注册右键回调*/
|
||||
function regRightClickCallback(id, callback, that) {
|
||||
rightClickCallbackMap.set(id, { callback, that })
|
||||
}/*取消右键回调*/
|
||||
function unRegRightClickCallback(id,) {
|
||||
rightClickCallbackMap.delete(id,)
|
||||
}
|
||||
|
||||
/*注册左键回调*/
|
||||
function regMoveCallback(id, callback, that) {
|
||||
MoveCallbackMap.set(id, { callback, that })
|
||||
}/*取消左键回调*/
|
||||
function unregMoveCallback(id,) {
|
||||
MoveCallbackMap.delete(id,)
|
||||
}
|
||||
|
||||
function getLeftClickState() {
|
||||
if (leftClickHandler) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
function getRightClickState() {
|
||||
if (rightClickHandler) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
function getMoveState() {
|
||||
if (MoveHandler) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export { openLeftClick, closeLeftClick, regLeftClickCallback, unRegLeftClickCallback, openRightClick, closeRightClick, regRightClickCallback, unRegRightClickCallback, openMove, closeMove, regMoveCallback, unregMoveCallback, getLeftClickState, getRightClickState, getMoveState }
|
@ -7,6 +7,9 @@ import { CesiumContainer } from '../global'
|
||||
import { off as offSplitScreen } from "../SplitScreen";
|
||||
import { FlwStatusSwitch, JwwStatusSwitch, getFlwStatus, getJwwStatus } from "../global"
|
||||
import { SheetIndexStatusSwitch, getStatus } from '../SheetIndex'
|
||||
import { getLeftClickState, getRightClickState, getMoveState } from "../../Global/ClickCallback"
|
||||
import { openLeftClick, openRightClick, openMove } from "./ClickCallback"
|
||||
|
||||
|
||||
let sdk2D
|
||||
let sdk3D
|
||||
@ -32,6 +35,16 @@ async function init(sdk) {
|
||||
})
|
||||
sdk2.viewer.scene.mode = Cesium.SceneMode.SCENE2D
|
||||
sdk2D = await sdk2
|
||||
if(getLeftClickState()) {
|
||||
openLeftClick(sdk2D)
|
||||
}
|
||||
if(getRightClickState()) {
|
||||
openRightClick(sdk2D)
|
||||
}
|
||||
if(getMoveState()) {
|
||||
openMove(sdk2D)
|
||||
}
|
||||
|
||||
// window.sdk2D = sdk2D
|
||||
solveBug()
|
||||
syncObject = { sdks: [sdk, sdk2], tools }
|
||||
|
@ -100,14 +100,14 @@ function MouseRightMenu(sdk, status, callBack) {
|
||||
that = sdk.entityMap.get(entityId)
|
||||
}
|
||||
|
||||
if (that && that.picking) {
|
||||
addedMenu = `
|
||||
<span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
|
||||
<ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
|
||||
<li style="padding: 3px 10px;cursor: pointer;">属性</li>
|
||||
</ul>
|
||||
`
|
||||
}
|
||||
// if (that && that.picking) {
|
||||
// addedMenu = `
|
||||
// <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>
|
||||
// <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
|
||||
// <li style="padding: 3px 10px;cursor: pointer;">属性</li>
|
||||
// </ul>
|
||||
// `
|
||||
// }
|
||||
let position = tools.cartesian3Towgs84(cartesian, sdk.viewer)
|
||||
menuElm = document.createElement('div')
|
||||
menuElm.id = 'custom-menu'
|
||||
@ -121,9 +121,6 @@ function MouseRightMenu(sdk, status, callBack) {
|
||||
<ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">
|
||||
<li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li>
|
||||
</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}
|
||||
`
|
||||
_element.appendChild(menuElm)
|
||||
|
@ -187,7 +187,7 @@ import DrawTakeOff from '../Obj/AirLine/DrawTakeOff'
|
||||
import FlowLine from '../Obj/Base/FlowLine'
|
||||
import Sunshine from '../Global/efflect/Sunshine'
|
||||
// import Road2 from '../Obj/Base/RoadObject'
|
||||
import TextBox from '../Obj/Base/TextBox'
|
||||
// import TextBox from '../Obj/Base/TextBox'
|
||||
import BatchModel from '../Obj/Base/BatchModel'
|
||||
|
||||
const YJEarthismeasuring = Symbol('测量状态')
|
||||
@ -262,7 +262,7 @@ if (!window.YJ) {
|
||||
Dialog,
|
||||
FlowLine,
|
||||
// Road2,
|
||||
TextBox,
|
||||
// TextBox,
|
||||
BatchModel
|
||||
},
|
||||
YJEarth,
|
||||
|
@ -319,7 +319,7 @@ class AssembleObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -324,7 +324,7 @@ class AttackArrowObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show &&!this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -637,7 +637,7 @@ class Model extends BaseModel {
|
||||
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label && (this.label.show = v)
|
||||
}
|
||||
else {
|
||||
|
@ -550,7 +550,7 @@ class Model2 extends BaseModel {
|
||||
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -433,31 +433,31 @@ class BillboardObject extends Base {
|
||||
value: '链接',
|
||||
key: 'link'
|
||||
},
|
||||
{
|
||||
name: 'IP摄像头',
|
||||
value: 'IP摄像头',
|
||||
key: 'camera'
|
||||
},
|
||||
// {
|
||||
// name: 'ISC摄像头',
|
||||
// value: 'ISC摄像头',
|
||||
// key: 'isc'
|
||||
// name: 'IP摄像头',
|
||||
// value: 'IP摄像头',
|
||||
// key: 'camera'
|
||||
// },
|
||||
// // {
|
||||
// // name: 'ISC摄像头',
|
||||
// // value: 'ISC摄像头',
|
||||
// // key: 'isc'
|
||||
// // },
|
||||
// // {
|
||||
// // name: '传感器',
|
||||
// // value: '传感器',
|
||||
// // key: 'sensor'
|
||||
// // },
|
||||
// {
|
||||
// name: '全景图',
|
||||
// value: '全景图',
|
||||
// key: 'vr'
|
||||
// },
|
||||
// {
|
||||
// name: '传感器',
|
||||
// value: '传感器',
|
||||
// key: 'sensor'
|
||||
// },
|
||||
{
|
||||
name: '全景图',
|
||||
value: '全景图',
|
||||
key: 'vr'
|
||||
},
|
||||
{
|
||||
name: '物资',
|
||||
value: '物资',
|
||||
key: 'goods'
|
||||
}
|
||||
// name: '物资',
|
||||
// value: '物资',
|
||||
// key: 'goods'
|
||||
// }
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ class CircleDiffuse extends Base {
|
||||
}
|
||||
that.sdk._entityZIndex++
|
||||
if (that.sdk.viewer._element.className === 'cesium-viewer 2d') {
|
||||
that.entity.ellipse.height = 1000000
|
||||
that.entity.ellipse.height = 1
|
||||
}
|
||||
CircleDiffuse.createLabel(that)
|
||||
syncData(that.sdk, that.options.id)
|
||||
|
@ -333,7 +333,7 @@ class CircleObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show && (!this.showView || this.showView == 3)) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -666,7 +666,7 @@ class CurvelineObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
setTimeout(() => {
|
||||
this.label.position = [
|
||||
@ -1384,10 +1384,10 @@ class CurvelineObject extends Base {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
// let array = []
|
||||
|
@ -347,7 +347,7 @@ class EllipseObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -162,6 +162,7 @@ class FlyRoam extends Base {
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
this.message({text: '操作成功'})
|
||||
})
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
|
@ -17,6 +17,18 @@ function html(that) {
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col" mode="0">
|
||||
<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>
|
||||
<span class="custom-divider" mode="0"></span>
|
||||
<div class="div-item" mode="0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">旋转角度</span>
|
||||
@ -50,11 +62,11 @@ function html(that) {
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="div-item" mode="0">
|
||||
<div class="row">
|
||||
<div class="col" style="flex: 5;">
|
||||
<span class="label">文字内容</span>
|
||||
<input class="input" type="text" @model="textValue" maxlength="30">
|
||||
<input class="input" type="text" @model="textValue">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn" @click="textPosPick">设置位置</span>
|
||||
@ -70,9 +82,9 @@ function html(that) {
|
||||
<div class="textColor"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">字体大小</span>
|
||||
<span class="label">文字大小</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="1" max="99" @model="textFontSize">
|
||||
<input class="input" type="number" title="" min="1" max="99" step="1" @model="textFontSize">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
@ -101,6 +113,98 @@ function html(that) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item" mode="1">
|
||||
<div class="row">
|
||||
<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">
|
||||
<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>文字设置</h4>
|
||||
<div class="row">
|
||||
<div class="col" style="flex: 0 0 80px;margin: 0 10px 0 0;;">
|
||||
<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 160px;">
|
||||
<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 label-font-size" type="number" title="" min="1" max="99" step="1" 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 class="row" style="justify-content: flex-start;">
|
||||
<div class="col font-select-box" style="margin: 0 0px;flex: 0 0 70px;">
|
||||
<span class="label" style="flex: none;">文字偏移</span>
|
||||
</div>
|
||||
<div class="col" style="margin: 0 10px;flex: 0 0 100px;">
|
||||
<span class="label">x</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input label-offset-x" type="number" title="" min="-999" max="999" step="1">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" style="margin: 0 10px;flex: 0 0 100px;">
|
||||
<span class="label">y</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input label-offset-y" type="number" title="" min="-999" max="999" step="1">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item attribute-info">
|
||||
<div class="row">
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -334,7 +334,7 @@ class PincerArrowObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -355,7 +355,7 @@ class PolygonObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
} else {
|
||||
this.label.show = false
|
||||
|
@ -517,7 +517,7 @@ class PolyhedronObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -701,7 +701,7 @@ class PolylineObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
setTimeout(() => {
|
||||
this.label.position = [
|
||||
@ -893,6 +893,7 @@ class PolylineObject extends Base {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
get labelBackgroundColorEnd() {
|
||||
return this.options.label.backgroundColor[1]
|
||||
}
|
||||
@ -1410,10 +1411,10 @@ class PolylineObject extends Base {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
|
@ -138,7 +138,7 @@ class RadarScan extends Base {
|
||||
})
|
||||
that.sdk._entityZIndex++
|
||||
if (that.sdk.viewer._element.className === 'cesium-viewer 2d') {
|
||||
that.entity.ellipse.height = 1000000
|
||||
that.entity.ellipse.height = 1
|
||||
}
|
||||
RadarScan.createLabel(that)
|
||||
syncData(that.sdk, that.options.id)
|
||||
|
@ -424,7 +424,7 @@ class RadarScanStereoscopic extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -344,7 +344,7 @@ class SectorObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -321,7 +321,7 @@ class StraightArrowObject extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -649,7 +649,7 @@ class GroundText extends Base {
|
||||
ctx.font = 200 + 'px serif'
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0)'
|
||||
ctx.fillRect(0, 0, maxWidth + 30, 210)
|
||||
ctx.fillStyle = this.options.color
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)'
|
||||
ctx.font = '200px serif'
|
||||
ctx.fillText(textArray[i], 0, 210 * (i + 1))
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ class StandText extends Base {
|
||||
ctx.font = 200 + "px serif";
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0)'
|
||||
ctx.fillRect(0, 0, maxWidth + 30, 210)
|
||||
ctx.fillStyle = this.options.color;
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)';
|
||||
ctx.font = "200px serif";
|
||||
ctx.fillText(textArray[i], 0, 210 * (i+1));
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ class WallRealStereoscopic extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -195,7 +195,7 @@ class WallStereoscopic extends Base {
|
||||
}
|
||||
set labelShow(v) {
|
||||
this.options.label.show = v
|
||||
if (this.show) {
|
||||
if (this.show && !this.showView || this.showView == 3) {
|
||||
this.label.show = v
|
||||
}
|
||||
else {
|
||||
|
@ -9,6 +9,7 @@ import Tools from "../../Tools";
|
||||
import { getHost, getToken } from "../../on";
|
||||
import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback";
|
||||
import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback";
|
||||
import { regLeftClickCallback as regLeftClickCallback3, regRightClickCallback as regRightClickCallback3, regMoveCallback as regMoveCallback3 } from "../../Global/MultiViewportMode/ClickCallback";
|
||||
import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen";
|
||||
import { syncData, getSdk as get2DSdk } from '../../Global/MultiViewportMode'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../Global/global'
|
||||
@ -68,7 +69,7 @@ class Base extends Tools {
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if (!sdk2D) {
|
||||
this.#_showView = v
|
||||
if(this.entity) {
|
||||
if (this.entity) {
|
||||
this.entity._showView = v
|
||||
}
|
||||
return
|
||||
@ -361,12 +362,17 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regLeftClickCallback2(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (sdk2D && this.sdk === sdk2D) {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regLeftClickCallback3(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
} else {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regLeftClickCallback(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
@ -384,12 +390,17 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.rightClickCallBack == null && this.entity && this.entity.id) {
|
||||
regRightClickCallback2(this.entity.id, this.rightClickCB, this)
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (sdk2D && this.sdk === sdk2D) {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regRightClickCallback3(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
} else {
|
||||
if (this.rightClickCallBack == null && this.entity && this.entity.id) {
|
||||
regRightClickCallback(this.entity.id, this.rightClickCB, this)
|
||||
}
|
||||
@ -407,12 +418,17 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.mouseMoveCallBack == null && this.entity && this.entity.id) {
|
||||
regMoveCallback2(this.entity.id, this.mouseMoveCB, this)
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (sdk2D && this.sdk === sdk2D) {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regMoveCallback3(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
} else {
|
||||
if (this.mouseMoveCallBack == null && this.entity && this.entity.id) {
|
||||
regMoveCallback(this.entity.id, this.mouseMoveCB, this)
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ class Dialog extends BaseDialog {
|
||||
this.footAppChild(div)
|
||||
if (this.options.updateHeightCallBack) {
|
||||
let heightBtn = document.createElement('button');
|
||||
heightBtn.className = 'update-height'
|
||||
heightBtn.innerHTML = '<svg class="icon-updateheigh"><use xlink:href="#yj-icon-updateheight"></use></svg>更新高程'
|
||||
heightBtn.style.width = 'auto'
|
||||
heightBtn.addEventListener('click', () => {
|
||||
|
@ -50,7 +50,8 @@ export default class CircleDiffuseMaterialProperty {
|
||||
let color = this.colors[ratio[i]]
|
||||
_sourceColor = _sourceColor + `
|
||||
if(dis < float(${Number(ratio[i]) / 2})) {
|
||||
material.diffuse = 1.5 * vec4(${color.red},${color.green},${color.blue},${color.alpha}).rgb;
|
||||
material.diffuse = vec4(0.0,0.0,0.0,0.0).rgb;
|
||||
material.emission = 1.0 * vec4(${color.red},${color.green},${color.blue},${color.alpha}).rgb;
|
||||
}
|
||||
`
|
||||
}
|
||||
|
@ -238,8 +238,8 @@ function StreamWall2() {
|
||||
else {
|
||||
material.alpha = 1.0;
|
||||
}
|
||||
material.diffuse = color.rgb*0.0;
|
||||
material.emission = color.rgb * 1.0;
|
||||
material.diffuse = colorImage.rgb * color.rgb*0.0;
|
||||
material.emission = colorImage.rgb * color.rgb * 1.0;
|
||||
return material;
|
||||
}`,
|
||||
components: {
|
||||
|
@ -1493,6 +1493,23 @@ class Tools {
|
||||
}
|
||||
}
|
||||
|
||||
message(option={}) {
|
||||
let type = option.type || 'success'
|
||||
let text = option.text || ''
|
||||
let duration = option.duration || 1500
|
||||
|
||||
let message = document.getElementById('YJ-custom-message');
|
||||
if (message) {
|
||||
document.body.removeChild(message)
|
||||
}
|
||||
message = document.createElement('div')
|
||||
message.id = 'YJ-custom-message'
|
||||
message.innerHTML = `
|
||||
<i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755929961282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5064" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0" fill="#52C41A" p-id="5065"></path></svg></i>${text}
|
||||
`
|
||||
document.body.appendChild(message)
|
||||
message.classList.add(type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -62,9 +62,9 @@ class YJEarth {
|
||||
|
||||
removeIncetance(id) {
|
||||
this.entityMap.delete(id)
|
||||
unRegLeftClickCallback(id)
|
||||
unRegRightClickCallback(id)
|
||||
unregMoveCallback(id)
|
||||
unRegLeftClickCallback(this,id)
|
||||
unRegRightClickCallback(this,id)
|
||||
unregMoveCallback(this,id)
|
||||
|
||||
syncSplitData(this, id)
|
||||
}
|
||||
|
@ -2718,7 +2718,7 @@
|
||||
|
||||
/* 贴地svg */
|
||||
.YJ-custom-base-dialog.ground-svg>.content {
|
||||
width: 535px;
|
||||
width: 560px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog.ground-svg>.content>div .div-item:nth-of-type(2) .row .col .label {
|
||||
@ -3095,7 +3095,7 @@
|
||||
}
|
||||
|
||||
/* 文本框 */
|
||||
.popup-textarea{
|
||||
.popup-textarea {
|
||||
/* width: 212px; */
|
||||
width: 161.6px;
|
||||
/* height: 154px; */
|
||||
@ -3108,26 +3108,28 @@
|
||||
background-size: 100% 100%;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
.popup-textarea textarea{
|
||||
background-color: unset!important;
|
||||
border: unset!important;
|
||||
|
||||
.popup-textarea textarea {
|
||||
background-color: unset !important;
|
||||
border: unset !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.popup-textarea textarea::-webkit-scrollbar {
|
||||
width: 8px!important;
|
||||
width: 8px !important;
|
||||
/* height: 8px!important; */
|
||||
}
|
||||
|
||||
.popup-textarea textarea::-webkit-scrollbar-thumb {
|
||||
border-radius: 5px!important;
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important;
|
||||
background-color: rgba(var(--color-sdk-base-rgb))!important;
|
||||
border-radius: 5px !important;
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
|
||||
background-color: rgba(var(--color-sdk-base-rgb)) !important;
|
||||
}
|
||||
|
||||
.popup-textarea textarea::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important;
|
||||
border-radius: 5px!important;
|
||||
background-color: rgba(var(--color-sdk-base-rgb), 0.1)!important;
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
|
||||
border-radius: 5px !important;
|
||||
background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important;
|
||||
}
|
||||
|
||||
/* 贴地图片 */
|
||||
@ -3587,21 +3589,26 @@
|
||||
border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.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{
|
||||
|
||||
.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
@ -3610,3 +3617,56 @@
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* 自定义提示 */
|
||||
#YJ-custom-message {
|
||||
/* 固定在顶部中央 */
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0%);
|
||||
/* 初始位置在屏幕顶部外 */
|
||||
|
||||
/* 样式美化 */
|
||||
display: flex;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
padding: 15px 20px;
|
||||
width: 380px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
z-index: 9999999;
|
||||
|
||||
|
||||
/* 动画定义 */
|
||||
animation: YJ-custom-message-slideDown 0.5s forwards,
|
||||
YJ-custom-message-fadeOut 0.5s 1500ms forwards;
|
||||
}
|
||||
|
||||
#YJ-custom-message i {
|
||||
margin: 2px 10px 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
#YJ-custom-message.success {
|
||||
background-color: #f0f9eb;
|
||||
color: rgb(82, 196, 26);
|
||||
}
|
||||
|
||||
/* 滑入动画 */
|
||||
@keyframes YJ-custom-message-slideDown {
|
||||
to {
|
||||
top: 20px;
|
||||
/* 移动到屏幕顶部 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 淡出动画 - 1500ms后执行 */
|
||||
@keyframes YJ-custom-message-fadeOut {
|
||||
to {
|
||||
opacity: 0;
|
||||
top: -200px
|
||||
/* 移回顶部外 */
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user