@@ -45,7 +45,7 @@ describe('mapboxgl_GraticuleLayer', () => {
45
45
jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
46
46
if ( ! map . getLayer ( 'graticuleLayer_1' ) ) {
47
47
graticuleLayer = new GraticuleLayer ( { layerID : 'graticuleLayer_1' } ) ;
48
- graticuleLayer . onAdd ( map ) ;
48
+ map . addLayer ( graticuleLayer ) ;
49
49
}
50
50
} ) ;
51
51
@@ -92,6 +92,20 @@ describe('mapboxgl_GraticuleLayer', () => {
92
92
expect ( visible ) . toBe ( 'visible' ) ;
93
93
} ) ;
94
94
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
+
95
109
it ( 'setMinZoom' , ( ) => {
96
110
graticuleLayer . setMinZoom ( 0 ) ;
97
111
expect ( graticuleLayer . options . minZoom ) . toEqual ( 0 ) ;
@@ -108,12 +122,12 @@ describe('mapboxgl_GraticuleLayer', () => {
108
122
} ) ;
109
123
110
124
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 ) ;
117
131
} ) ;
118
132
119
133
it ( 'setStrokeStyle' , ( ) => {
@@ -132,8 +146,8 @@ describe('mapboxgl_GraticuleLayer', () => {
132
146
} ) ;
133
147
134
148
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 ) ;
137
151
} ) ;
138
152
139
153
it ( 'getDefaultExtent must return degree' , ( ) => {
0 commit comments