File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class TileHashset {
64
64
* @property {Boolean } [options.cascadeTiles=true] - draw cascaded tiles of different zooms to reduce tiles
65
65
* @property {Number } [options.zoomOffset=0] - offset from map's zoom to tile's zoom
66
66
* @property {Number } [options.tileRetryCount=0] - retry count of tiles
67
+ * @property {String } [options.errorUrl=null] - image to replace when encountering error on loading tile image
67
68
* @memberOf TileLayer
68
69
* @instance
69
70
*/
@@ -72,6 +73,8 @@ const options = {
72
73
'urlTemplate' : null ,
73
74
'subdomains' : null ,
74
75
76
+ 'errorUrl' : null ,
77
+
75
78
'repeatWorld' : true ,
76
79
77
80
'background' : true ,
Original file line number Diff line number Diff line change @@ -443,6 +443,10 @@ class TileLayerCanvasRenderer extends CanvasRenderer {
443
443
return ;
444
444
}
445
445
if ( tileImage instanceof Image ) {
446
+ if ( this . layer . options [ 'errorUrl' ] ) {
447
+ tileImage . src = this . layer . options [ 'errorUrl' ] ;
448
+ return ;
449
+ }
446
450
this . abortTileLoading ( tileImage , tileInfo ) ;
447
451
}
448
452
tileImage . loadTime = 0 ;
You can’t perform that action at this time.
0 commit comments