Javascript 无法在phonegap中使用Google地图进行地理定位

Javascript 无法在phonegap中使用Google地图进行地理定位,javascript,cordova,jquery-mobile,jquery-plugins,google-maps-api-3,Javascript,Cordova,Jquery Mobile,Jquery Plugins,Google Maps Api 3,我尝试使用jquery在Phonegap中的google地图上进行地理定位。 我尝试了以下代码,但它不起作用。我收到警报(“1”)但没有收到警报(“2”): 一个主意?请:) 以下是我的.js文件: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <script type="text

我尝试使用jquery在Phonegap中的google地图上进行地理定位。 我尝试了以下代码,但它不起作用。我收到警报(“1”)但没有收到警报(“2”):

一个主意?请:)

以下是我的.js文件:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.min.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.extensions.js"></script>

map_canvas在我的html中引用此div: id=“地图画布”style=“宽度:250px;高度:250px”


谢谢

为什么要使用
.gmap
函数来获取当前位置,而不是使用
navigator.geolocation
对象?此外,请确保在设备准备就绪后调用地理定位API——有关更多详细信息,请参阅。

Thks。我终于做到了
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.min.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.js"></script>
    <script type="text/javascript" src="js/jquery.ui.map.extensions.js"></script>