VirtualSky icon indicating copy to clipboard operation
VirtualSky copied to clipboard

Resolution is not good

Open devnedra opened this issue 5 years ago • 3 comments

Please how i can increase the resolution of the map. Currently this is not good .

devnedra avatar Feb 20 '20 06:02 devnedra

you can pass a height param

dortiz-starcard avatar Feb 20 '20 20:02 dortiz-starcard

@devnedra Could you add more detail to try to explain?

slowe avatar Mar 10 '20 09:03 slowe

@slowe I think, @devnedra meant the resolution on »retina« displays. You could increase it by dynamically reading the devicePixelRatio, e.g.:

w = window.innerWidth;
h = window.innerHeight;
this.canvas.width = w*window.devicePixelRatio;
this.canvas.height = h*window.devicePixelRatio;
this.canvas.css({'width':w+'px','height':h+'px'});

In this case, you also need to scale the canvas element up:

ctx.scale(window.devicePixelRatio,window.devicePixelRatio);

You need to modify createSky, setWH, and resize.

I made a quick test on my device (pixel ratio: 2) and it seemed fine to me (but I am not really into the edge cases of your script).

meNeither avatar May 02 '20 23:05 meNeither