我在Google地圖上遇到了偵聽器問題。Sencha觸摸Google地圖標記偵聽器不工作
var marker_icon = new google.maps.MarkerImage('images/map/' + thisIcon + '.png', new google.maps.Size(32, 32)); var trafficMarker = new google.maps.Marker({
position: new google.maps.LatLng(alert.lat, alert.lon),
map: trafficMap,
icon: marker_icon,
id: 'trafficAlertIcon' + i
});
console.log('Test Log3');
google.maps.Event.addListener(trafficMarker, 'mousedown', function()
{
console.log('touched marker');
trafficTabPanel.layout.setActiveItem(1, {type: 'slide', direction: 'left'});
LoadIncidentMap(this.id.substring(16));
});
聽衆似乎存在問題,因爲它沒有觸及console.log('touched marker');.
我試着改變監聽器到trafficMap來查看是否響應,但它沒有。我已經嘗試過,點擊,mousedown,mouseup等。
謝謝。