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.

How can I get a KML/KMZ file to display on Google Maps without a public facing web server?

share|improve this question
    
The ironic thing about your question is that you are connected to the Internet. How do you get Google Maps? –  CrazyEnigma Jul 24 '10 at 2:31
    
by "without a public facing server" do you mean the kml has to be on the local machine, or that you don't want to have to bother with installing/configuring/buying a public website? And, does the custom map you want to make need to be seen by others or just you? –  matt wilkie Jul 24 '10 at 6:46
    
THe situation is "I can get to the internet, but the internet can't get to me." In that case, you can't use the KML-file support in the Google Maps API. –  Christopher Schmidt Jul 24 '10 at 20:22
    
display-kml.appspot.com is another option I suppose . –  Karl Henselin Sep 29 '13 at 21:58

5 Answers 5

up vote 20 down vote accepted

I noticed you haven't marked this question as answered yet, so I thought I'd add a bit to what Jason Birch said (which I believe is the best answer on here so far).

To open a KML or KMZ file in Google Maps, I append the following prefix to an online link of the KML file: http://maps.google.com/maps?q=

Typically, I put the KML or KMZ in my dropbox, and then copy/paste the pulic link to the end of the above snippet. Then I can email that link to whom ever wants it, or I post it online somewhere. I've also used Google Docs to store the KML's, and a Links page on my website to distribute the links.

Example:

Harvey Mountain Hike: http://maps.google.com/maps?q=http://dl.dropbox.com/u/359140/KML/HarveyMountainHike.kmz

share|improve this answer
    
Nice idea to combine Google Maps with DropBox! –  fmark Aug 15 '10 at 2:46
    
Technically, are you supposed to URL-encode the Dropbox URL when passing it as a parameter? –  LarsH Jul 15 at 13:48
    
This approach doesn't appear to work any more. Upon clicking the above link, I just get google maps with your dropbox link in the search box. –  Derek Greer Sep 30 at 14:51

Is this for something that you want to have permanently available to others, or just for temporary viewing?

One of the tricks that I use quite often is to place the KML file in my public DropBox folder (find someone with an account to refer you; it will get both you and them an extra 250Mb) and then paste that url into Google Maps to visualize and share with others short-term.

In the longer term, you do have the option of creating a new Google "My Maps" map, and importing KML, KMZ or GeoRSS into that. Once done, you can share the resultant map using the standard My Maps tools.

You can also use Google Docs to store and share KML files with others. My recommended technique is to:

  1. Create a folder and mark it for public access.
  2. Use the Upload link to upload your KML files into this folder without conversion and shared with the world
  3. Go to the Download link, copy it, and paste it into the Google Maps search box

I wonder how long before Google allows interactive collaborative editing of KML documents via Google Docs? Now that would be cool...

share|improve this answer

You can upload a KML file to Google Maps:

  1. Log in to your Google Account, and go to http://maps.google.com
  2. Click on My Maps
  3. Click Create a new map
  4. Add a title and description
  5. Click Import
  6. Click Choose file, select the KML to upload, and then click Upload from file

My Maps

Create a new map

Import

Upload

Now you're done :)

share|improve this answer
    
Interesting, this is the answer that most directly addresses the question. –  Mark Bostleman Aug 5 at 16:11

The short answer is: you can't. Using a local file with the plain old Google Maps web application would violate the browser's sandboxing and same origin policy.

One option, however costly, is that you may be able to use Google Maps Premier to host the maps-x.js on your local filesystem along with the associated KML.

Another option is to use an existing public facing web server, like Google Sites.

Also, keep in mind that you may be able to use OpenLayers as an alternative to Google Maps Premier.

share|improve this answer
2  
OpenLayers will be limited (in modern browsers) to non-file URLs, at least in Firefox, but you can set up a local/non-public webserver and use that. Note that the "Sandboxing" isn't really the reason that you can't do what you want with Google: If an HTML page is hosted on your local server, the JS should be able to read a file from the local server. You only can't because Google parses all files on the server side -- so their server needs to talk to your server, which it can't. –  Christopher Schmidt Jul 23 '10 at 17:15
    
Ah, good point. I was thinking along the lines of a file on the local filesystem rather than a local httpd. –  Jon Bringhurst Jul 23 '10 at 17:19

https://support.google.com/mapsengine/answer/3024836

Click Import. You can import CSV, TSV, or XLSX files, My Maps, or spreadsheets from Google Drive. KML import is not currently supported.

share|improve this answer

protected by whuber Mar 4 at 15:27

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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