问题
I am calling a FusionTableMapLayer via the Fusion Table API. I have developed a customized info window for the layer in the actual Google Fusion Table program but when I call the layer in my application, the Info Window reverts to the default Info Window. How do I either a) call the customized Info Window that is saved in the Google Fusion Table or b) customize the Info Window as part of my API call?
回答1:
Use the code exported from the wizard (or at least the styleId and templateId from it)
new google.maps.FusionTablesLayer({
query: {
select: "geometry",
from: "1EPhndJHBm0ghi06Xq9d8P62hUwCisAcQxYxgH5ax",
},
map: map,
options: {
styleId: 2, // get these values from the proper tab on the FusionTables UI
templateId: 2 // get these values from the proper tab on the FusionTables UI
}
});
来源:https://stackoverflow.com/questions/37011454/customizing-info-window-in-fusiontablemaplayer