@@ -52,7 +52,7 @@ describe('leaflet_WebMap', () => {
52
52
return Promise . resolve ( ) ;
53
53
} ) ;
54
54
map = webMap ( id , { server : server } ) ;
55
- setTimeout ( ( ) => {
55
+ map . on ( 'maploaded' , ( ) => {
56
56
expect ( map . id ) . toEqual ( 55 ) ;
57
57
expect ( map . layers . length ) . toEqual ( 0 ) ;
58
58
var mapInfo = map . mapInfo ;
@@ -86,7 +86,7 @@ describe('leaflet_WebMap', () => {
86
86
expect ( mapInfo . userName ) . toBe ( "testH" ) ;
87
87
expect ( map . options . server ) . toBe ( server ) ;
88
88
done ( ) ;
89
- } , 0 )
89
+ } )
90
90
} ) ;
91
91
92
92
it ( 'initialize_TIANDITU_VEC' , ( done ) => {
@@ -99,7 +99,7 @@ describe('leaflet_WebMap', () => {
99
99
return Promise . resolve ( ) ;
100
100
} ) ;
101
101
map = webMap ( id , { server : server } ) ;
102
- setTimeout ( ( ) => {
102
+ map . on ( 'maploaded' , ( ) => {
103
103
expect ( map . id ) . toBe ( id ) ;
104
104
var mapInfo = map . mapInfo ;
105
105
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -132,7 +132,7 @@ describe('leaflet_WebMap', () => {
132
132
expect ( mapInfo . userName ) . toBe ( "361143" ) ;
133
133
expect ( map . options . server ) . toBe ( server ) ;
134
134
done ( ) ;
135
- } , 0 ) ;
135
+ } ) ;
136
136
} ) ;
137
137
138
138
it ( 'initialize_TIANDITU_IMG' , ( done ) => {
@@ -145,7 +145,7 @@ describe('leaflet_WebMap', () => {
145
145
return Promise . resolve ( ) ;
146
146
} ) ;
147
147
map = webMap ( id , { server : server } ) ;
148
- setTimeout ( ( ) => {
148
+ map . on ( 'maploaded' , ( ) => {
149
149
expect ( map . id ) . toBe ( id ) ;
150
150
var mapInfo = map . mapInfo ;
151
151
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -178,7 +178,7 @@ describe('leaflet_WebMap', () => {
178
178
expect ( mapInfo . userName ) . toBe ( "361143" ) ;
179
179
expect ( map . options . server ) . toBe ( server ) ;
180
180
done ( ) ;
181
- } , 0 ) ;
181
+ } ) ;
182
182
} ) ;
183
183
184
184
it ( 'initialize_TIANDITU_TER' , ( done ) => {
@@ -191,7 +191,7 @@ describe('leaflet_WebMap', () => {
191
191
return Promise . resolve ( ) ;
192
192
} ) ;
193
193
map = webMap ( id , { server : server } ) ;
194
- setTimeout ( ( ) => {
194
+ map . on ( 'maploaded' , ( ) => {
195
195
expect ( map . id ) . toBe ( id ) ;
196
196
var mapInfo = map . mapInfo ;
197
197
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -224,7 +224,7 @@ describe('leaflet_WebMap', () => {
224
224
expect ( mapInfo . userName ) . toBe ( "361143" ) ;
225
225
expect ( map . options . server ) . toBe ( server ) ;
226
226
done ( ) ;
227
- } , 0 ) ;
227
+ } ) ;
228
228
} ) ;
229
229
230
230
it ( 'initialize_BAIDU' , ( done ) => {
@@ -237,7 +237,7 @@ describe('leaflet_WebMap', () => {
237
237
return Promise . resolve ( ) ;
238
238
} ) ;
239
239
map = webMap ( id , { server : server } ) ;
240
- setTimeout ( ( ) => {
240
+ map . on ( 'maploaded' , ( ) => {
241
241
expect ( map . id ) . toBe ( id ) ;
242
242
var mapInfo = map . mapInfo ;
243
243
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -270,7 +270,7 @@ describe('leaflet_WebMap', () => {
270
270
expect ( mapInfo . userName ) . toBe ( "361143" ) ;
271
271
expect ( map . options . server ) . toBe ( server ) ;
272
272
done ( ) ;
273
- } , 0 ) ;
273
+ } ) ;
274
274
} ) ;
275
275
276
276
it ( 'initialize_WMS' , ( done ) => {
@@ -283,7 +283,7 @@ describe('leaflet_WebMap', () => {
283
283
return Promise . resolve ( ) ;
284
284
} ) ;
285
285
map = webMap ( id , { server : server } ) ;
286
- setTimeout ( ( ) => {
286
+ map . on ( 'maploaded' , ( ) => {
287
287
expect ( map . id ) . toEqual ( 419 ) ;
288
288
expect ( map . layers . length ) . toEqual ( 0 ) ;
289
289
var mapInfo = map . mapInfo ;
@@ -317,7 +317,7 @@ describe('leaflet_WebMap', () => {
317
317
expect ( mapInfo . userName ) . toBe ( "48372" ) ;
318
318
expect ( map . options . server ) . toBe ( "http://supermapiserver" ) ;
319
319
done ( ) ;
320
- } , 0 )
320
+ } )
321
321
} ) ;
322
322
323
323
it ( 'initialize_WMTS' , ( done ) => {
@@ -330,7 +330,7 @@ describe('leaflet_WebMap', () => {
330
330
return Promise . resolve ( ) ;
331
331
} ) ;
332
332
map = webMap ( id , { server : server } ) ;
333
- setTimeout ( ( ) => {
333
+ map . on ( 'maploaded' , ( ) => {
334
334
expect ( map . id ) . toEqual ( 612 ) ;
335
335
expect ( map . layers . length ) . toEqual ( 0 ) ;
336
336
var mapInfo = map . mapInfo ;
@@ -364,7 +364,7 @@ describe('leaflet_WebMap', () => {
364
364
expect ( mapInfo . userName ) . toBe ( "180065" ) ;
365
365
expect ( map . options . server ) . toBe ( "http://supermapiserver" ) ;
366
366
done ( ) ;
367
- } , 0 )
367
+ } )
368
368
} ) ;
369
369
370
370
it ( 'initialize_CLOUD' , ( done ) => {
@@ -377,7 +377,7 @@ describe('leaflet_WebMap', () => {
377
377
return Promise . resolve ( ) ;
378
378
} ) ;
379
379
map = webMap ( id , { server : server } ) ;
380
- setTimeout ( ( ) => {
380
+ map . on ( 'maploaded' , ( ) => {
381
381
expect ( map . id ) . toBe ( id ) ;
382
382
var mapInfo = map . mapInfo ;
383
383
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -410,7 +410,7 @@ describe('leaflet_WebMap', () => {
410
410
expect ( mapInfo . userName ) . toBe ( "361143" ) ;
411
411
expect ( map . options . server ) . toBe ( server ) ;
412
412
done ( ) ;
413
- } , 0 )
413
+ } )
414
414
} ) ;
415
415
416
416
it ( 'CLOUD add FEATURE_LAYER' , ( done ) => {
@@ -423,7 +423,7 @@ describe('leaflet_WebMap', () => {
423
423
return Promise . resolve ( ) ;
424
424
} ) ;
425
425
map = webMap ( id , { server : server } ) ;
426
- setTimeout ( ( ) => {
426
+ map . on ( 'maploaded' , ( ) => {
427
427
expect ( map . id ) . toBe ( id ) ;
428
428
var mapInfo = map . mapInfo ;
429
429
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -451,7 +451,7 @@ describe('leaflet_WebMap', () => {
451
451
expect ( mapInfo . userName ) . toBe ( "328215" ) ;
452
452
expect ( map . options . server ) . toBe ( server ) ;
453
453
done ( ) ;
454
- } , 0 )
454
+ } )
455
455
} ) ;
456
456
457
457
it ( 'SUPERMAP_REST add MARKER_LAYER' , ( done ) => {
@@ -464,7 +464,7 @@ describe('leaflet_WebMap', () => {
464
464
return Promise . resolve ( ) ;
465
465
} ) ;
466
466
map = webMap ( id , { server : server } ) ;
467
- setTimeout ( ( ) => {
467
+ map . on ( 'maploaded' , ( ) => {
468
468
expect ( map . id ) . toBe ( id ) ;
469
469
var mapInfo = map . mapInfo ;
470
470
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -493,7 +493,7 @@ describe('leaflet_WebMap', () => {
493
493
expect ( mapInfo . userName ) . toBe ( "10235" ) ;
494
494
expect ( map . options . server ) . toBe ( server ) ;
495
495
done ( ) ;
496
- } , 0 )
496
+ } )
497
497
} ) ;
498
498
499
499
it ( 'createThemeLayer_HeatLayer' , ( done ) => {
@@ -507,7 +507,7 @@ describe('leaflet_WebMap', () => {
507
507
return Promise . resolve ( ) ;
508
508
} ) ;
509
509
map = webMap ( id , { server : server } ) ;
510
- setTimeout ( ( ) => {
510
+ map . on ( 'maploaded' , ( ) => {
511
511
expect ( map . id ) . toBe ( id ) ;
512
512
var mapInfo = map . mapInfo ;
513
513
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -536,7 +536,7 @@ describe('leaflet_WebMap', () => {
536
536
expect ( map . options . server ) . toBe ( server ) ;
537
537
map = null ;
538
538
done ( ) ;
539
- } , 0 )
539
+ } )
540
540
} ) ;
541
541
542
542
it ( 'createThemeLayer_UniqueLayer' , ( done ) => {
@@ -549,7 +549,7 @@ describe('leaflet_WebMap', () => {
549
549
return Promise . resolve ( ) ;
550
550
} ) ;
551
551
map = webMap ( id , { server : server } ) ;
552
- setTimeout ( ( ) => {
552
+ map . on ( 'maploaded' , ( ) => {
553
553
expect ( map . id ) . toBe ( id ) ;
554
554
var mapInfo = map . mapInfo ;
555
555
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -578,7 +578,7 @@ describe('leaflet_WebMap', () => {
578
578
expect ( map . options . server ) . toBe ( server ) ;
579
579
map = null ;
580
580
done ( ) ;
581
- } , 0 )
581
+ } )
582
582
} ) ;
583
583
584
584
xit ( 'createThemeLayer_RangeLayer' , ( done ) => {
@@ -591,7 +591,7 @@ describe('leaflet_WebMap', () => {
591
591
return Promise . resolve ( ) ;
592
592
} ) ;
593
593
map = webMap ( id , { server : server } ) ;
594
- setTimeout ( ( ) => {
594
+ map . on ( 'maploaded' , ( ) => {
595
595
expect ( map . id ) . toBe ( id ) ;
596
596
var mapInfo = map . mapInfo ;
597
597
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -619,7 +619,7 @@ describe('leaflet_WebMap', () => {
619
619
expect ( map . options . server ) . toBe ( server ) ;
620
620
map = null ;
621
621
done ( ) ;
622
- } , 0 )
622
+ } )
623
623
} ) ;
624
624
625
625
it ( 'createThemeLayer_VectorThemeLayer' , ( done ) => {
@@ -633,7 +633,7 @@ describe('leaflet_WebMap', () => {
633
633
} ) ;
634
634
635
635
map = webMap ( id , { server : server } ) ;
636
- setTimeout ( ( ) => {
636
+ map . on ( 'maploaded' , ( ) => {
637
637
expect ( map . id ) . toBe ( id ) ;
638
638
var mapInfo = map . mapInfo ;
639
639
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 2 ) ;
@@ -662,7 +662,7 @@ describe('leaflet_WebMap', () => {
662
662
expect ( mapInfo . userName ) . toBe ( "48372" ) ;
663
663
expect ( map . options . server ) . toBe ( server ) ;
664
664
done ( ) ;
665
- } , 0 )
665
+ } )
666
666
} ) ;
667
667
668
668
it ( 'createThemeLayer_LabelLayer' , ( done ) => {
@@ -675,7 +675,7 @@ describe('leaflet_WebMap', () => {
675
675
return Promise . resolve ( ) ;
676
676
} ) ;
677
677
map = webMap ( id , { server : server } ) ;
678
- setTimeout ( ( ) => {
678
+ map . on ( 'maploaded' , ( ) => {
679
679
expect ( map . id ) . toBe ( id ) ;
680
680
var mapInfo = map . mapInfo ;
681
681
expect ( mapInfo . authorizeSetting . length ) . toEqual ( 4 ) ;
@@ -703,6 +703,6 @@ describe('leaflet_WebMap', () => {
703
703
expect ( mapInfo . userName ) . toBe ( "599184" ) ;
704
704
expect ( map . options . server ) . toBe ( server ) ;
705
705
done ( ) ;
706
- } , 0 )
706
+ } )
707
707
} ) ;
708
- } ) ;
708
+ } ) ;
0 commit comments