Our web application serves up, among many other things, plain files, many of which are KML. We'd like developers to be able to load those KML files directly into their own applications via the v3 API. Unfortunately, when the JS library calls the KmlOverlayService on
maps.googleapis.com, 2 out of 3 times Google chokes and gives me a 500 response instead.
If I download the file using curl, wget, or a web browser (which always works correctly), then load it onto a really dumb Apache server (a DreamHost account, actually), and use the same maps API code except with the new URL, it always works.
The endpoint on Google's side that's returning a 500 is here:
The JS code is basically directly lifted off the example:
/* skipping boilerplate setup and options */
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
pd.setMap(map);
Here are the headers when I download the file directly from our web application (does not work very consistently):
* Trying 216.227.229.145... connected
> GET /api/file_data/kO8U6PvC3a4GV0FnVqozbV_iOMUSNxn6FCMqvMouW_U?filename=Kmlpolicedistricts.kml HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Accept: */*
>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 200 OK
< Date: Mon, 25 Jul 2011 19:14:05 GMT
< Server: Apache
< Content-disposition: inline; filename=Kmlpolicedistricts.kml
< Cache-Control: private, max-age=1209600
< Expires: Mon, 08 Aug 2011 12:14:05 -0700
< Content-Length: 1452383
< Vary: Accept-Encoding,User-Agent
< Connection: close
< Content-Type: application/xml;charset=us-ascii
<
{ [data not shown]
100 1418k 100 1418k 0 0 239k 0 0:00:05 0:00:05 --:--:-- 245k
* Closing connection #0
And here they are when I download them off my DreamHost account (works consistently):
* Trying 69.163.151.44... connected
> GET /upload/police.xml HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Accept: */*
>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 200 OK
< Date: Mon, 25 Jul 2011 19:14:55 GMT
< Server: Apache
< Last-Modified: Fri, 22 Jul 2011 18:43:13 GMT
< ETag: "a61863b-16295f-4a8acd679f240"
< Accept-Ranges: bytes
< Content-Length: 1452383
< Content-Type: application/xml
<
{ [data not shown]
100 1418k 100 1418k 0 0 1080k 0 0:00:01 0:00:01 --:--:-- 1114k* Connection #0 to host dontexplain.com left intact
* Closing connection #0
Does anybody (hopefully someone on the Google team who can look through their logs) have any idea what might be the culprit here? The 500 error has nothing very helpful attached to it.
Thanks.