Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
@ -120,7 +120,6 @@ class DrawPolyline extends Draw {
|
|||||||
}
|
}
|
||||||
cache_positions.push(cartesian)
|
cache_positions.push(cartesian)
|
||||||
this.points_ids.push(this.create_point(cartesian, this.viewer))
|
this.points_ids.push(this.create_point(cartesian, this.viewer))
|
||||||
|
|
||||||
if (cache_positions.length >= this.options.number) {
|
if (cache_positions.length >= this.options.number) {
|
||||||
let positions = []
|
let positions = []
|
||||||
cache_positions.forEach((item) => {
|
cache_positions.forEach((item) => {
|
||||||
@ -138,7 +137,8 @@ class DrawPolyline extends Draw {
|
|||||||
this.end()
|
this.end()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cb(cache_positions.length)
|
// cb(cache_positions.length)
|
||||||
|
cb(null, cache_positions)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.event.mouse_right((movement, cartesian) => {
|
this.event.mouse_right((movement, cartesian) => {
|
||||||
|
|||||||
@ -129,8 +129,28 @@ function reset() {
|
|||||||
supplementaryContourShow = false
|
supplementaryContourShow = false
|
||||||
supplementaryContourWidth = 1.0
|
supplementaryContourWidth = 1.0
|
||||||
supplementaryContourColor = '#d084d1'
|
supplementaryContourColor = '#d084d1'
|
||||||
|
}
|
||||||
|
function setVal(data) {
|
||||||
|
secondaryLinesCount = data['secondaryLinesCount']
|
||||||
|
// show = true
|
||||||
|
equalHeightDistance = data['equalHeightDistance']
|
||||||
|
activeColor = rgbaFromObject(data['activeColor'])
|
||||||
|
indexContourShow = data['indexContourShow']
|
||||||
|
indexContourWidth = data['indexContourWidth']
|
||||||
|
indexContourColor = rgbaFromObject(data['indexContourColor'])
|
||||||
|
intermediateContourShow = data['intermediateContourShow']
|
||||||
|
intermediateContourWidth = data['intermediateContourWidth']
|
||||||
|
intermediateContourColor = rgbaFromObject(data['intermediateContourColor'])
|
||||||
|
halfIntervalContourShow = data['halfIntervalContourShow']
|
||||||
|
halfIntervalContourWidth = data['halfIntervalContourWidth']
|
||||||
|
halfIntervalContourColor = rgbaFromObject(data['halfIntervalContourColor'])
|
||||||
|
supplementaryContourShow = data['supplementaryContourShow']
|
||||||
|
supplementaryContourWidth = data['supplementaryContourWidth']
|
||||||
|
supplementaryContourColor = rgbaFromObject(data['supplementaryContourColor'])
|
||||||
|
}
|
||||||
|
function rgbaFromObject(colorObj) {
|
||||||
|
const { red, green, blue, alpha = 1 } = colorObj;
|
||||||
|
return `rgba(${red * 255}, ${green * 255}, ${blue * 255}, ${alpha})`;
|
||||||
}
|
}
|
||||||
async function dialog(sdk) {
|
async function dialog(sdk) {
|
||||||
_sdk = sdk
|
_sdk = sdk
|
||||||
@ -716,4 +736,4 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export { dialog, startDraw, reset }
|
export { dialog, startDraw, reset, setVal }
|
||||||
|
|||||||
@ -203,6 +203,8 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
trList[i].querySelector("input[name='time']").value = time
|
trList[i].querySelector("input[name='time']").value = time
|
||||||
}
|
}
|
||||||
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
||||||
|
|
||||||
|
totalTimeElm.value = 0//点击应用后默认时间清零
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
totalTimeElm.addEventListener('blur', () => {
|
totalTimeElm.addEventListener('blur', () => {
|
||||||
|
|||||||
@ -181,13 +181,13 @@ const MouseCoordinate = (sdk, status) => {
|
|||||||
// contentElm.innerHTML = `<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${degrees.lng.toFixed(6)}°</p><p style='margin: 0;'>维度:${degrees.lat.toFixed(6)}°</p><p style='margin: 0;'>海拔:${degrees.alt.toFixed(2)} m</p></div>`
|
// contentElm.innerHTML = `<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${degrees.lng.toFixed(6)}°</p><p style='margin: 0;'>维度:${degrees.lat.toFixed(6)}°</p><p style='margin: 0;'>海拔:${degrees.alt.toFixed(2)} m</p></div>`
|
||||||
switch (positionType || '度') {
|
switch (positionType || '度') {
|
||||||
case '度':
|
case '度':
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${degrees.lng.toFixed(8)}°</p><p style='margin: 0;'>维度:${degrees.lat.toFixed(8)}°</p><p style='margin: 0;'>海拔:${degrees.alt.toFixed(2)} m</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 160px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${degrees.lng.toFixed(8)}°</p><p style='margin: 0;'>维度:${degrees.lat.toFixed(8)}°</p><p style='margin: 0;'>海拔:${Number(degrees.alt.toFixed(2))} m</p></div>`
|
||||||
break;
|
break;
|
||||||
case '度分':
|
case '度分':
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${proj.degreesToDMS(degrees.lng, true)}</p><p style='margin: 0;'>维度:${proj.degreesToDMS(degrees.lat, true)}</p><p style='margin: 0;'>海拔:${degrees.alt.toFixed(2)} m</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${proj.degreesToDMS(degrees.lng, true)}</p><p style='margin: 0;'>维度:${proj.degreesToDMS(degrees.lat, true)}</p><p style='margin: 0;'>海拔:${Number(degrees.alt.toFixed(2))} m</p></div>`
|
||||||
break;
|
break;
|
||||||
case '度分秒':
|
case '度分秒':
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${proj.degreesToDMS(degrees.lng, false)}</p><p style='margin: 0;'>维度:${proj.degreesToDMS(degrees.lat, false)}</p><p style='margin: 0;'>海拔:${degrees.alt.toFixed(2)} m</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:${proj.degreesToDMS(degrees.lng, false)}</p><p style='margin: 0;'>维度:${proj.degreesToDMS(degrees.lat, false)}</p><p style='margin: 0;'>海拔:${Number(degrees.alt.toFixed(2))} m</p></div>`
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -197,13 +197,13 @@ const MouseCoordinate = (sdk, status) => {
|
|||||||
// let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', coordinateSystem)
|
// let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', coordinateSystem)
|
||||||
let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', posiToCoordinate(coordinateSystem, degrees))
|
let result = tools.convert([{ x: degrees.lng, y: degrees.lat, z: degrees.alt }], 'EPSG:4326', posiToCoordinate(coordinateSystem, degrees))
|
||||||
position = result.points[0]
|
position = result.points[0]
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>x:${position.x.toFixed(2)}</p><p style='margin: 0;'>y:${position.y.toFixed(2)}</p><p style='margin: 0;'>z:${position.z.toFixed(2)}</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>x:${position.x.toFixed(2)}</p><p style='margin: 0;'>y:${position.y.toFixed(2)}</p><p style='margin: 0;'>z:${Number(position.z.toFixed(2))}</p></div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let coordinateSystem = getCoordinateSystem()
|
let coordinateSystem = getCoordinateSystem()
|
||||||
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
|
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 160px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>`
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>x:-</p><p style='margin: 0;'>y:-</p><p style='margin: 0;'>z:-</p></div>`
|
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>x:-</p><p style='margin: 0;'>y:-</p><p style='margin: 0;'>z:-</p></div>`
|
||||||
|
|||||||
@ -118,7 +118,6 @@ function open(sdk) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gridPrimitives) {
|
if (!gridPrimitives) {
|
||||||
gridPrimitives = new Cesium.PrimitiveCollection();
|
gridPrimitives = new Cesium.PrimitiveCollection();
|
||||||
gridPrimitives.name = 'SheetIndexGridPrimitives';
|
gridPrimitives.name = 'SheetIndexGridPrimitives';
|
||||||
@ -128,7 +127,6 @@ function open(sdk) {
|
|||||||
labelCollection = new Cesium.LabelCollection();
|
labelCollection = new Cesium.LabelCollection();
|
||||||
labelCollection.name = 'SheetIndexLabelCollection';
|
labelCollection.name = 'SheetIndexLabelCollection';
|
||||||
}
|
}
|
||||||
|
|
||||||
let stationaryFrames = 0;
|
let stationaryFrames = 0;
|
||||||
let maxRectangle = null;
|
let maxRectangle = null;
|
||||||
gridPrimitives.postRenderEvent = () => {
|
gridPrimitives.postRenderEvent = () => {
|
||||||
|
|||||||
@ -872,7 +872,7 @@ function getDMS() {
|
|||||||
return positionType
|
return positionType
|
||||||
}
|
}
|
||||||
function setDMS(sdk, type) {
|
function setDMS(sdk, type) {
|
||||||
if (coordinateSystem !== 'EPSG:4326') {
|
if (coordinateSystem !== 'EPSG:4326' && coordinateSystem !== 'EPSG:4490') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
positionType = type
|
positionType = type
|
||||||
|
|||||||
@ -72,7 +72,7 @@ import {
|
|||||||
} from '../Global/MultiViewportMode'
|
} from '../Global/MultiViewportMode'
|
||||||
import { MouseCoordinate } from '../Global/MouseCoordinate'
|
import { MouseCoordinate } from '../Global/MouseCoordinate'
|
||||||
import { MouseRightMenu } from '../Global/mouseRightMenu'
|
import { MouseRightMenu } from '../Global/mouseRightMenu'
|
||||||
import { dialog as ContourDialog, startDraw as ContourStartDraw, reset as ContourReset } from '../Global/Contour'
|
import { dialog as ContourDialog, startDraw as ContourStartDraw, reset as ContourReset, setVal as ContourSetVal } from '../Global/Contour'
|
||||||
import { on as SplitScreenOn, off as SplitScreenOff, setActiveId as SplitScreenSetActiveId, getSdk, syncSplitData } from '../Global/SplitScreen'
|
import { on as SplitScreenOn, off as SplitScreenOff, setActiveId as SplitScreenSetActiveId, getSdk, syncSplitData } from '../Global/SplitScreen'
|
||||||
import LocateCurrent from '../Obj/Base/LocateCurrent'
|
import LocateCurrent from '../Obj/Base/LocateCurrent'
|
||||||
|
|
||||||
@ -355,7 +355,8 @@ if (!window.YJ) {
|
|||||||
},
|
},
|
||||||
Contour: ContourDialog,
|
Contour: ContourDialog,
|
||||||
ContourStartDraw,
|
ContourStartDraw,
|
||||||
ContourReset
|
ContourReset,
|
||||||
|
ContourSetVal
|
||||||
}, //测量
|
}, //测量
|
||||||
Measure: {
|
Measure: {
|
||||||
GetMeasureStatus: () => {
|
GetMeasureStatus: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user