Skip to content

Commit f70b042

Browse files
author
zhaokai
committed
Merge branch 'dev' of github.com:MapGIS/WebClient-JavaScript into dev
2 parents 483a906 + 182780d commit f70b042

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

src/mapboxgl/overlay/FabricLayer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
/**

src/mapboxgl/overlay/fabric/PlotMapCoordSys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ PlotMapCoordSys.prototype.pointToData = function pointToData(pt) {
4545
PlotMapCoordSys.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
/**

src/service/3DPlot/Draw/DrawPolyline.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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;

src/service/3DPlot/PlotLayer3D.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

src/service/PlotBase/Animation/AnimationTypes/PlotExtendAnimation/PlotGrowAnimation/PlotPathAnimation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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) {

src/service/PlotBase/LinkTool.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)