I do this tutorial. I copied the source code from here. I use the similar .kml file too!
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
var chicago = new google.maps.LatLng(41.875696, -87.624207);
var mapOptions = {
zoom: 11,
center: chicago,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var ctaLayer = new google.maps.KmlLayer({
url: 'https://de-ik-kml.googlecode.com/svn/trunk/cta.kml'
});
ctaLayer.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
But when I would like to use my url, the google maps doesn't load or view the .kml file. I don't understand why don't.
The Developer tool of Chrome doesn't show any errors. So I can't debug what is the problem. I don't find.
I tried that I replace the 'https
' to 'http
', but this isn't solve my problem.
I just changed only the url
javascript variable's value in my code.