Host KML files on Google Drive

If you want to use a KML map layer as described here you can host the kml file on Google Drive.

Just right-click on it and choose SHARE. Then click on ADVANCED and copy the link.

Paste this link here to get the Export Link:
http://kolorobot.github.io/permalink/

Copy this Export Link and paste it in your column definition under โ€œOptional Url for KML Fileโ€.

The kml file does not to be public. It can be private.

One thing I noticed: It will not work with https:// but only with http://

5 28 10.3K
28 REPLIES 28

But here is a question:
I created the kml file with Google My Maps. I can download the kml file. But there is another option:
"Keep data up to date with network link KML (only usable online)
Can we use this, so the map will stay updated? When I change the map in My Maps, it would change it also in my AppSheet App.

When you download this kind of kml and open it with a text editor, you can copy the URL like:
http://www.google.com/maps/d/u/0/kml?forcekml=1&mid=XXXXXX&lid=XXXXX
You can paste this URL in your column definition under โ€œOptional Url for KML Fileโ€.
But it seems not to stay updated when you change the map in My Maps.

@Peter Any input?

@Fabian I donโ€™t believe thereโ€™s a way to support networked KML files at the moment due to the way app data is cached/synced, but itโ€™s something being considered. Will definitely update this thread if this changes.

Thank you @Peter

@Fabian - I was really hopeful when I saw your post. I had found a solution at that time but did not expect it to last. It seems today was the day my โ€˜work-aroundโ€™ quit working and wouldnโ€™t you know, I cannot get your suggestion to work either.
What Iโ€™ve tried:

  • Upload a KML to google drive

  • Right click the file and select share

  • In the dialog that appears, click โ€˜advancedโ€™ in the lower left corner

  • In the next dialog, change โ€˜Who has accessโ€™ to โ€˜Anyone who has the link can viewโ€™

  • Copy the corresponding link and head over to Permalinks for G Drive

  • Add that link to a LatLong field in my app andโ€ฆ nothing

The map is not displayed in the app. It is the same KML that was previously working when hosted on a different source

Any ideas would be appreciated. Any other options for hosting the KML would be appreciated as well.

Hi @Michael
I too have problems understanding when KMLs are displayed or not.
I saw that sometimes the URL has to start with https:// and sometimes with http://
So please try playing around with this.
Also I saw that the kml should be public. Maybe even for the web. Itโ€™s hard to say. Because if you do it public and then turn it to private, it will still be visible in the App. One day later it might be invisible. So it seems to have a delay.
Iโ€™m confused

@Fabian @Michael this is helpful feedback - Iโ€™m seeing some of the same inconsistencies at my end, weโ€™ll work on clarifying some of the setup requirements and try to update when possible.

Hi Peter,

Yes I too have similar issues. It would be great to have a simple example. It is not clear if one must use a link to any google or dropbox file or whether such link must be to the file itself ie โ€ฆname.kml

Generally the examples you have used appear to to us an indirect http or https link and one suggests a direct link terminating with the actual kml file name.

I also have the same issue when trying to do same but with an IMAGE so it appears a more clear and consistent approach is required and simple examples provided.

@Gregory_Diana For now the best practice is to link directly to the file itself, kml file extension should be included.

Thanks but would you be so kind as to provide a short example of such a link for both google drive and dropbox

Ah, sorry about that @Gregory_Diana - Iโ€™d check out this post for more details, including examples of the link structure: KML Map Layer

Dear Peter,

In your example you use TYPE LatLong which also works for me.

If I use same example but change TYPE to XY it gives an error

2X_8_8a849917ca558ba09645d410ea5825326604754a.png

So it appears to be a bug in XY as what works with LatLong does not work with XY even though URL is identical.

Hi Peter,

I also note that if one uses TYPE XY that for some reason, when one uses a URL for kml,one is unable to set an Initial Value as the expression assistant will not allow any entry?

If you remove url then editing Initial Value is possible.

So there appears to be a definite bug somewhere when using TYPE XY but TYPE Latong appears to be ok as per your example.

Hi Peter,

Please note that I am using a virtual column whereas you are using a Table column.

Any update with this? Iโ€™m having the same issues.

@Fabian @Peter

Iโ€™m confused with the instructions above. If the export link (kolorobโ€ฆ) gets pasted into the column definition for the KML url - then where does the google drive share link go?

Paste โ€œhttps://docs.google.com/uc?id=YOUR_FILE_ID&export=kmlโ€ without the quotes into the โ€œOptional Url for KML Fileโ€ field.


Replace โ€œYOUR_FILE_IDโ€ with the Google Drive file id for the kml file (The string of numbers and letters in between " d/ " and " /view ") from the Google Drive โ€œLink to shareโ€.

@Jeff_Partain thank you for your sharing. I am trying use your link and I succeeded in inserting a KML file into my map but there was a drop pin that automatically appeared on each polygon on the map (disrupting the display). how to get rid of the pin drop? thank you

@Prasetyo_Mimboro were you able to remove the drop pins?

not yetโ€ฆsorry, i donโ€™t know how to remove it

Would you be able/willing to share your kml with me to troubleshoot?

Hey guys, i want to share my findings in order to get the link for your KML.
I have created my KML in Google My Maps, then i downloaded it to my computer.
Check the URL in the download history of your web browser.
Then you place this URL in the LatLong column field for Optional KML.

I found it in this stackoverflow:

@tcanelli @Jeff_Partain @Prasetyo_Mimboro

This is coolโ€ฆ
@Fabian do you think you could use integromat to construct a KML for XY?

Thank you @Thiago_Calcagniti for posting this.

@Grant_Stead what do you mean? Extracting XY coordinates from an image and then draw a kml polygone?
Even if this would be possible, you still would have to insert the KML-URL into your App under โ€œOptional Url for KML Fileโ€

BTW - there is already a KML Builder

JessyJ
New Member

Hi! I advise you to buy hosting that is publicly visible and server the KML from there. And use a fusion table instead. In addition, you can try a bare metal server, where the operating system is installed on the server, eliminating layers and providing better performance. You can run dedicated servers in your own data center or hosting center, or rent them with a monthly subscription from a managed service provider.Then everything will be stable and work well. So everything else depends on you and your ability to install the server.

Here is another easy workaround. No need to spend money

tks alot it working

it worked for me as well! Thanks a lot!

Top Labels in this Space