Hi,
I tried using jquery to reset map size based on parent container, It worked fine with .net controls. Once I wrapped my map with RadSplitters, map gets zoomedOut to its highest level and map layer occupies small area in the top left hand corner. Rest of the container panel is then covered with map background. However after post back map size was set properly so, to solve my issue I used jquery to send ajax request to server with dummy button and document.ready( ).
It would be great if I could set my map width and height appropriately on page load without doing any postback. I have a user control with a map called "Map" and the map controls ID is "Map1". Initially I used javascipt as shown below to set map width and height based on browser.
window.onresize = this.ResizeMainPage;
$(document).ready(function() {
ResizeMainPage();
});
ResizeMainPage = function() {
cheight = document.documentElement.clientHeight;
cwidth = document.documentElement.clientWidth;
var titleHeight = $("#TitleBar").height();
var contentHeight = parseInt(cheight) - titleHeight;
$("#ContentBar").height(contentHeight);
$("#LeftBar").height(contentHeight);
$("#RightBar").height(contentHeight);
var NavWidth = $("#LeftBar").width();
var mapWidth = parseInt(cwidth) - NavWidth;
$("#RightBar").width(mapWidth);
$("#Map_Map1").width(mapWidth);
$("#Map_Map1").height(contentHeight);
$("#Map_Map1Container").width(mapWidth);
$("#Map_Map1Container").height(contentHeight);
}
Thanks
Prava