@@ -45,7 +45,7 @@ describe('mapboxgl_GraticuleLayer', () => {
4545 jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
4646 if ( ! map . getLayer ( 'graticuleLayer_1' ) ) {
4747 graticuleLayer = new GraticuleLayer ( { layerID : 'graticuleLayer_1' } ) ;
48- graticuleLayer . onAdd ( map ) ;
48+ map . addLayer ( graticuleLayer ) ;
4949 }
5050 } ) ;
5151
@@ -92,6 +92,20 @@ describe('mapboxgl_GraticuleLayer', () => {
9292 expect ( visible ) . toBe ( 'visible' ) ;
9393 } ) ;
9494
95+ it ( 'setLayoutProperty' , ( ) => {
96+ let visible = map . getLayoutProperty ( 'graticuleLayer_1_line' , 'visibility' ) ;
97+ expect ( visible ) . toBe ( 'visible' ) ;
98+ expect ( graticuleLayer . visible ) . toBeTruthy ( ) ;
99+ map . setLayoutProperty ( graticuleLayer . id , 'visibility' , 'none' ) ;
100+ visible = map . getLayoutProperty ( 'graticuleLayer_1_line' , 'visibility' ) ;
101+ expect ( visible ) . toBe ( 'none' ) ;
102+ expect ( graticuleLayer . visible ) . toBeFalsy ( ) ;
103+ map . setLayoutProperty ( graticuleLayer . id , 'visibility' , 'visible' ) ;
104+ visible = map . getLayoutProperty ( 'graticuleLayer_1_line' , 'visibility' ) ;
105+ expect ( visible ) . toBe ( 'visible' ) ;
106+ expect ( graticuleLayer . visible ) . toBeTruthy ( ) ;
107+ } ) ;
108+
95109 it ( 'setMinZoom' , ( ) => {
96110 graticuleLayer . setMinZoom ( 0 ) ;
97111 expect ( graticuleLayer . options . minZoom ) . toEqual ( 0 ) ;
@@ -108,12 +122,12 @@ describe('mapboxgl_GraticuleLayer', () => {
108122 } ) ;
109123
110124 it ( 'setExtent' , ( ) => {
111- graticuleLayer . setExtent ( [
112- [ 0 , 0 ] ,
113- [ 50 , 50 ]
114- ] ) ;
115- expect ( graticuleLayer . options . extent [ 0 ] ) . toEqual ( 0 ) ;
116- expect ( graticuleLayer . options . extent [ 3 ] ) . toEqual ( 50 ) ;
125+ graticuleLayer . setExtent ( [
126+ [ 0 , 0 ] ,
127+ [ 50 , 50 ]
128+ ] ) ;
129+ expect ( graticuleLayer . options . extent [ 0 ] ) . toEqual ( 0 ) ;
130+ expect ( graticuleLayer . options . extent [ 3 ] ) . toEqual ( 50 ) ;
117131 } ) ;
118132
119133 it ( 'setStrokeStyle' , ( ) => {
@@ -132,8 +146,8 @@ describe('mapboxgl_GraticuleLayer', () => {
132146 } ) ;
133147
134148 it ( 'setIntervals' , ( ) => {
135- graticuleLayer . setIntervals ( 5 ) ;
136- expect ( graticuleLayer . renderer . options . interval ) . toEqual ( 5 ) ;
149+ graticuleLayer . setIntervals ( 5 ) ;
150+ expect ( graticuleLayer . renderer . options . interval ) . toEqual ( 5 ) ;
137151 } ) ;
138152
139153 it ( 'getDefaultExtent must return degree' , ( ) => {
0 commit comments