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

后端 未结 1 1533
死守一世寂寞
死守一世寂寞 2021-01-29 01:57

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

相关标签:
1条回答
  • 2021-01-29 02:04

    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.

    0 讨论(0)
提交回复
热议问题