File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -319,13 +319,16 @@ export class GttClient {
319
319
this . toolbar . addControl ( maximizeCtrl )
320
320
321
321
// Map rotation
322
- this . map . getView ( ) . on ( 'change:rotation' , ( evt ) => {
323
- const degrees = evt . target . getRotation ( ) * 180 / Math . PI
324
- document . querySelector ( '#settings_project_map_rotation' ) . setAttribute (
325
- 'value' ,
326
- String ( Math . round ( degrees % 360 ) )
327
- )
328
- } )
322
+ const rotation_field = document . querySelector ( '#settings_project_map_rotation' )
323
+ if ( rotation_field !== null ) {
324
+ this . map . getView ( ) . on ( 'change:rotation' , ( evt ) => {
325
+ const degrees = evt . target . getRotation ( ) * 180 / Math . PI
326
+ rotation_field . setAttribute (
327
+ 'value' ,
328
+ String ( Math . round ( degrees % 360 ) )
329
+ )
330
+ } )
331
+ }
329
332
330
333
if ( this . contents . edit ) {
331
334
this . setControls ( this . contents . edit . split ( ' ' ) )
You can’t perform that action at this time.
0 commit comments