File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ class PlotLayer2D {
3636 this . _isDrawing = false ;
3737 // 是否为可编辑活跃图层
3838 this . editable = false ;
39+ //是否加载完毕
40+ this . loaded = false ;
3941 }
4042
4143 /**
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ class PlotLayer3D extends Observable {
5858 //二三维联动工具
5959 this . _linkTool = undefined ;
6060
61+ //是否加载完毕
62+ this . loaded = false ;
63+
6164 this . _primitiveCollection . _id = this . _id ;
6265 let scene = this . _getScene ( ) ;
6366 scene . primitives . add ( this . _primitiveCollection ) ;
@@ -238,9 +241,15 @@ class PlotLayer3D extends Observable {
238241 if ( geoJson . type === "FeatureCollection" ) {
239242 this . removeAll ( ) ;
240243 const { features} = geoJson ;
244+ let that = this ;
241245 features . forEach ( ( s ) => {
242246 this . _addGeoJSONObject ( s ) ;
243247 } ) ;
248+ let layerInterval = setInterval ( function ( ) {
249+ if ( features . length === that . _primitiveCollection . _primitives . length ) {
250+ that . loaded = true ;
251+ }
252+ } , 50 ) ;
244253 } else {
245254 // eslint-disable-next-line no-new
246255 new Error ( "GeoJSON类型错误,传入值非要素集!" ) ;
You can’t perform that action at this time.
0 commit comments