How to map a specific Google Fusion Table Map?

纵然是瞬间 提交于 2019-12-12 03:04:41

问题


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

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