'touchstart',<<<代码在这里:事件名称是正确的谷歌地图标记

时间:2013-10-02 17:30:30

标签: google-maps-markers

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;   
    }
});

1 个答案:

答案 0 :(得分:1)

不,不支持事件名称“touchstart”。您有一个可用事件列表: https://developers.google.com/maps/documentation/javascript/reference#Marker