issues with KML link to Google Maps API

谁说我不能喝 提交于 2019-12-11 17:41:17

问题


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!


回答1:


your KML file is too big, see the KML reference for size and complexity limitations:

feedvalidator

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

example



来源:https://stackoverflow.com/questions/24561979/issues-with-kml-link-to-google-maps-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!