Google Fusion Tables With Maps - Link Table field to Map Info Window

一个人想着一个人 提交于 2019-12-04 06:29:00

问题


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!


回答1:


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);

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



来源:https://stackoverflow.com/questions/11748211/google-fusion-tables-with-maps-link-table-field-to-map-info-window

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