地图涵盖帆布Android上的其他元素 [英] Map canvas covers other elements on Android

查看:152
本文介绍了地图涵盖帆布Android上的其他元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写在Android上使用PhoneGap的应用程序,我想映射到100%的宽度和屏幕的高度。问题是,当我运行Android设备上的应用程序的所有DOM元素像div的不显示我上面的地图。例如。弹出窗口被触发,但他们是地图画布下(高设置的z-index没有帮助)。

I'm writing an application on Android using PhoneGap and i want map to be 100% width and height of the screen. The problem is that all of DOM elements like divs are not displayed above my map when i'm running the app on android device. E.g. popups are triggered but they're under map canvas (setting high z-index doesn't help).

当在浏览器中运行(FF,铬)evrything工作正常。它是与Android默认浏览器的问题?有谁知道如何解决此问题?

While running on browser (FF, Chrome) evrything works fine. Is it problem with Android default browser? Does anyone know how to solve this?

例如:

<a href="" data-role="button">button</a>

我不能让地图上方这个简单的JQM按钮显示。

I can't make this simple JQM button display above the map.

推荐答案

所以,解决的办法是要小心,包括JS / CSS文件的顺序。所以,如果你正在写使用JQM应用程序,谷歌地图的API,你应该记住电话差距:

So the solution is to be careful about order of including js/css files. So if you're writing an app using JQM, google-maps-api and phone gap you should remember:

首先包括CSS文件例如
&LT;链接rel =stylesheet属性HREF =HTTP://$c$c.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css/&GT ;

First include css files e.g <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />

那么这个谷歌的API声明
&LT;脚本SRC =htt​​p://maps.google.com/maps/api/js?sensor=true类型=文/ JavaScript的&GT;&LT; / SCRIPT&GT;

Then this google api declaration <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>

之后,jQuery的js文件
&LT;脚本SRC =HTTP://$c$c.jquery.com/jquery-1.8.2.min.js&GT;&LT; / SCRIPT&GT;

After that the jquery .js file <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>

接下来jQuery UI的地图文件,如
&LT;脚本类型=文/ JavaScript的SRC =jquery.ui.map / jquery.ui.map.js&GT;&LT; / SCRIPT&GT;

Next jquery ui map files like <script type="text/javascript" src="jquery.ui.map/jquery.ui.map.js"></script>

和最后jQuery Mobile的脚本文件(我认为这是我犯的错误)

And at last jquery mobile script file (I think this is where I made mistake)

&LT;脚本类型=文/ JavaScript的SRC =jquery.ui.map / jquery.ui.map.js&GT;&LT; / SCRIPT&GT;

这篇关于地图涵盖帆布Android上的其他元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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