不显示KML中的路径 [英] Not showing the path in KML
本文介绍了不显示KML中的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Google地图上创建斯德哥尔摩地铁的地图. 我已将KML文件创建为蓝线 http://tourist -sweden.se/transport/map/sthlm/t-11-bana.kml 我使用以下JavaScript代码将此文件称为:
I'm trying to create a map of Stockholm subway on Google maps. I have created a KML file to the blue line http://tourist-sweden.se/transport/map/sthlm/t-11-bana.kml I call this file with this JavaScript code:
<!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>
但未显示站点之间的路径.我怎么了?
But not showing the path between the stations. What is my fault?
推荐答案
您的折线没有有效的颜色:
Your polyline doesn't have a valid color:
这篇关于不显示KML中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文