我在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等。
谢谢。