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://

2 Likes

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 :blush:

@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 :upside_down_face:

@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

1 Like

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

image.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.