0

谷歌地图触摸初始化标记、显示标题或描述的事件名称是什么?google.maps.event.addListener(marker, 'touchstart', <<< code here: is event name correct? 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;   
    }
});
4

1 回答 1

1

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

于 2014-01-15T08:07:17.467 回答