File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,16 @@ class PlotLayer2D {
260260 fromJSON ( geoJson ) {
261261 if ( geoJson . type === 'FeatureCollection' ) {
262262 const { features } = geoJson ;
263+ let that = this ;
263264 features . forEach ( ( /** @type {any } */ s ) => {
264265 this . addGeoJSONObject ( s ) ;
265266 } ) ;
267+ let layerInterval = setInterval ( function ( ) {
268+ if ( features . length === that . getPlotObjects ( ) . length ) {
269+ that . loaded = true ;
270+ clearInterval ( layerInterval ) ;
271+ }
272+ } , 50 ) ;
266273 } else {
267274 // eslint-disable-next-line no-new
268275 new Error ( 'GeoJSON类型错误,传入值非要素集!' ) ;
Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ class PlotLayer3D extends Observable {
248248 let layerInterval = setInterval ( function ( ) {
249249 if ( features . length === that . _primitiveCollection . _primitives . length ) {
250250 that . loaded = true ;
251+ clearInterval ( layerInterval ) ;
251252 }
252253 } , 50 ) ;
253254 } else {
You can’t perform that action at this time.
0 commit comments