Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to host my KML file on fusion table so that I have dynamic control over my KML file and I am trying to access same as in public URI as an parameter in the Google Map Java Script .

I am getting lost on how to do it need some help on that .

share|improve this question
    
Do you mean you are trying to access the Google Fusion Table with attached KML through the Google Map JS API? –  Josh Nov 30 '12 at 7:49
    
Yeah since you cannot access KML file when its hosted locally hence I wanted to host it on fusion table and retrieve from there based on URL –  bhalkian Nov 30 '12 at 9:02
add comment

2 Answers

I have very bad experiences using dynamically generated fusion tables to display large multipolygons on Google Maps. The FusionTablesLayer just can't keep up with dynamically created fusion tables, it needs some time to cache the corresponding tiles.

I strongly advise to use the KmlLayer feature of Google Maps if you are updating/creating your KMLs frequently. If you decide using KmlLayers you have to provide a URL of your KML.

Be warned: Google expects this URL to be fetched in 2-3 seconds. In case of dynamically generated KML or large KML data you can get fetch errors.

share|improve this answer
add comment

Assuming you already have the Fusion Table setup and the KML uploaded, then you need to do the following:

  • On the Fusion Table (in Google Drive) go to the top right and click 'Share'. You need to change the access permissions (it says "Private - Only the people..." by default) to "Anyone with a link".
  • Then go to File -> About and you should see a number under Numeric Id. This is the number that the Google Maps API needs in order to pull the Fusion Table.
  • Then add this code to your Javascript to pull the Fusion Table into your document:

    ftlayer = new google.maps.FusionTablesLayer({
      query: {
        select: 'geometry', //double check this in your fusion table, it's the column with the actual locations stored in it
        from: 'xxx' //PUT YOUR NUMBER FROM ABOVE HERE
      },
    });
    ftlayer.setMap(map); //replace "map" with whatever you called your Google Map object
    
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.