mollyfud
Posts: 0
Joined: Mon Feb 11, 2013 5:16 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hi Guys,
I have searched and tried lots of things in this forum for setting the CSS for a Map to be a full screen. None of it works across Browser and Native Clients. I want to try to code it so the map is full screen on any device of any size. Setting Css to 100% for height seems the answer but I can't get it to work.

Can anyone give me an example of how to do this? I have looked at other methods and forums and not working for me.

TIA
Molly

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hello! If there is only map on page and you want it to fill in 100% height create JS asset with the following code:
codefunction resizeMap() {
var divs = $("[dsid=googlemapName]");
if (divs.length) {
var mapDiv = divs.eq(0);
mapDiv.css("margin", "0");
mapDiv.css("display", "none");
mapDiv.height(mapDiv.parents('[data-role="content"]').height());
mapDiv.css("display", "block");
}
}

$(window).bind('resize', function(event) {
resizeMap();
})/code
where googlemapName - Google map component name
on page where you have map on Show event run:
coderesizeMap();/code

mollyfud
Posts: 0
Joined: Mon Feb 11, 2013 5:16 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Perfect! Thank you so much! Works perfectly on Web, Mobile Web and Native Android App (Only haven't tried on iOS but sure it will work great)!

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hi Maryna:

I have a grid, image and the map on my screen.

I cannot fit my map in my screen.

I have loaded this code but does not fit the map on different screens. Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hi Laura,

Please give us a public link to your app.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hello! Thank you, we'll take a look and let you know.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hi Laura! This issue seems to be not reproducible. See how it looks like on our side
Image

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

How do you set the CSS for a Map object to get the Height to be 100% of the Screen?

Hello!!!

Not be that it happens but with this function that it fit before now not conforms to the map.

http://appery.io/app/mobile-frame?src...

Thaks!!!!!

Return to “Issues”