1+ require ( '../../../src/mapboxgl/overlay/MapvLayer' ) ;
12var mapboxgl = require ( 'mapbox-gl' ) ;
23var mapv = require ( 'mapv' ) ;
34window . mapv = mapv ;
45window . mapboxgl = mapboxgl ;
5- require ( '../../../src/mapboxgl/overlay/MapvLayer' ) ;
66
77var url = GlobeParameter . ChinaURL + '/zxyTileImage.png?z={z}&x={x}&y={y}' ;
88describe ( 'mapboxgl_MapVLayer' , function ( ) {
@@ -17,7 +17,6 @@ describe('mapboxgl_MapVLayer', function () {
1717 testDiv . style . width = "500px" ;
1818 testDiv . style . height = "500px" ;
1919 window . document . body . appendChild ( testDiv ) ;
20-
2120 map = new mapboxgl . Map ( {
2221 container : 'map' ,
2322 style : {
@@ -40,7 +39,6 @@ describe('mapboxgl_MapVLayer', function () {
4039 center : [ 112 , 37.94 ] ,
4140 zoom : 3
4241 } ) ;
43-
4442 map . on ( 'load' , function ( ) {
4543 var randomCount = 1000 ;
4644 var data = [ ] ;
@@ -78,45 +76,41 @@ describe('mapboxgl_MapVLayer', function () {
7876 originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
7977 jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
8078 } ) ;
81-
8279 afterEach ( function ( ) {
8380 jasmine . DEFAULT_TIMEOUT_INTERVAL = originalTimeout ;
8481 } ) ;
85-
8682 afterAll ( function ( ) {
8783 document . body . removeChild ( testDiv ) ;
8884 mapv = null ;
8985 } ) ;
9086
91- it ( 'constructor test ' , function ( done ) {
87+ it ( 'initialize ' , function ( done ) {
9288 setTimeout ( function ( ) {
9389 expect ( mapvLayer ) . not . toBeNull ( ) ;
9490 expect ( mapvLayer . canvas ) . not . toBeNull ( ) ;
9591 expect ( mapvLayer . map ) . not . toBeNull ( ) ;
9692 expect ( mapvLayer . mapContainer ) . not . toBeNull ( ) ;
97-
9893 //判断是否返回期望的maplayer
9994 expect ( mapvLayer . renderer ) . not . toBeNull ( ) ;
10095 expect ( mapvLayer . renderer . context ) . toBe ( "2d" ) ;
10196 done ( ) ;
10297 } , 6000 ) ;
10398 } ) ;
10499
105- it ( 'getTopLeft test ' , function ( ) {
100+ it ( 'getTopLeft' , function ( ) {
106101 var topLeft = mapvLayer . getTopLeft ( ) ;
107102 expect ( topLeft ) . not . toBeNull ( ) ;
108103 } ) ;
109104
110- it ( 'show test ' , function ( ) {
105+ it ( 'show' , function ( ) {
111106 var thisMapvlayer = mapvLayer . show ( ) ;
112107 expect ( thisMapvlayer ) . not . toBeNull ( ) ;
113108 expect ( thisMapvlayer . renderer . canvasLayer . canvas . style . display ) . toBe ( 'block' ) ;
114109 } ) ;
115110
116- it ( 'hide test ' , function ( ) {
111+ it ( 'hide' , function ( ) {
117112 var thisMapvlayer = mapvLayer . hide ( ) ;
118113 expect ( thisMapvlayer ) . not . toBeNull ( ) ;
119114 expect ( thisMapvlayer . renderer . canvasLayer . canvas . style . display ) . toBe ( 'none' ) ;
120115 } ) ;
121-
122116} ) ;
0 commit comments