问题
The "new" look for Google Fusion Tables allows you to create multiple "map" tabs (and others like "charts" and "summary"). My question is: how do you use Google Maps API to call a specific map tab you have created? For example, you may have a map tab you have designed with the following URL:
https://www.google.com/fusiontables/data?docid=1InbiFbInR8OGcMgOngf3j2Bb2FTpEkZQuT1hNMo#map:id=4
The fusion table id is 1InbiFbInR8OGcMgOngf3j2Bb2FTpEkZQuT1hNMo, and the map:id = 4. So in Google Maps API, you can layer this table as:
crime = new google.maps.FusionTablesLayer({
query: {
select: 'Address',
from: '1InbiFbInR8OGcMgOngf3j2Bb2FTpEkZQuT1hNMo'
},
});
crime.setMap(map);
But this will not apply any of the stylings or infowindows you may have done on your map tab. How do I tell Google Maps API to grab a specific map tab?
FYI, switching to "classic" view let's me apply a single map style to the fusion table that DOES get applied by the code above.
Thanks!
回答1:
You need to apply the styleId
and templateId
of the view.
Click the particular tab->publish->get HTML and Javascript and you will get what you need.
来源:https://stackoverflow.com/questions/16094213/how-to-map-a-specific-google-fusion-table-map