我正在尝试在Google地图上创建斯德哥尔摩地铁的地图。 我在蓝线http://tourist-sweden.se/transport/map/sthlm/t-11-bana.kml创建了一个KML文件 我用这个JavaScript代码调用这个文件:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Map of Stockholm's subway: line Nr.T-11 "Akalla - Kungsträdgården"</title>
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
var subwayblue = new google.maps.LatLng(18.032405,59.334372);
var mapOptions = {
zoom: 10,
center: subwayblue,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var ctaLayer = new google.maps.KmlLayer({
url: 'http://tourist-sweden.se/transport/map/sthlm/t-11-bana.kml'
});
ctaLayer.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
但没有显示站之间的路径。我的错是什么?
答案 0 :(得分:0)