PhoneGap的/ Android的:谷歌地图没有完全显示在模拟器 [英] PhoneGap/Android: Google Map not fully displayed in emulator

查看:236
本文介绍了PhoneGap的/ Android的:谷歌地图没有完全显示在模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图获得运行Android(使用Eclipse与PhoneGap的为Andoroid插件),具有谷歌地图一个PhoneGap的应用程序。本质上,它似乎工作。然而,在显示地图时,有一些小问题。我没有手机在手,只有模拟器。地图上看起来,例如,像下面的图片:

I'm trying to get a PhoneGap application for Android running (using Eclipse with PhoneGap for Andoroid plugin) featuring a Google Map. Essentially it seems to work. However, there some glitches when displaying the map. I have no phone at hand, only the emulator. The map looks, for example, like the picture below:

的控件和此使用条款都在那里,但也有部分从地图失踪。当我移动地图还滑空/灰色地带。但是清爽/重装后,在地图上的部分再次消失。而且它并不总是相同的区域,有时小,有时有点大。但从来没有完整的区域充满地图。

The controls and this 'Terms of Use' are all there, but there are parts missing from the map. When I move the map it slides also empty/grey areas. But after refreshing/reloading, parts of the map vanish again. And it's not always the same area, sometimes smaller, sometimes a bit larger. But never the full area is filled with the map.

时的仿真器这样的错误/故障。当搜索的问题,我只在该地图不显示在所有问题绊倒(例如,布局是0像素/ 0像素或API密钥丢失)。我也有一个原生的Andr​​oid应用程序,并死在那里的活动使用谷歌地图显示相当的精细。

Is this an error/glitch of the emulator. When searching for problems I only stumble upon the issue that the map is not displayed at all (e.g., layout is 0px/0px or the API key is missing). I also have a native Android application, and there die Activity with a Google Map is displayed quite fine.

感谢您的任何提示!

推荐答案

好吧,经过一番更多的搜索网站,我发现这个问题。这似乎是一个常见的​​问题,当你尝试在一个隐藏的DIV元素加载地图。关键是要简单地刷新地图后,这个DIV变为可见。一种方法,我发现和工作对我来说是mnually触发resize事件: google.maps.event.trigger(地图,调整大小);

Ok, after some more searching the Web, I've found the problem. It seems to be a common issue when you try to load a map in a hidden DIV element. The trick is to simply refresh the map after this DIV becomes visible. One way I found and that worked for me is to mnually trigger the resize event: google.maps.event.trigger(map, "resize");

这篇关于PhoneGap的/ Android的:谷歌地图没有完全显示在模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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