Here are our server logs for a single KML layer request
74.125.52.80 - - [22/Nov/2011:13:43:51 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.90 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.94 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.88 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.94 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.93 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.92 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.91 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.89 - - [22/Nov/2011:13:43:52 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.85 - - [22/Nov/2011:13:43:53 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.80 - - [22/Nov/2011:13:43:54 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.87 - - [22/Nov/2011:13:43:55 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.87 - - [22/Nov/2011:13:43:55 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.95 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.92 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:55 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.88 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.86 - - [22/Nov/2011:13:43:54 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.94 - - [22/Nov/2011:13:44:00 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.90 - - [22/Nov/2011:13:43:59 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.85 - - [22/Nov/2011:13:44:00 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.92 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.91 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.85 - - [22/Nov/2011:13:44:00 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.89 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.91 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.93 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.85 - - [22/Nov/2011:13:43:59 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.91 - - [22/Nov/2011:13:43:57 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.82 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.92 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.80 - - [22/Nov/2011:13:43:59 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.81 - - [22/Nov/2011:13:43:59 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.84 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.81 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.88 - - [22/Nov/2011:13:44:00 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.81 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.88 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.81 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.89 - - [22/Nov/2011:13:43:55 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.87 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.87 - - [22/Nov/2011:13:43:56 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.83 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.126.85 - - [22/Nov/2011:13:44:00 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
74.125.52.89 - - [22/Nov/2011:13:43:58 -0800] "GET /
lmi_country_polygons/CA.kml HTTP/1.1" 200 45221 "-" "Kml-Google;
(+http://code.google.com/apis/kml), gzip"
Is there something wrong with how our server is delivering the kml
data? I'm pretty sure our headers are ok. The oddest thing is that
this was working about a month ago, without a hitch.
I have KML layers hosted at
http://www.3d-profile.com/lmi_country_polygons/<ISO 3166-1 2-Alpha
Country Code>.kml
Examples
http://www.3d-profile.com/lmi_country_polygons/US.kml
http://www.3d-profile.com/lmi_country_polygons/CL.kml
The javascript we're using is pretty basic stuff:
<script>
var MapTest = {};
MapTest.map = null;
MapTest.kmlLayer = null;
MapTest.init = function(){
var latlng = new google.maps.LatLng(0,-40);
var myOptions = {
zoom: 1,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
MapTest.map = new
google.maps.Map(document.getElementById('mapCanvas'),myOptions);
}
$(document).ready(function(){
$("#countrySelect").change(function(event){
var value = $(this).val();
if(value!=""){
if(MapTest.kmlLayer){
MapTest.kmlLayer.setMap(null);
}
MapTest.kmlLayer = new
google.maps.KmlLayer('http://www.3d-profile.com/
lmi_country_polygons/'+value+'.kml');
MapTest.kmlLayer.setMap(MapTest.map);
}
});
MapTest.init();
});
</script>
Does your KML validate?
Is it close to the max file size Google allows?
Does it work better if you compress it to a KMZ?
Are you using network links in your KML?
The KML files are no where near the max size, the largest being
287kilobytes I believe (Canada)
There are no network links my KML
I'll KMZ compressing these, but I'm more concerned about the number of
requests I'm getting from Google for the resource, is this normal?
On Nov 24, 1:35 pm, Joseph Elfelt <josephelf...@gmail.com> wrote:
> That's odd. I see different parts of your KML depending how I zoom
> and pan the map:http://www.mappingsupport.com/p/gmap4.php?q=http://www.3d-profile.com...
Is Google still pinging your server big time?
Thanks,
Arthur.
I've experienced the same problem. A flood of requests by the maps api when loading a kmz file, 10-30 requests by different google servers. I have 1-2MB kmz files and my bandwith was frequently over quota.My application is on Google App Engine / python and the kmz files are stored in the Blobstore.After refactoring all my javascript and the blobstore code I solved the issue by changing the way I included the maps api.from:<script src="//maps.googleapis.com/maps/api/js?sensor=false"></script>to:<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>I guess not using the protocol confused the google maps cache.I also added caching headers when serving the files from the blobstore.expires_date = datetime.datetime.utcnow() + datetime.timedelta(1)
expires_str = expires_date.strftime("%d %b %Y %H:%M:%S GMT")
self.response.headers['Expires'] = expires_str
self.response.headers['Content-Type'] = 'application/vnd.google-earth.kmz'
self.response.headers['Cache-Control'] = 'public, max-age=80000'I hope this helps.
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Disposition: attachment; filename="lbls.kmz" Content-Type: application/vnd.google-earth.kmz Transfer-Encoding: chunked Date: Mon, 21 Jan 2013 20:42:39 GMT