2

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 .

asked Nov 30, 2012 at 5:36
2
  • Do you mean you are trying to access the Google Fusion Table with attached KML through the Google Map JS API? Commented Nov 30, 2012 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 Commented Nov 30, 2012 at 9:02

2 Answers 2

1

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.

answered Dec 11, 2012 at 14:33
0

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
    
answered Nov 30, 2012 at 9:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.