Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolution is not good #71

Open
devnedra opened this issue Feb 20, 2020 · 3 comments
Open

Resolution is not good #71

devnedra opened this issue Feb 20, 2020 · 3 comments

Comments

@devnedra
Copy link

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

@dortiz-starcard
Copy link

you can pass a height param

@slowe
Copy link
Owner

slowe commented Mar 10, 2020

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

@meNeither
Copy link

meNeither commented May 2, 2020

@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 pushed a commit to meNeither/VirtualSky that referenced this issue May 9, 2020
meNeither pushed a commit to meNeither/VirtualSky that referenced this issue May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants