【问题标题】:kmlLayer not displaying google maps apikmlLayer 不显示谷歌地图 api
【发布时间】:2013-07-21 17:59:12
【问题描述】:
第一次在 StackOverflow 上发帖,所以告诉我,如果我做错了什么,请保持粗鲁。我最近使用 maps.google.com 创建了一个 KML 文件,并将 kml 上传到我的网站,我正在尝试实施我们创建的谷歌地图,但我很困惑,因为我没有错误,但它没有显示在全部。
// North Campus SHuttle KML implementation
var redShuttle = new google.maps.KmlLayer (
'http://blazelist.org/maps/test/RedShuttle.kml'
);
redShuttle.setMap(map);
【问题讨论】:
标签:
google-maps
google-maps-api-3
kml
【解决方案1】:
你能分享更多代码吗?
在我的示例中,您的代码正在运行:
function initialize()
{
var map = new google.maps.Map(document.getElementById("map"),
{
center: new google.maps.LatLng(22.7964,73.8456),
mapTypeId: google.maps.MapTypeId.TERRAIN
});
/* var kmlLayer = new google.maps.KmlLayer('http://blazelist.org/maps/test/RedShuttle.kml',
{
suppressInfoWindows: true,
map: map
});
*/
var redShuttle = new google.maps.KmlLayer ( 'http://blazelist.org/maps/test/RedShuttle.kml' ); redShuttle.setMap(map);
}
http://jsfiddle.net/iambnz/WbzpS/
【讨论】:
-
link 这是我的地图 html 文件的链接(抱歉我没有编程背景)。