Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to kml/kmz files on Google Drive

I've saved kml and kmz files in a file cabinet in the old Google Sites. I copy the permalink to these files and paste it into the search box on Google Maps to overlay the placemarks.

I've saved a test kml file in a folder on the new Google Drive, but I can't figure out how to get a permalink that I can paste in Google Maps. I found this link https://webapps.stackexchange.com/questions/26371/how-do-i-share-a-permalink-from-google-drive and used it to create this permalink https://docs.google.com/file/d/0B9sBXp66G86xWmlRbkZiYlRNdmc/edit?usp=sharing but Google Maps does not recognize it as a valid kml file. Do I need to change the URL?

Thanks.

like image 959
Krago Avatar asked Apr 10 '13 14:04

Krago


People also ask

How do you overlay a KML or KMZ file in the Google Earth?

To add an overlay, either import a KML or KMZ file from your local directory, or select a file from Google Drive. Earth Studio supports multiple overlays in a project at a time. Click the overflow menu for the KML item and select Delete to remove an added overlay from your project.

Does Google Earth use KML or KMZ?

KML and KMZ files The default file type for spatial data in Google Earth is KML (Keyhole Markup Language) or KMZ (a compressed or "zipped" KML file).


2 Answers

  1. Set your root folder to share in the public. Right click on the folder > Share > Public on the web
  2. Upload .html file in the directory > Open it > Preview
  3. That's the url of your html, and you can find out the path to the kmz file that you want.

For example, here is my html file

https://googledrive.com/host/0B1YPetHU8aMQMmtrcFB4eTMzd1E/kml_overlay.html

My KMZ file url would be

https://googledrive.com/host/0B1YPetHU8aMQMmtrcFB4eTMzd1E/kmz/river.kmz

If you would like to see the list of files, access the root level.

like image 174
Kiichi Avatar answered Sep 22 '22 22:09

Kiichi


  1. First check if is KML file valid for Google maps API (try it open e.g. at web version of google drive - if is valid web browser shows google map with kml layer).

  2. Stored file address must have this form: https://docs.google.com/host............ (You can find the link at web version of google drive at file details/hosting) Link, that have form: https://drive.google.com/file...... will not work. (You can find the link at web version of google drive at file sharing

OR shortly sayed. Link must have file name at the end!!

  1. Working example can be downloeded from: developers.google.com/maps/documentation/javascript/examples/layer-kml
like image 34
Dolik Avatar answered Sep 22 '22 22:09

Dolik