This commit is contained in:
2025-12-16 18:01:17 +08:00
parent 50b4501b7a
commit 1e0edcea59
3 changed files with 17 additions and 18 deletions

View File

@ -104,7 +104,7 @@ class DrawPolyline extends Draw {
let cache_positions = [] let cache_positions = []
let car = undefined let car = undefined
this.event.mouse_left((movement, cartesian) => { this.event.mouse_left((movement, cartesian) => {
if(into === '2D') { if (into === '2D') {
return return
} }
into = '3D' into = '3D'
@ -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,11 +137,12 @@ 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) => {
if(into === '2D') { if (into === '2D') {
return return
} }
let positions = [] let positions = []
@ -161,7 +161,7 @@ class DrawPolyline extends Draw {
this.end() this.end()
}) })
this.event.mouse_move((movement, cartesian) => { this.event.mouse_move((movement, cartesian) => {
if(into === '2D') { if (into === '2D') {
return return
} }
this.positions = cache_positions.concat(cartesian) this.positions = cache_positions.concat(cartesian)
@ -172,7 +172,7 @@ class DrawPolyline extends Draw {
) )
}) })
this.event.mouse_right_keyboard_ctrl((movement, cartesian) => { this.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
if(into === '2D') { if (into === '2D') {
return return
} }
if (this.points_ids.length > 1) { if (this.points_ids.length > 1) {
@ -183,7 +183,7 @@ class DrawPolyline extends Draw {
}) })
this.event.gesture_pinck_start_keyboard_ctrl(() => { this.event.gesture_pinck_start_keyboard_ctrl(() => {
if(into === '2D') { if (into === '2D') {
return return
} }
if (this.points_ids.length > 1) { if (this.points_ids.length > 1) {
@ -195,7 +195,7 @@ class DrawPolyline extends Draw {
}) })
this.event.gesture_pinck_start((movement, cartesian) => { this.event.gesture_pinck_start((movement, cartesian) => {
if(into === '2D') { if (into === '2D') {
return return
} }
let startTime = new Date() let startTime = new Date()
@ -239,7 +239,7 @@ class DrawPolyline extends Draw {
if (!this._is2D && this._sdk2D) { if (!this._is2D && this._sdk2D) {
this.event2D = new MouseEvent(this._sdk2D) this.event2D = new MouseEvent(this._sdk2D)
this.event2D.mouse_left((movement, cartesian) => { this.event2D.mouse_left((movement, cartesian) => {
if(into === '3D') { if (into === '3D') {
return return
} }
into = '2D' into = '2D'
@ -257,7 +257,7 @@ class DrawPolyline extends Draw {
this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer)) this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer))
}) })
this.event2D.mouse_right((movement, cartesian) => { this.event2D.mouse_right((movement, cartesian) => {
if(into === '3D') { if (into === '3D') {
return return
} }
let positions = [] let positions = []
@ -276,7 +276,7 @@ class DrawPolyline extends Draw {
this.end() this.end()
}) })
this.event2D.mouse_move((movement, cartesian) => { this.event2D.mouse_move((movement, cartesian) => {
if(into === '3D') { if (into === '3D') {
return return
} }
this.positions = cache_positions.concat(cartesian) this.positions = cache_positions.concat(cartesian)
@ -287,7 +287,7 @@ class DrawPolyline extends Draw {
) )
}) })
this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => { this.event2D.mouse_right_keyboard_ctrl((movement, cartesian) => {
if(into === '3D') { if (into === '3D') {
return return
} }
if (this.points_ids.length > 1) { if (this.points_ids.length > 1) {
@ -298,7 +298,7 @@ class DrawPolyline extends Draw {
}) })
this.event2D.gesture_pinck_start_keyboard_ctrl(() => { this.event2D.gesture_pinck_start_keyboard_ctrl(() => {
if(into === '3D') { if (into === '3D') {
return return
} }
if (this.points_ids.length > 1) { if (this.points_ids.length > 1) {
@ -309,7 +309,7 @@ class DrawPolyline extends Draw {
}) })
this.event2D.gesture_pinck_start((movement, cartesian) => { this.event2D.gesture_pinck_start((movement, cartesian) => {
if(into === '3D') { if (into === '3D') {
return return
} }
let startTime = new Date() let startTime = new Date()

View File

@ -9,7 +9,7 @@ let state = false
let scale = '1:100万' let scale = '1:100万'
function SheetIndexStatusSwitch(sdk, s = false) { function SheetIndexStatusSwitch(sdk, s = false) {
if(!sdk) { if (!sdk) {
return return
} }
if (!tools) { if (!tools) {
@ -32,7 +32,7 @@ function SheetIndexStatusSwitch(sdk, s = false) {
} }
let sdkD = getSdk().sdkD let sdkD = getSdk().sdkD
if(sdkD && sdk !== sdkD) { if (sdkD && sdk !== sdkD) {
SheetIndexStatusSwitch(sdkD, s) SheetIndexStatusSwitch(sdkD, s)
} }
@ -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 = () => {

View File

@ -72,6 +72,7 @@ class BatchModel extends Base {
break; break;
} }
Draw && Draw.start((a, positions) => { Draw && Draw.start((a, positions) => {
console.log(positions, 'positions')
this.options.positions = positions; this.options.positions = positions;
//判断范围是否过大 //判断范围是否过大
if (options.type == '面') { if (options.type == '面') {