File tree Expand file tree Collapse file tree 6 files changed +18
-7
lines changed
Animation/AnimationTypes/PlotExtendAnimation/PlotGrowAnimation Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,9 @@ export class FabricLayer {
187187 this . _visiable ( ) ;
188188 }
189189 removeEvent ( ) {
190- this . mapContainer . removeChild ( this . canvas ) ;
190+ try {
191+ this . mapContainer . removeChild ( this . canvas ) ;
192+ } catch ( e ) { }
191193 }
192194
193195 /**
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ PlotMapCoordSys.prototype.pointToData = function pointToData(pt) {
4545PlotMapCoordSys . prototype . getScale = function getScale ( ) {
4646 let n = this . m_mapboxMap . getZoom ( )
4747
48- return 256 * Math . pow ( 2 , n + 1 ) ;
48+ return 1024 * Math . pow ( 2 , n + 1 ) ;
4949} ;
5050
5151/**
Original file line number Diff line number Diff line change @@ -84,9 +84,6 @@ export default class DrawPolyline extends DrawObject {
8484 that . _isAdded = true ;
8585 that . _plotLayer . _isDrawing = true ;
8686 that . _plotLayer . _primitiveCollection . add ( that . _primitive ) ;
87- if ( that . _addedPlot ) {
88- that . _addedPlot ( that . _primitive ) ;
89- }
9087 }
9188
9289 if ( ! that . _handler ) {
@@ -122,7 +119,11 @@ export default class DrawPolyline extends DrawObject {
122119 handler . setInputAction ( ( event ) => {
123120 this . fireFinishEvent ( { plotObj3D : this . _primitive } ) ;
124121 addExtendLayersPlot ( this . _plotLayer . _linkTool , this . _primitive ) ;
122+ let _primitive = this . _primitive
125123 this . disable ( ) ;
124+ if ( this . _addedPlot ) {
125+ this . _addedPlot ( _primitive ) ;
126+ }
126127 } , Cesium . ScreenSpaceEventType . LEFT_DOUBLE_CLICK ) ;
127128
128129 this . _handler = handler ;
Original file line number Diff line number Diff line change @@ -118,6 +118,12 @@ class PlotLayer3D extends Observable {
118118 let plotLayer = this . _getPlotLayer ( ) ;
119119 if ( plotLayer ) {
120120 removeExtendLayersPlot ( this . _linkTool , plot ) ;
121+ if ( plot . _positionBillboards ) {
122+ this . _viewer . scene . primitives . remove ( plot . _positionBillboards ) ;
123+ }
124+ if ( plot . _shapeBillboards ) {
125+ this . _viewer . scene . primitives . remove ( plot . _shapeBillboards ) ;
126+ }
121127 return plotLayer . remove ( plot ) ;
122128 }
123129 }
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ export default class PlotPathAnimation extends PlotCoordsAnimation {
6767 }
6868
6969 if ( this . _cacheCoords . length === 0 ) {
70- throw new Error ( '路径动画控制点数量不能为0' ) ;
70+ console . error ( '路径动画控制点数量不能为0' ) ;
71+ return ;
7172 }
7273
7374 if ( this . _cacheCoords . length === 1 ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ class LinkTool {
4848 id = _container . _container . id ;
4949 } else {
5050 type = "mapbox" ;
51- id = _container . mapContainer . parentElement . id ;
51+ id = _container . mapContainer . parentElement && _container . mapContainer . parentElement . id
52+ || _container . _containerId ;
5253 }
5354 if ( this . _mapContainer . _container . id !== id ) {
5455 switch ( type ) {
You can’t perform that action at this time.
0 commit comments