add resize support for JS API map canvas
add resize support for JS API. Currently only 'squashes' map canvas - demo: http://bit.ly/mf0in7.
The canvas itself resizes, but the API needs to listen to the resize event on the canvas & process accordingly
-
samlarsen1 commented
Thanks for that - i will give it a try.
Love the project - great work ;) -
AdminPetr Sloup (Admin, WebGL Earth) commented
The onresize event is only available on the window object. It is therefore quite hard to detect resize of the canvas element. However, this is solved by providing .handleResize() method on the WebGLEarth class (this is demonstrated in http://code.google.com/p/webglearth/source/browse/trunk/api/api.html). All you have to do is call this method after changing dimensions of canvas and it will resize internal viewport and adjust projection matrix if needed.