Преглед изворни кода

improve the plot #39

tags/2.3.1
Caven Chen пре 4 година
родитељ
комит
e86268ab19
3 измењених фајлова са 10 додато и 9 уклоњено
  1. 2
    1
      modules/event/EventType.js
  2. 5
    5
      modules/tools/DrawTool.js
  3. 3
    3
      modules/tools/EditTool.js

+ 2
- 1
modules/event/EventType.js Прегледај датотеку

@@ -77,11 +77,12 @@ const PathEventType = {

const PlotEventType = {
DRAW_START: 'drawStart',
DRAW_ANCHOR: 'drawAnchor',
DRAW_MOVING: 'drawMoving',
DRAW_STOP: 'drawStop',
EDIT_START: 'editStart',
EDIT_STOP: 'editEnd',
ADD_ANCHOR: 'addAnchor',
CREATE_ANCHOR: 'createAnchor',
ANCHOR_MOVING: 'anchorMoving',
EDIT_ANCHOR_STOP: 'editAnchorStop',
CLEAR_ANCHOR: 'clearAnchor'

+ 5
- 5
modules/tools/DrawTool.js Прегледај датотеку

@@ -45,9 +45,9 @@ class DrawTool {
return false
}
if (!this._floatingAnchor) {
this._floatingAnchor = this._onAddAnchor({ position })
this._floatingAnchor = this._onCreateAnchor({ position })
}
this._plotEvent.fire(PlotEventType.ADD_ANCHOR, position)
this._plotEvent.fire(PlotEventType.DRAW_ANCHOR, position)
}

/**
@@ -85,7 +85,7 @@ class DrawTool {
* @returns {*}
* @private
*/
_onAddAnchor({ position, isCenter = false }) {
_onCreateAnchor({ position, isCenter = false }) {
this._anchorLayer.entities.add({
position: position,
billboard: {
@@ -118,7 +118,7 @@ class DrawTool {
this._viewer.on(MouseEventType.CLICK, this._onClick, this)
this._viewer.on(MouseEventType.MOUSE_MOVE, this._onMouseMove, this)
this._viewer.on(MouseEventType.RIGHT_CLICK, this._onRightClick, this)
this.on(PlotEventType.ADD_ANCHOR, this._onAddAnchor, this)
this.on(PlotEventType.CREATE_ANCHOR, this._onCreateAnchor, this)
this.on(PlotEventType.CLEAR_ANCHOR, this._onClearAnchor, this)
}

@@ -130,7 +130,7 @@ class DrawTool {
this._viewer.off(MouseEventType.CLICK, this._onClick, this)
this._viewer.off(MouseEventType.MOUSE_MOVE, this._onMouseMove, this)
this._viewer.off(MouseEventType.RIGHT_CLICK, this._onRightClick, this)
this.off(PlotEventType.ADD_ANCHOR, this._onAddAnchor, this)
this.off(PlotEventType.CREATE_ANCHOR, this._onCreateAnchor, this)
this.off(PlotEventType.CLEAR_ANCHOR, this._onClearAnchor, this)
}


+ 3
- 3
modules/tools/EditTool.js Прегледај датотеку

@@ -127,7 +127,7 @@ class EditTool {
* @param isMid
* @private
*/
_onAddAnchor({ position, index, isCenter = false, isMid = false }) {
_onCreateAnchor({ position, index, isCenter = false, isMid = false }) {
let image = isMid
? this._options.icon_midAnchor
: isCenter
@@ -172,7 +172,7 @@ class EditTool {
this._viewer.on(MouseEventType.CLICK, this._onClick, this)
this._viewer.on(MouseEventType.MOUSE_MOVE, this._onMouseMove, this)
this._viewer.on(MouseEventType.RIGHT_CLICK, this._onRightClick, this)
this.on(PlotEventType.ADD_ANCHOR, this._onAddAnchor, this)
this.on(PlotEventType.CREATE_ANCHOR, this._onCreateAnchor, this)
this.on(PlotEventType.CLEAR_ANCHOR, this._onClearAnchor, this)
}

@@ -184,7 +184,7 @@ class EditTool {
this._viewer.off(MouseEventType.CLICK, this._onClick, this)
this._viewer.off(MouseEventType.MOUSE_MOVE, this._onMouseMove, this)
this._viewer.off(MouseEventType.RIGHT_CLICK, this._onRightClick, this)
this.off(PlotEventType.ADD_ANCHOR, this._onAddAnchor, this)
this.off(PlotEventType.CREATE_ANCHOR, this._onCreateAnchor, this)
this.off(PlotEventType.CLEAR_ANCHOR, this._onClearAnchor, this)
}


Loading…
Откажи
Сачувај