问题
I have a Fusion Table layer on my map. I want to make it so that when I click on the Fusion Table layer, this script fires.
My code so far:
gmap = new google.maps.Map(document.getElementById("map-canvas"));
google.maps.event.addListener(gmap,'click',function(e){
console.log(e);
}); // DONE: google.maps.event.addListener
When I click a part of the map that has no Fusion Table layer on it, the script fires. But if I click a part of the Fusion Table layer, it doesn't.
What do I do?
回答1:
You must either set the clickable
-option of the FusionTablesLayer to false
or also observe the click
-event of the FusionTablesLayer
来源:https://stackoverflow.com/questions/25626857/how-do-i-make-this-script-fire-when-i-click-a-fusion-tables-layer