@@ -55,7 +55,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
55
55
readonly imageryProvider : ImageryProvider ,
56
56
options : L . TileLayerOptions = { }
57
57
) {
58
- super ( < any > undefined , {
58
+ super ( undefined as any , {
59
59
...options ,
60
60
updateInterval : defined ( ( imageryProvider as any ) . _leafletUpdateInterval )
61
61
? ( imageryProvider as any ) . _leafletUpdateInterval
@@ -147,7 +147,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
147
147
148
148
createTile ( coords : L . Coords , done : L . DoneCallback ) {
149
149
// Create a tile (Image) as normal.
150
- const tile = < HTMLImageElement > super . createTile ( coords , done ) ;
150
+ const tile = super . createTile ( coords , done ) as HTMLImageElement ;
151
151
152
152
// By default, Leaflet handles tile load errors by setting the Image to the error URL and raising
153
153
// an error event. We want to first raise an error event that optionally returns a promise and
@@ -162,7 +162,12 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
162
162
. catch ( ( e : unknown ) => {
163
163
// The tile has failed irrecoverably, so invoke Leaflet's standard
164
164
// tile error handler.
165
- ( < any > L . TileLayer ) . prototype . _tileOnError . call ( this , done , tile , e ) ;
165
+ ( L . TileLayer as any ) . prototype . _tileOnError . call (
166
+ this ,
167
+ done ,
168
+ tile ,
169
+ e
170
+ ) ;
166
171
} ) ;
167
172
return ;
168
173
}
@@ -176,7 +181,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
176
181
} ;
177
182
178
183
L . DomEvent . on ( tile , "error" , ( e ) => {
179
- const level = ( < any > this ) . _getLevelFromZ ( coords ) ;
184
+ const level = ( this as any ) . _getLevelFromZ ( coords ) ;
180
185
const message = i18next . t ( "map.cesium.failedToObtain" , {
181
186
x : coords . x ,
182
187
y : coords . y ,
@@ -190,7 +195,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
190
195
coords . x ,
191
196
coords . y ,
192
197
level ,
193
- < any > e
198
+ e as any
194
199
// TODO: bring terriajs-cesium retry logic to cesium
195
200
//doRequest
196
201
) ;
@@ -230,7 +235,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
230
235
this . _delayedUpdate = undefined ;
231
236
}
232
237
233
- this . _delayedUpdate = < any > setTimeout ( ( ) => {
238
+ this . _delayedUpdate = setTimeout ( ( ) => {
234
239
this . _delayedUpdate = undefined ;
235
240
236
241
// If we're no longer attached to a map, do nothing.
@@ -272,19 +277,19 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
272
277
}
273
278
274
279
if ( isDefined ( this . imageryProvider . credit ) ) {
275
- ( < any > this . _map ) . attributionControl . addAttribution (
280
+ ( this . _map as any ) . attributionControl . addAttribution (
276
281
getCreditHtml ( this . imageryProvider . credit )
277
282
) ;
278
283
}
279
284
280
285
this . _usable = true ;
281
286
282
287
this . _update ( ) ;
283
- } , this . _leafletUpdateInterval ) ;
288
+ } , this . _leafletUpdateInterval ) as any ;
284
289
}
285
290
286
291
if ( this . _usable ) {
287
- ( < any > L . TileLayer ) . prototype . _update . apply ( this , args ) ;
292
+ ( L . TileLayer as any ) . prototype . _update . apply ( this , args ) ;
288
293
289
294
this . _updateAttribution ( ) ;
290
295
}
@@ -348,9 +353,11 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
348
353
349
354
for ( let j = ne . y ; j < sw . y ; ++ j ) {
350
355
for ( let i = sw . x ; i < ne . x ; ++ i ) {
351
- const credits = < Credit [ ] > (
352
- this . imageryProvider . getTileCredits ( i , j , zoom )
353
- ) ;
356
+ const credits = this . imageryProvider . getTileCredits (
357
+ i ,
358
+ j ,
359
+ zoom
360
+ ) as Credit [ ] ;
354
361
if ( ! defined ( credits ) ) {
355
362
continue ;
356
363
}
@@ -365,7 +372,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
365
372
nextCredits . push ( credit ) ;
366
373
367
374
if ( ! credit . _shownInLeafletLastUpdate ) {
368
- ( < any > this . _map ) . attributionControl . addAttribution (
375
+ ( this . _map as any ) . attributionControl . addAttribution (
369
376
getCreditHtml ( credit )
370
377
) ;
371
378
}
@@ -376,7 +383,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
376
383
// Remove attributions that applied last update but not this one.
377
384
for ( let i = 0 ; i < this . _previousCredits . length ; ++ i ) {
378
385
if ( ! this . _previousCredits [ i ] . _shownInLeaflet ) {
379
- ( < any > this . _map ) . attributionControl . removeAttribution (
386
+ ( this . _map as any ) . attributionControl . removeAttribution (
380
387
getCreditHtml ( this . _previousCredits [ i ] )
381
388
) ;
382
389
this . _previousCredits [ i ] . _shownInLeafletLastUpdate = false ;
@@ -426,7 +433,7 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
426
433
TerriaError . from (
427
434
e ,
428
435
`An error ocurred while calling \`ImageryProvider#.pickFeatures\`. \`ImageryProvider.url = ${
429
- ( < any > this . imageryProvider ) . url
436
+ ( this . imageryProvider as any ) . url
430
437
} \``
431
438
) . log ( ) ;
432
439
}
@@ -441,13 +448,13 @@ export default class ImageryProviderLeafletTileLayer extends L.TileLayer {
441
448
for ( let i = 0 ; i < this . _previousCredits . length ; ++ i ) {
442
449
this . _previousCredits [ i ] . _shownInLeafletLastUpdate = false ;
443
450
this . _previousCredits [ i ] . _shownInLeaflet = false ;
444
- ( < any > map ) . attributionControl . removeAttribution (
451
+ ( map as any ) . attributionControl . removeAttribution (
445
452
getCreditHtml ( this . _previousCredits [ i ] )
446
453
) ;
447
454
}
448
455
449
456
if ( this . _usable && defined ( this . imageryProvider . credit ) ) {
450
- ( < any > map ) . attributionControl . removeAttribution (
457
+ ( map as any ) . attributionControl . removeAttribution (
451
458
getCreditHtml ( this . imageryProvider . credit )
452
459
) ;
453
460
}
0 commit comments