@@ -52,7 +52,7 @@ describe('leaflet_WebMap', () => {
5252 return Promise . resolve ( ) ;
5353 } ) ;
5454 map = webMap ( id , { server : server } ) ;
55- setTimeout ( ( ) => {
55+ map . on ( 'maploaded' , ( ) => {
5656 expect ( map . id ) . toEqual ( 55 ) ;
5757 expect ( map . layers . length ) . toEqual ( 0 ) ;
5858 var mapInfo = map . mapInfo ;
@@ -86,7 +86,7 @@ describe('leaflet_WebMap', () => {
8686 expect ( mapInfo . userName ) . toBe ( "testH" ) ;
8787 expect ( map . options . server ) . toBe ( server ) ;
8888 done ( ) ;
89- } , 0 )
89+ } )
9090 } ) ;
9191
9292 it ( 'initialize_TIANDITU_VEC' , ( done ) => {
@@ -99,7 +99,7 @@ describe('leaflet_WebMap', () => {
9999 return Promise . resolve ( ) ;
100100 } ) ;
101101 map = webMap ( id , { server : server } ) ;
102- setTimeout ( ( ) => {
102+ map . on ( 'maploaded' , ( ) => {
103103 expect ( map . id ) . toBe ( id ) ;
104104 var mapInfo = map . mapInfo ;
105105 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -132,7 +132,7 @@ describe('leaflet_WebMap', () => {
132132 expect ( mapInfo . userName ) . toBe ( "361143" ) ;
133133 expect ( map . options . server ) . toBe ( server ) ;
134134 done ( ) ;
135- } , 0 ) ;
135+ } ) ;
136136 } ) ;
137137
138138 it ( 'initialize_TIANDITU_IMG' , ( done ) => {
@@ -145,7 +145,7 @@ describe('leaflet_WebMap', () => {
145145 return Promise . resolve ( ) ;
146146 } ) ;
147147 map = webMap ( id , { server : server } ) ;
148- setTimeout ( ( ) => {
148+ map . on ( 'maploaded' , ( ) => {
149149 expect ( map . id ) . toBe ( id ) ;
150150 var mapInfo = map . mapInfo ;
151151 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -178,7 +178,7 @@ describe('leaflet_WebMap', () => {
178178 expect ( mapInfo . userName ) . toBe ( "361143" ) ;
179179 expect ( map . options . server ) . toBe ( server ) ;
180180 done ( ) ;
181- } , 0 ) ;
181+ } ) ;
182182 } ) ;
183183
184184 it ( 'initialize_TIANDITU_TER' , ( done ) => {
@@ -191,7 +191,7 @@ describe('leaflet_WebMap', () => {
191191 return Promise . resolve ( ) ;
192192 } ) ;
193193 map = webMap ( id , { server : server } ) ;
194- setTimeout ( ( ) => {
194+ map . on ( 'maploaded' , ( ) => {
195195 expect ( map . id ) . toBe ( id ) ;
196196 var mapInfo = map . mapInfo ;
197197 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -224,7 +224,7 @@ describe('leaflet_WebMap', () => {
224224 expect ( mapInfo . userName ) . toBe ( "361143" ) ;
225225 expect ( map . options . server ) . toBe ( server ) ;
226226 done ( ) ;
227- } , 0 ) ;
227+ } ) ;
228228 } ) ;
229229
230230 it ( 'initialize_BAIDU' , ( done ) => {
@@ -237,7 +237,7 @@ describe('leaflet_WebMap', () => {
237237 return Promise . resolve ( ) ;
238238 } ) ;
239239 map = webMap ( id , { server : server } ) ;
240- setTimeout ( ( ) => {
240+ map . on ( 'maploaded' , ( ) => {
241241 expect ( map . id ) . toBe ( id ) ;
242242 var mapInfo = map . mapInfo ;
243243 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -270,7 +270,7 @@ describe('leaflet_WebMap', () => {
270270 expect ( mapInfo . userName ) . toBe ( "361143" ) ;
271271 expect ( map . options . server ) . toBe ( server ) ;
272272 done ( ) ;
273- } , 0 ) ;
273+ } ) ;
274274 } ) ;
275275
276276 it ( 'initialize_WMS' , ( done ) => {
@@ -283,7 +283,7 @@ describe('leaflet_WebMap', () => {
283283 return Promise . resolve ( ) ;
284284 } ) ;
285285 map = webMap ( id , { server : server } ) ;
286- setTimeout ( ( ) => {
286+ map . on ( 'maploaded' , ( ) => {
287287 expect ( map . id ) . toEqual ( 419 ) ;
288288 expect ( map . layers . length ) . toEqual ( 0 ) ;
289289 var mapInfo = map . mapInfo ;
@@ -317,7 +317,7 @@ describe('leaflet_WebMap', () => {
317317 expect ( mapInfo . userName ) . toBe ( "48372" ) ;
318318 expect ( map . options . server ) . toBe ( "http://supermapiserver" ) ;
319319 done ( ) ;
320- } , 0 )
320+ } )
321321 } ) ;
322322
323323 it ( 'initialize_WMTS' , ( done ) => {
@@ -330,7 +330,7 @@ describe('leaflet_WebMap', () => {
330330 return Promise . resolve ( ) ;
331331 } ) ;
332332 map = webMap ( id , { server : server } ) ;
333- setTimeout ( ( ) => {
333+ map . on ( 'maploaded' , ( ) => {
334334 expect ( map . id ) . toEqual ( 612 ) ;
335335 expect ( map . layers . length ) . toEqual ( 0 ) ;
336336 var mapInfo = map . mapInfo ;
@@ -364,7 +364,7 @@ describe('leaflet_WebMap', () => {
364364 expect ( mapInfo . userName ) . toBe ( "180065" ) ;
365365 expect ( map . options . server ) . toBe ( "http://supermapiserver" ) ;
366366 done ( ) ;
367- } , 0 )
367+ } )
368368 } ) ;
369369
370370 it ( 'initialize_CLOUD' , ( done ) => {
@@ -377,7 +377,7 @@ describe('leaflet_WebMap', () => {
377377 return Promise . resolve ( ) ;
378378 } ) ;
379379 map = webMap ( id , { server : server } ) ;
380- setTimeout ( ( ) => {
380+ map . on ( 'maploaded' , ( ) => {
381381 expect ( map . id ) . toBe ( id ) ;
382382 var mapInfo = map . mapInfo ;
383383 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -410,7 +410,7 @@ describe('leaflet_WebMap', () => {
410410 expect ( mapInfo . userName ) . toBe ( "361143" ) ;
411411 expect ( map . options . server ) . toBe ( server ) ;
412412 done ( ) ;
413- } , 0 )
413+ } )
414414 } ) ;
415415
416416 it ( 'CLOUD add FEATURE_LAYER' , ( done ) => {
@@ -423,7 +423,7 @@ describe('leaflet_WebMap', () => {
423423 return Promise . resolve ( ) ;
424424 } ) ;
425425 map = webMap ( id , { server : server } ) ;
426- setTimeout ( ( ) => {
426+ map . on ( 'maploaded' , ( ) => {
427427 expect ( map . id ) . toBe ( id ) ;
428428 var mapInfo = map . mapInfo ;
429429 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -451,7 +451,7 @@ describe('leaflet_WebMap', () => {
451451 expect ( mapInfo . userName ) . toBe ( "328215" ) ;
452452 expect ( map . options . server ) . toBe ( server ) ;
453453 done ( ) ;
454- } , 0 )
454+ } )
455455 } ) ;
456456
457457 it ( 'SUPERMAP_REST add MARKER_LAYER' , ( done ) => {
@@ -464,7 +464,7 @@ describe('leaflet_WebMap', () => {
464464 return Promise . resolve ( ) ;
465465 } ) ;
466466 map = webMap ( id , { server : server } ) ;
467- setTimeout ( ( ) => {
467+ map . on ( 'maploaded' , ( ) => {
468468 expect ( map . id ) . toBe ( id ) ;
469469 var mapInfo = map . mapInfo ;
470470 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -493,7 +493,7 @@ describe('leaflet_WebMap', () => {
493493 expect ( mapInfo . userName ) . toBe ( "10235" ) ;
494494 expect ( map . options . server ) . toBe ( server ) ;
495495 done ( ) ;
496- } , 0 )
496+ } )
497497 } ) ;
498498
499499 it ( 'createThemeLayer_HeatLayer' , ( done ) => {
@@ -507,7 +507,7 @@ describe('leaflet_WebMap', () => {
507507 return Promise . resolve ( ) ;
508508 } ) ;
509509 map = webMap ( id , { server : server } ) ;
510- setTimeout ( ( ) => {
510+ map . on ( 'maploaded' , ( ) => {
511511 expect ( map . id ) . toBe ( id ) ;
512512 var mapInfo = map . mapInfo ;
513513 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -536,7 +536,7 @@ describe('leaflet_WebMap', () => {
536536 expect ( map . options . server ) . toBe ( server ) ;
537537 map = null ;
538538 done ( ) ;
539- } , 0 )
539+ } )
540540 } ) ;
541541
542542 it ( 'createThemeLayer_UniqueLayer' , ( done ) => {
@@ -549,7 +549,7 @@ describe('leaflet_WebMap', () => {
549549 return Promise . resolve ( ) ;
550550 } ) ;
551551 map = webMap ( id , { server : server } ) ;
552- setTimeout ( ( ) => {
552+ map . on ( 'maploaded' , ( ) => {
553553 expect ( map . id ) . toBe ( id ) ;
554554 var mapInfo = map . mapInfo ;
555555 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -578,7 +578,7 @@ describe('leaflet_WebMap', () => {
578578 expect ( map . options . server ) . toBe ( server ) ;
579579 map = null ;
580580 done ( ) ;
581- } , 0 )
581+ } )
582582 } ) ;
583583
584584 xit ( 'createThemeLayer_RangeLayer' , ( done ) => {
@@ -591,7 +591,7 @@ describe('leaflet_WebMap', () => {
591591 return Promise . resolve ( ) ;
592592 } ) ;
593593 map = webMap ( id , { server : server } ) ;
594- setTimeout ( ( ) => {
594+ map . on ( 'maploaded' , ( ) => {
595595 expect ( map . id ) . toBe ( id ) ;
596596 var mapInfo = map . mapInfo ;
597597 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -619,7 +619,7 @@ describe('leaflet_WebMap', () => {
619619 expect ( map . options . server ) . toBe ( server ) ;
620620 map = null ;
621621 done ( ) ;
622- } , 0 )
622+ } )
623623 } ) ;
624624
625625 it ( 'createThemeLayer_VectorThemeLayer' , ( done ) => {
@@ -633,7 +633,7 @@ describe('leaflet_WebMap', () => {
633633 } ) ;
634634
635635 map = webMap ( id , { server : server } ) ;
636- setTimeout ( ( ) => {
636+ map . on ( 'maploaded' , ( ) => {
637637 expect ( map . id ) . toBe ( id ) ;
638638 var mapInfo = map . mapInfo ;
639639 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -662,7 +662,7 @@ describe('leaflet_WebMap', () => {
662662 expect ( mapInfo . userName ) . toBe ( "48372" ) ;
663663 expect ( map . options . server ) . toBe ( server ) ;
664664 done ( ) ;
665- } , 0 )
665+ } )
666666 } ) ;
667667
668668 it ( 'createThemeLayer_LabelLayer' , ( done ) => {
@@ -675,7 +675,7 @@ describe('leaflet_WebMap', () => {
675675 return Promise . resolve ( ) ;
676676 } ) ;
677677 map = webMap ( id , { server : server } ) ;
678- setTimeout ( ( ) => {
678+ map . on ( 'maploaded' , ( ) => {
679679 expect ( map . id ) . toBe ( id ) ;
680680 var mapInfo = map . mapInfo ;
681681 expect ( mapInfo . authorizeSetting . length ) . toEqual ( 4 ) ;
@@ -703,6 +703,6 @@ describe('leaflet_WebMap', () => {
703703 expect ( mapInfo . userName ) . toBe ( "599184" ) ;
704704 expect ( map . options . server ) . toBe ( server ) ;
705705 done ( ) ;
706- } , 0 )
706+ } )
707707 } ) ;
708- } ) ;
708+ } ) ;
0 commit comments