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

Map Size on retina devices #33

Open
philipp-lehmann opened this issue Jun 29, 2019 · 1 comment
Open

Map Size on retina devices #33

philipp-lehmann opened this issue Jun 29, 2019 · 1 comment

Comments

@philipp-lehmann
Copy link

philipp-lehmann commented Jun 29, 2019

Hey

Thanks for your library, it is very useful.

One issue I detected. The display device pixel ratio is not considered when creating the map.
On retina displays the map thus extends beyond the canvas (doubled in size)
See linked gif. The dots dissapear once the float out of the canvas.
https://media.giphy.com/media/J0IpaB7IDutgQIxnzh/giphy.gif

Any suggestions?

Here is a discussion on how to check for displays with retina support:
https://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript

@philipp-lehmann
Copy link
Author

philipp-lehmann commented Jul 2, 2019

My bad:
It's essential that the canvas is defined in a variable.

// working as expected
let canvas
function setup() {
  canvas = createCanvas(1024, 640);

compared to

// not cropping the map on retina displays
function setup() {
  createCanvas(1024, 640);

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

1 participant