Why is KML not loading in Google Maps?

前端 未结 2 1584
太阳男子
太阳男子 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 21:59

    Google Map needs to be able to access this KML file direclty, in other words, your KML file must be publicly available, and must end with .kml or .kmz extensions (I believe).

    To make sure the KML file itself is correct, you can always go to maps.google.com and put the URL in the search bar, it should be automatically recognized and rendered.

提交回复
热议问题