Open wandergis opened 6 years ago
Seems to work for me on a macbook screen
On a retina macbook,the window.devicePixelRatio
is 2
. https://www.html5rocks.com/en/tutorials/canvas/hidpi/
let pixelRatio = window.devicePixelRatio || 1;
canvas.width = pixelRatio * width;
canvas.height = pixelRatio * height;
canvas.style.width = width + 'px';
canvas.style.height = height + 'px';
Can it support retina screen?