@@ -47,11 +47,10 @@ export class GraphicCanvasRenderer extends olObject {
4747 CommonUtil . extend ( this , opt ) ;
4848 this . highLightStyle = this . layer . highLightStyle ;
4949
50- this . mapWidth = this . size [ 0 ] ;
51- this . mapHeight = this . size [ 1 ] ;
50+ this . mapWidth = this . size [ 0 ] / this . pixelRatio ;
51+ this . mapHeight = this . size [ 1 ] / this . pixelRatio ;
5252 this . width = this . map . getSize ( ) [ 0 ] ;
5353 this . height = this . map . getSize ( ) [ 1 ] ;
54-
5554 this . context = Util . createCanvasContext2D ( this . mapWidth , this . mapHeight ) ;
5655 this . context . scale ( this . pixelRatio , this . pixelRatio ) ;
5756 this . canvas = this . context . canvas ;
@@ -79,7 +78,6 @@ export class GraphicCanvasRenderer extends olObject {
7978 this . height = height ;
8079 this . mapWidth = this . mapWidth * xRatio ;
8180 this . mapHeight = this . mapHeight * yRatio ;
82-
8381 this . canvas . width = this . mapWidth ;
8482 this . canvas . height = this . mapHeight ;
8583 this . canvas . style . width = this . width + 'px' ;
@@ -114,18 +112,18 @@ export class GraphicCanvasRenderer extends olObject {
114112 */
115113 drawGraphics ( graphics ) {
116114 this . graphics_ = graphics || [ ] ;
117- let mapWidth = this . mapWidth / this . pixelRatio ;
118- let mapHeight = this . mapHeight / this . pixelRatio ;
115+ let mapWidth = this . mapWidth ;
116+ let mapHeight = this . mapHeight ;
119117
120118 let vectorContext = olRender . toContext ( this . context , {
121119 size : [ mapWidth , mapHeight ] ,
122120 pixelRatio : this . pixelRatio
123121 } ) ;
124- var defaultStyle = this . layer . _getDefaultStyle ( ) ;
122+ let defaultStyle = this . layer . _getDefaultStyle ( ) ;
125123 let me = this ,
126124 layer = me . layer ,
127125 map = layer . map ;
128- graphics . map ( function ( graphic ) {
126+ graphics . map ( function ( graphic ) {
129127 let style = graphic . getStyle ( ) || defaultStyle ;
130128 if ( me . selected === graphic ) {
131129 let defaultHighLightStyle = style ;
0 commit comments