| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,9 @@ export class FabricLayer { | |||
| 187 | 187 | this._visiable(); | |
| 188 | 188 | } | |
| 189 | 189 | removeEvent() { | |
| 190 | - this.mapContainer.removeChild(this.canvas); | ||
| 190 | + try { | ||
| 191 | + this.mapContainer.removeChild(this.canvas); | ||
| 192 | + }catch (e) {} | ||
| 191 | 193 | } | |
| 192 | 194 | ||
| 193 | 195 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ PlotMapCoordSys.prototype.pointToData = function pointToData(pt) { | |||
| 45 | 45 | PlotMapCoordSys.prototype.getScale = function getScale() { | |
| 46 | 46 | let n=this.m_mapboxMap.getZoom() | |
| 47 | 47 | ||
| 48 | - return 256* Math.pow(2,n+1); | ||
| 48 | + return 1024 * Math.pow(2,n+1); | ||
| 49 | 49 | }; | |
| 50 | 50 | ||
| 51 | 51 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,9 +84,6 @@ export default class DrawPolyline extends DrawObject { | |||
| 84 | 84 | that._isAdded = true; | |
| 85 | 85 | that._plotLayer._isDrawing = true; | |
| 86 | 86 | that._plotLayer._primitiveCollection.add(that._primitive); | |
| 87 | - if(that._addedPlot){ | ||
| 88 | - that._addedPlot(that._primitive); | ||
| 89 | - } | ||
| 90 | 87 | } | |
| 91 | 88 | ||
| 92 | 89 | if(!that._handler){ | |
@@ -122,7 +119,11 @@ export default class DrawPolyline extends DrawObject { | |||
| 122 | 119 | handler.setInputAction((event) => { | |
| 123 | 120 | this.fireFinishEvent({ plotObj3D: this._primitive }); | |
| 124 | 121 | addExtendLayersPlot(this._plotLayer._linkTool, this._primitive); | |
| 122 | + let _primitive = this._primitive | ||
| 125 | 123 | this.disable(); | |
| 124 | + if(this._addedPlot){ | ||
| 125 | + this._addedPlot(_primitive); | ||
| 126 | + } | ||
| 126 | 127 | }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); | |
| 127 | 128 | ||
| 128 | 129 | this._handler = handler; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,6 +118,12 @@ class PlotLayer3D extends Observable { | |||
| 118 | 118 | let plotLayer = this._getPlotLayer(); | |
| 119 | 119 | if (plotLayer) { | |
| 120 | 120 | 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 | + } | ||
| 121 | 127 | return plotLayer.remove(plot); | |
| 122 | 128 | } | |
| 123 | 129 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,8 @@ export default class PlotPathAnimation extends PlotCoordsAnimation { | |||
| 67 | 67 | } | |
| 68 | 68 | ||
| 69 | 69 | if (this._cacheCoords.length === 0) { | |
| 70 | - throw new Error('路径动画控制点数量不能为0'); | ||
| 70 | + console.error('路径动画控制点数量不能为0'); | ||
| 71 | + return; | ||
| 71 | 72 | } | |
| 72 | 73 | ||
| 73 | 74 | if (this._cacheCoords.length === 1) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,8 @@ class LinkTool { | |||
| 48 | 48 | id = _container._container.id; | |
| 49 | 49 | } else { | |
| 50 | 50 | type = "mapbox"; | |
| 51 | - id = _container.mapContainer.parentElement.id; | ||
| 51 | + id = _container.mapContainer.parentElement && _container.mapContainer.parentElement.id | ||
| 52 | + || _container._containerId; | ||
| 52 | 53 | } | |
| 53 | 54 | if (this._mapContainer._container.id !== id) { | |
| 54 | 55 | switch (type) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments