khtmlib
khtmlib copied to clipboard
Map doesn't adapt to screensize
When resizing the screen then the CSS of the (original) map div is not respected. When you set it up with for example 100% map size then the size doesn't adapt to the screensize.
This is a bug. If the window is resized the map should resize automaticly. If only the map div size is changed you must call "map.getSize()"
I made some changes here. If it does not work as expected,you have to call: "map.setMapPosition()" after map div size has changed.
Sorry, you need 2 commands: map.setMapPosition(); map.setCenter(map.getCenter(),map.getZoom());
As explained by mail, it does partially. See with firefox the internal divs in the map. When you resize an initial small window to a bigger/full window. Then you'll see that the body div is good but the divs in there are not they are still the same size as the original screen when the page was loaded.
There are more problems with the current concept (copying div to new body div). For example the size of the div is not equal as the source div.
It would be much better to keep the map in the source div and read the size of it. So KHTML is the slave of that div not the master of another div that reads the source (master div)
So that this would be the case:
Instead of this:
The map is now childnode of the original map div. See Example: http://www.khtml.org/osm/v0.54/examples/tv.html
solved
Nope, not solved. But yes much better. I will send you a screenshot. In my case the possition of the child div is wrongly calculated. The left and top are wrong and the height is missing. Why not make the height 100% and the width 100%. The parent div should limit the size of its child. It works for me.