带有地图的Google Fusion Tables-“链接表"字段到“地图信息"窗口 [英] Google Fusion Tables With Maps - Link Table field to Map Info Window

查看:76
本文介绍了带有地图的Google Fusion Tables-“链接表"字段到“地图信息"窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用Google Fusion Tables/maps的新手.我们有一个包含公司名称和地址的公司目录.我可以获取每个位置的经过地理编码的地图标记,以与表格设施名称"列并排显示.如何编码设施名称,以便用户可以单击公司/设施名称并跳至地图中该设施的特定地图标记信息框?任何帮助将不胜感激!

I'm pretty much a rookie to using Google Fusion Tables/maps. We have a business directory with company names and addresses. I can get the geocoded map markers for each of their locations to display side by side with the Table "facility name" column. How do I code the facility names so the user can click the company/facility name and jump to the specific map marker info box for that facility in the map? Any help will be appreciated!

推荐答案

用户点击公司名称后,您可以创建一个新的

Once the user clicks on the company name, you can create a new InfoWindow object manually. Then set it's position and content and finally put it on the map:

 var map = new google.maps.Map(document.getElementById('map-canvas');
 var infoWindow = new google.maps.InfoWindow();
 var coordinates = new google.maps.LatLng(37.5, -122.1);
 infoWindow.setPosition(coordinates);
 infoWindow.setContent('Company/Facility XY');
 infoWindow.open(map);

Google提供了一个 InfoWindow示例,该示例甚至使用了地理编码和空间查询以从数据库中获取最接近的匹配项.

There is an InfoWindow example from Google, that even uses geocoding and a spatial query to get the closest hit from the database.

这篇关于带有地图的Google Fusion Tables-“链接表"字段到“地图信息"窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆