5

I have a KML file on a public URL like http://host.com/dir/file.kml

If I put that KML file on another server, and put the new URL in the search box on Google Maps, it loads the KML into google maps.

If I put the above URL into google maps like so: http://maps.google.com/maps?q=http://host.com/dir/file.kml

It does not load, and I get the following message:

File not found at http://host.com/dir/f.... Suggestions: Make sure the URL is spelled correctly. Make sure the file exists. 

Therefore, I assume this is a configuration issue on the server. They are not being very helpful with debugging/configuring. Can anyone here offer advice on how to fix this?

2
  • Hi I'm in same problem now, refer to code.google.com/apis/kml/documentation/mapsSupport.html , on size and restriction KML, they said that kml's should not bigger than 10MB and maximum fetched size of raw kml is 3MB :( My file is bigger than allowable size, I think it have to splitted :D Commented Oct 20, 2011 at 6:34
  • Try KMZ which is smaller. Commented Oct 20, 2011 at 13:56

3 Answers 3

5

Important note on using KML & KMZ on your hosted server

Windows:

Set the MIME on the server for accessing kml/kmz for Google Earth, Google Maps & Google Maps API reads KML and KMZ files. The standard MIME type for KML files is

* application/vnd.google-earth.kml+xml 

The standard MIME type for KMZ files is

* application/vnd.google-earth.kmz 

For Apache, add these lines to the httpd.conf file or a .htaccess file in the same folder (if your host only allows htaccess rather than httpd.conf access):

* AddType application/vnd.google-earth.kml+xml .kml * AddType application/vnd.google-earth.kmz .kmz 

For Linux:

* AddType application/vnd.google-earth.kml+xml .kml * AddType application/vnd.google-earth.kmz .kmz Application: opt/google-earth/googleearth 

I posted this here back in 2007 http://groups.google.com/group/google-maps-api/web/more-info-kml-on-google-maps

2

According to http://groups.google.com/group/Google-Maps-API/browse_thread/thread/3a9ece02830693ea/df4db2d551c2753f, you have to add this to htaccess file:

<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> 
1
  • I don't know if that is the solution or not. I tried it myself in a local .htaccess and it did not have an effect. The host has now done something (unknown to me) and it now works... Commented Sep 19, 2010 at 18:46
0

Other issue you can have is if your KML file is too large for google maps. Tells you file can't be found, but it takes a bit longer than a straight URL error.

Also, if you are on something that doesn't want to serve .kml or .kmz properly, you can use .xml or .zip and it seems to work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.