File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/maptalks/src/renderer/map Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -692,11 +692,19 @@ class MapAbstractRenderer extends MapRenderer {
692692
693693 // canvas for tops
694694 createTopCanvas ( ) {
695- this . topLayer = createEl ( 'canvas' ) as HTMLCanvasElement ;
695+ const topLayer = createEl ( 'canvas' ) as HTMLCanvasElement ;
696+ this . topLayer = topLayer ;
697+ topLayer . width = this . canvas . width ;
698+ topLayer . height = this . canvas . height ;
699+ topLayer . style . position = 'absolute' ;
700+ topLayer . style . top = '0px' ;
701+ topLayer . style . left = '0px' ;
702+ topLayer . style . width = this . canvas . style . width ;
703+ topLayer . style . height = this . canvas . style . height ;
696704 const panels = this . map . getPanels ( ) ;
697705 const canvasContainer = panels . canvasContainer ;
698- canvasContainer . insertBefore ( this . topLayer , this . canvas ) ;
699- this . topCtx = this . topLayer . getContext ( '2d' ) ;
706+ canvasContainer . insertBefore ( topLayer , this . canvas ) ;
707+ this . topCtx = topLayer . getContext ( '2d' ) ;
700708 }
701709
702710 removeTopCanvas ( ) {
You can’t perform that action at this time.
0 commit comments