@@ -193,7 +193,6 @@ export class GttClient {
193
193
this . vector . set ( 'displayInLayerSwitcher' , false )
194
194
this . layerArray . push ( this . vector )
195
195
this . map . addLayer ( this . vector )
196
- console . log ( this . layerArray )
197
196
198
197
// Render project boundary if bounds are available
199
198
if ( this . contents . bounds && this . contents . bounds !== null ) {
@@ -298,21 +297,23 @@ export class GttClient {
298
297
// Because Redmine filter functions are applied later, the Window onload
299
298
// event provides a workaround to have filters loaded before executing
300
299
// the following code
301
- if ( document . querySelectorAll ( 'tr#tr_bbox' ) . length > 0 ) {
302
- this . filters . location = true
303
- }
304
- if ( document . querySelectorAll ( 'tr#tr_distance' ) . length > 0 ) {
305
- this . filters . distance = true
306
- }
307
- const legend = document . querySelector ( 'fieldset#location legend' ) as HTMLLegendElement
308
- if ( legend ) {
309
- legend . addEventListener ( 'click' , ( evt ) => {
310
- const element = evt . currentTarget as HTMLLegendElement
311
- this . toggleAndLoadMap ( element )
312
- } )
313
- }
314
- this . zoomToExtent ( )
315
- this . map . on ( 'moveend' , this . updateFilter . bind ( this ) )
300
+ window . addEventListener ( 'load' , ( ) => {
301
+ if ( document . querySelectorAll ( 'tr#tr_bbox' ) . length > 0 ) {
302
+ this . filters . location = true
303
+ }
304
+ if ( document . querySelectorAll ( 'tr#tr_distance' ) . length > 0 ) {
305
+ this . filters . distance = true
306
+ }
307
+ const legend = document . querySelector ( 'fieldset#location legend' ) as HTMLLegendElement
308
+ if ( legend ) {
309
+ legend . addEventListener ( 'click' , ( evt ) => {
310
+ const element = evt . currentTarget as HTMLLegendElement
311
+ this . toggleAndLoadMap ( element )
312
+ } )
313
+ }
314
+ this . zoomToExtent ( )
315
+ this . map . on ( 'moveend' , this . updateFilter . bind ( this ) )
316
+ } )
316
317
317
318
// To fix an issue with empty map after changing the tracker type
318
319
document . querySelectorAll ( 'select#issue_tracker_id' ) . forEach ( element => {
0 commit comments