Canvas Size issues
See original GitHub issueHi, Im my code I have the following structure
<div>
<some other div>
<the map>
</div>
“Some other div” is sometimes there and sometimes not. In one case the map gets 50% for the containerStyle and in the other case 100%. The initial rendering is always correct. When “some other div” is not rendered the <div class=“mapboxgl-map” updates correctly, but the canvas still got the old width. When I slightly change the window size, the canvas updates to the correct value. Do you have any hint on how to force the canvas to update.
Thanks Andreas
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Large canvas size | FAQs and known issues - Adobe Support
Creating artwork on a large canvas? Learn about common questions, known issues, and troubleshooting tips.
Read more >Problem sizing canvas - Board of Innovation
Problem sizing canvas. Use this tool to assess the size of a customer problem and determine if solving it could produce value for...
Read more >Problems with canvas size - Beginners - Processing Foundation
Hi there, I am happy to have started to learn Processing however I seem to have fallen at the first hurdle. When I...
Read more >CANVAS SIZE PROBLEM!! - Pixelmator Community
Ugh. There's no easy solution. There's three compromise solutions that (and one daft non-solution) that come to mind: 1. Work in pixels. Work...
Read more >Feature Enhancement: Define Canvas Size #4093 - GitHub
Please allow for defined canvas sizes. It was requested to open a new issue here: #38 The infinite scroll is not always ideal....
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 FreeTop 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
Top GitHub Comments
Hello guys! I am still having this issue and I am currently using version 7.0.7 from react-map-gl. The issue is that now the property onStyleLoad is not available on the react-map-gl Map so that is no longer a solution and the issue is still active. The rendered canvas is first rendered with an incorrect width and height. However, once I resize the window, it is correctly resized. Any clues?
Thanks!
@dedan call it on the map that is passed to
onStyleLoad
(i suppose you could probably also do it incomponentDidMount
assuming you have a ref to the map and its defined). here is an example: