2011-08-05 50 views
0

我有另一個需要解決的問題,因爲它是相當刺激。我一直在做一個應用程序一段時間,我設法讓它工作得很好。sencha touch - >谷歌地圖標記不響應觸摸

具體來說,谷歌地圖功能應該有標記出現,當你點擊它們時,屏幕應該放大並顯示關於標記的一些信息。現在,我編寫了這個代碼,當您在Chrome上進行測試時,它可以很好地工作。但是當我試圖將它移植到標籤設備本身(Samsun Galaxy)時,無論什麼時候我嘗試觸摸標記都沒有任何活動。

我對此感到莫名其妙,因爲觸摸標記的動作應該與使用鼠標單擊它的動作相同,我沒有記錯嗎?我想知道是否有其他人可以給我任何幫助,因爲這是一件小事,對我造成了一個呃逆。

的代碼我已經添加下面:

var marker_icon = new google.maps.MarkerImage('images/map/' + thisIcon + '.png', new google.maps.Size(32, 32)); 

trafficMarker = new google.maps.Marker({ 
    position: new google.maps.LatLng(TrfAl.lat, TrfAl.lon), 
    animation: google.maps.Animation.DROP, 
    map: mapPanel, 
    icon: marker_icon, 
    id: 'trafficAlertPanel' + i, 
    componentId: 'trafficAlertPanel' + i, 
}); 
markerArray[i]=trafficMarker; 

google.maps.event.addListener(trafficMarker, 'click', function(){ 
    console.log('clicked!'); 
    LoadIncidentMap(this.id.substring(17)); 
}); 

回答

0

出於某種原因,點擊事件不火的Android和iOS的水龍頭。一種解決方法是使用'mousedown'事件,而這會在點擊時觸發。

google.maps.event.addListener(trafficMarker, 'mousedown', function(){ 
    console.log('clicked!'); 
    LoadIncidentMap(this.id.substring(17)); 
});