google地图触摸初始化标记,显示标题或说明的事件名称是什么? google.maps.event.addListener(marker,'touchstart',<<< code here:事件名称是否正确? var marker = new google.maps.Marker(markerOptions);
var infoWindowOptions = {
content: content,
position: latlong
};
var infoWindow = new google.maps.InfoWindow(infoWindowOptions);
google.maps.event.addListener(marker, 'touchstart', function(event) {
event.stopPropagation(); // 'click touchstart'['click',]
event.preventDefault();
if(event.handled !== true) {
// Do your magic
infoWindow.open(map);
event.handled = true;
}
});
答案 0 :(得分:1)
不,不支持事件名称“touchstart”。您有一个可用事件列表: https://developers.google.com/maps/documentation/javascript/reference#Marker