Google Maps API InfoWindow iPhone / Android浏览器上的高度不正确 [英] Google Maps API InfoWindow Incorrect Height on iPhone/Android Browser

查看:162
本文介绍了Google Maps API InfoWindow iPhone / Android浏览器上的高度不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,使用Google Maps API v3在我的公司有位置的地方显示infowindows标记。



每当我在iPhone或Android手机上并让设备处于横向模式,infowindow高度太小而无法看到内容并且没有出现滚动条(包含的照片显示我的意思)。当设备处于纵向模式时,infowindows将正确显示。



我尝试设置组成内容的HTML的高度和最小高度CSS属性infowindows,但没有奏效。

解决方案

要改变这种情况,您需要检测方向更改并重绘窗口,如下所示:

b
$ b

  document.addEventListener(orientationChanged,updateOrientation,false); 
function updateOrientation(e){
// resize window here
wrapperH = window.innerHeight;
document.getElementById('map_container')。style.height = wrapperH +'px';
}

这应该适用于调整大小,我不记得API重绘电话,但有一个改变大小。希望这有助于。


I have a web page that uses Google Maps API v3 to display markers with infowindows where my company has locations.

Whenever I'm on an iPhone or Android phone and have the device turned in landscape mode, the infowindow height is too small to see the content and no scrollbars appear (included photo shows what I mean). When the device is in portrait mode, the infowindows display correctly.

I've tried setting the height and min-height CSS properties of the HTML that makes up the content of the infowindows, but that has not worked.

解决方案

To change this, you need to detect orientation change and redraw your window, something like:

document.addEventListener("orientationChanged", updateOrientation, false);
function updateOrientation(e) {
// resize window here
    wrapperH = window.innerHeight;
    document.getElementById('map_container').style.height = wrapperH + 'px';
}

This should work for the resizing, and I can't remember the API redraw call, but there is one for changing size. Hope this helps.

这篇关于Google Maps API InfoWindow iPhone / Android浏览器上的高度不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆