KML链接到Google地图API的问题 [英] issues with KML link to Google Maps API
问题描述
我正在尝试将一个live kml文件上传到google maps api的问题。我有一个live网站,我上传了kml文件,但是当我在调用函数中使用url时,它不会显示在google maps api中。这是一个公共的kml文件....我试图使用谷歌地图api的网站是不活的,现在就跑掉我的桌面。
对我在做什么错的任何想法?该网站的kml链接是: http://www.gsphotoalchemy.com/170113.kml p>
var ctaLayer = new google.maps.KmlLayer({
url:'http://www.gsphotoalchemy.com/ 170113.kml'
});
ctaLayer.setMap(map);
$ b $ p
$ b 如果需要,我可以发布完整的html代码, p>
解决方案您的KML文件太大,请参阅 KML参考资料了解大小和复杂性限制:
如果你这样做类似于你的代码来检查KmlLayer的状态:
google.maps.event.addListener(kmlLayer,status_changed ),function(){
document.getElementById('kmlstatus')。innerHTML =Kml Status:+ kmlLayer.getStatus();
});
您将得到:
Kml状态:DOCUMENT_TOO_LARGE
I'm trying to resolve an issue with uploading a live kml file to the google maps api. I have a live website that I uploaded the kml file to, but when I use the url within the call function it doesn't show up in the google maps api. It's a public kml file....the website that I'm trying to use the google maps api is not live, just run off my desktop at the moment.
any thoughts on what I'm doing wrong? The website kml link is: http://www.gsphotoalchemy.com/170113.kml
var ctaLayer = new google.maps.KmlLayer({
url: 'http://www.gsphotoalchemy.com/170113.kml'
});
ctaLayer.setMap(map);
}
I can post the full html code if needed, thanks in advance!
解决方案 your KML file is too big, see the KML reference for size and complexity limitations:
If you do something like this in your code to check the status of the KmlLayer:
google.maps.event.addListener(kmlLayer, "status_changed", function() {
document.getElementById('kmlstatus').innerHTML = "Kml Status:"+kmlLayer.getStatus();
});
you will get:
Kml Status:DOCUMENT_TOO_LARGE
这篇关于KML链接到Google地图API的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!