0
我使用Google gmap API在我的Phonegap應用程序中顯示Google地圖。 gmap工作正常。Gmap不是第二次向前刷新
但是,我的要求是根據用戶選擇更改標記,並且首先顯示所有標記。從第二次開始,我需要顯示爲用戶選擇。我使用JSON數據
下面是GMAP代碼:
function showMap(data) {
$('#map_canvas').gmap(
{ 'center' : initialLocation,
'zoom' : 12,
'mapTypeControl' : false,
'navigationControl' : false,
'streetViewControl' : false
})
.bind('init', function(evt, map) {
if (data.Response.ShopListInfo instanceof Array) {
$.each(data.Response.ShopListInfo, function(i, marker) {
latitude = marker.Latitude;
longitude = marker.Longitude;
displayMarkers(latitude, longitude, marker);
});
}else{
latitude = data.Response.ShopListInfo.Latitude;
longitude = data.Response.ShopListInfo.Longitude;
displayMarkers(latitude, longitude, data.Response.ShopListInfo);
}
});
}
的問題是從起「綁定」方法不執行第二個呼叫。