How to resize canvas?
See original GitHub issueI try edit the height of canvas like to $('#canvas').css('height', '200px'), but this dont work.
And try with document.getElementById('canvas').style.height='200px' but dont work.
I learn about map.refreshLayout(), but this dont have effect.
Example:
$('a#resize-map').click(function(){
map.setVisible(false); // I don't think it necessary to use this function.
$('#canvas').css('height', '200px');
map.refreshLayout();
map.setVisible(true);// I don't think it necessary to use this function.
return false;
});
<html>
<head>
...
</head>
<body>
<div id="canvas"></div>
<a href="#" id="resize-map">Resize canvas</a>
</body>
</html>
I use jQuery. Thanks a lot!
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
javascript - Resize HTML5 canvas to fit window
getContext('2d'); // Start listening to resize events and draw canvas. ... The blue border shows you the edge of the resizing canvas, and...
Read more >Resizing the Canvas
In Edit mode, select the Resize Canvas tool from the Toolbar at the top of the panel. · Position your cursor over the...
Read more >How to resize your image canvas
Steps to resize your image canvas · 1. Go to the Pixlr Editor website and launch the Pixlr X free edition (if you...
Read more >Resizing the canvas
1 Choose Image Canvas Size. · 2 In the New Dimensions group box, mark the Lock aspect ratio check box. · 3 Set...
Read more >WebGL Resizing the Canvas.
If you're on a desktop or laptop try pressing ctrl + + and ctrl + - to zoom in and out ( ⌘...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Call
cordova.fireDocumentEvent('plugin_touch', {});itanhduy commented on Oct 18, 2017 Call cordova.fireDocumentEvent(‘plugin_touch’, {});
that work for me after long suffer