File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4141 tileSize,
4242 async loadTile ( { z, x, y} ) {
4343 const tileSize = 256 ;
44- const offscreenCanvas = new OffscreenCanvas ( tileSize , tileSize ) ;
45- const context = offscreenCanvas . getContext ( '2d' ) ;
44+ const canvas = document . createElement ( 'canvas' ) ;
45+ canvas . width = canvas . height = tileSize ;
46+ const context = canvas . getContext ( '2d' ) ;
4647 context . fillStyle = 'red' ;
4748 context . fillRect ( 0 , 0 , tileSize , tileSize ) ;
4849
5657 } ,
5758 prepareTile ( { z, x, y} ) {
5859 const tileSize = 256 ;
59- const offscreenCanvas = new OffscreenCanvas ( tileSize , tileSize ) ;
60- const context = offscreenCanvas . getContext ( '2d' ) ;
60+ const canvas = document . createElement ( 'canvas' ) ;
61+ canvas . width = canvas . height = tileSize ;
62+ const context = canvas . getContext ( '2d' ) ;
6163 context . fillStyle = currentColor ;
6264 context . fillRect ( 0 , 0 , tileSize , tileSize ) ;
6365
You can’t perform that action at this time.
0 commit comments