Currently I have a google map displaying in salesforce. If I set showheader="false" in the apex page tag, I can set the map div to 100% height.

If I set showheader="true" then I need a specific height, for example height:800px for the map div.

Is it possible to have the map fill the page space while having the salesforce header there and how would you do it?

1 Answer 1


Use apex variable for <apex:page showheader="{!Val}"> than put Java script code in your visualforce page. like

var bool = '{!var}';
if(bool = True){
   var heightpx = 800px ;
   var heightpx = 100px ;

after that you can put heightpx variable at the place of height:800px as height:heightpx

  • I'm not sure what you are aiming at there? This would set the map to relatively large or tiny depending on if the header is shown? In order to offer it as an option? I just wanted to know if you can have a header and a map that fills the space available.
    – Ronan
    Commented Jul 3, 2015 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .