Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Scaling the google map api

How do i scale the google maps api to scale correctly on iphone and ipad? on iphone it looks good, but on the ipad it gets like this:

Image

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

Scaling the google map api

Hi Lars,

Take a look at here please:
https://getsatisfaction.com/apperyio/...

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Scaling the google map api

Thanks for the reply! The answer there is for full screen, but since i have some buttons and such im not sure that will work for me? Either way, i think this code will work, but im not sure where to put it in?

// googleMap default height: 220px, width: auto
var viewport_height = $(window).height();
if (viewport_height 500) {
$('div[dsid="googleMap"]').height('440px');
}

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Scaling the google map api

Hi Lars,

Your part of the code is just sets 440px (default 220px) height for Google maps component, when window height more then 500px.

You can edit this code in accordance with your needs.

You can place this code in JavaScript event handler on the page load event. http://prntscr.com/36inrm/direct
precode
// googleMap default height: 220px, width: auto
var viewport_height = $(window).height();
if (viewport_height > 500) {
$('div[dsid="googleMap"]').height('440px');
}
/code/pre
Note: "googleMap" is a Google maps component name. You should change it with yours.

Regards.

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Scaling the google map api

Thanks! It seems to work! Now as i understand, this will work good as a size on the ipad?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Scaling the google map api

Yes, it should work on all devices.

Return to “Issues”