Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't my KML file display on google maps?

Can anyone tell me why this kml file won't display on google maps?

Im using the following code to add it to the map object which seems to work fine with other kml files.

var kml = new google.maps.KmlLayer('http://www.emotination.com/kml/tasman.kml');
kml.setMap(map);

Feed validator says its valid and it isn't too big for googles servers to parse?

The map just zooms right into the ocean!

like image 835
kmb64 Avatar asked Feb 21 '23 11:02

kmb64


1 Answers

You need to ensure Google's servers aren't displaying a cached copy of your kml file

A good way to do this is to do what Björn suggests in his comment and just add a timestamp so the end of the url:

var kml_tasman = new google.maps.KmlLayer('http://www.emotination.com/kml/tasman.kml?time='+new Date().getTime());
kml_tasman.setMap(map);
like image 117
kmb64 Avatar answered Feb 24 '23 01:02

kmb64