问题描述
Google Fusion Tables的新外观可让您创建多个地图标签(以及其他类似图表和摘要)。我的问题是:您如何使用Google地图API调用您创建的特定地图选项卡?例如,您可能会使用以下网址设计的地图标签:
融合表ID为1InbiFbInR8OGcMgOngf3j2Bb2FTpEkZQuT1hNMo,地图id = 4。因此,在Google Maps API中,您可以将此表分层显示为:
crime = new google.maps.FusionTablesLayer({
query:{
select:'Address',
from:'1InbiFbInR8OGcMgOngf3j2Bb2FTpEkZQuT1hNMo'
},
});
crime.setMap(map);
但这不适用于您在地图选项卡上可能完成的任何样式或infowindows。如何告知Google Maps API抓取特定的地图标签?
仅供参考,切换到经典视图让我们将单一地图样式应用于融合表通过上面的代码申请。
谢谢! 您需要应用视图的 styleId
和 templateId
。
单击特定的选项卡 - >发布 - >获取HTML和Javascript,您将获得所需的内容。
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!
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.
这篇关于如何映射特定Google Fusion桌面地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!