0
- PhoneGap的桌面應用程式v0.4.3
- 的Android V5.1.1
上面的代碼與桌面應用做工精細,並config.xml由該PhoneGap桌面應用程序創建。 而當我在build.phonegap.com上試用它時,谷歌地圖未能初始化,所以沒有出現在Android上,只是一個白色屏幕。
這裏是我的initMap方法,它的API需要:
var map, directionsService, directionsDisplay;
function initMap() {
directionsService = new google.maps.DirectionsService;
directionsDisplay = new google.maps.DirectionsRenderer;
map = new google.maps.Map(document.getElementById('gMap'), {
zoom: 10,
center: { lat: 25.0115052, lng: 66.7845126 },
mapTypeId: 'roadmap',
});
directionsDisplay.setMap(map);
} // initMap() ends
config.xml文件:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld"
version="1.0.0"
xmlns="http://www.w3.org/ns/widgets"
xmlns:gap="http://phonegap.com/ns/1.0">
<name>TestApp</name>
<description>
A blank PhoneGap app.
</description>
<author email="[email protected]" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<access origin="*" />
</widget>
你準確得到了什麼錯誤? – henrisycip
@henrisycip我認爲,我應該改造這個問題(一個簡單的應用程序,只顯示谷歌地圖沒有任何修改)。之後,我將編輯上述查詢。 –