Reputation: 486
I have a very simple NetworkLink kml (below) file that has a href tag to an .aspx file that generates dynamic placemarks (with <Placemark id="1">
, <name>
, <description>
, <Point>
, <coordinates>
as tags). The NetworkLink kml file works in Google earth but not on Google maps (the browser map is just a bare map without any placemarks) and I’m at a loss as to why.
NetworkLink kml file:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<NetworkLink>
<name>Ticket Map Add-In</name>
<Link>
<href>http://66.230.78.217/getKML.aspx</href>
</Link>
</NetworkLink>
</kml>
.js that actually shows (or should show but doesn’t) the placemarks on the map:
window.onload = function () {
initialize();
}
var map;
var infowindow;
var service;
var request;
function initialize() {
geocoder = new google.maps.Geocoder();
var startLatLng = new google.maps.LatLng(41.82177, -72.50722);
map = new google.maps.Map(document.getElementById('map_canvas'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: startLatLng,
zoom: 5
});
infowindow = new google.maps.InfoWindow();
var ctaLayer = new google.maps.KmlLayer('http://66.230.78.217/netLink.kml');
ctaLayer.setMap(map);
}
Any explanation of a reason why would be greatly appreciated
Link to the page that does not work: http://66.230.78.217/ResultsGeneral.aspx
*Update*
I'm begining to think that its a problem with the NetworkLink file. I can't load any file (kml or aspx) using <NetworkLink><Link><href>
... but I can load the same kml file directly in the javascript.
Upvotes: 1
Views: 1973
Reputation: 4779
Probably it is because your server is taking too long to create the KML. You can test this theory by saving a static version of your KML on your server and having the NetworkLink call that instead.
Additionally you should set the MIME type for your KML appropriately, as noted in http://code.google.com/apis/kml/documentation/kml_tut.html#kml_server
Upvotes: 1