How do I make this script fire when I click a Fusion Tables layer?

六月ゝ 毕业季﹏ 提交于 2019-12-25 18:23:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!