Why is KML not loading in Google Maps?

前端 未结 2 1581
太阳男子
太阳男子 2021-01-21 21:52

I have a KML file that I am trying to load into Google maps. It zooms somewhere in the water with no route trace. This is the code I am trying:

    var kmlLayer          


        
2条回答
  •  不思量自难忘°
    2021-01-21 22:02

    As Bill says, the KML file needs to be publicly downloadable, however The URL you linked to in the question abov does not link directly to the file itself, it links to an HTML page that you can visit to download the file. You may have to try a different service, as it doesn't appear that you can download directly from that location without going through the intermediate page.

    You will know you are using the right link when you paste the link into the browser, and it immediately prompts you to download the file.

    If you still have problems, make sure to post more of your code.

提交回复
热议问题