Loading a local .kml file using google maps?

前端 未结 4 2049
时光取名叫无心
时光取名叫无心 2020-12-04 11:27

I created a hello world program to load a local kml file (borrowed from google\'s docs):

var ctaLayer = new google.maps.KmlLayer(\"http://localhost:8080/kml/         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 12:01

    This website, display-kml.appspot.com, requires that you copy/paste the entire KML file into the website. Alternatively, you can use Dropbox to host the KML file using your public folder. Within the public Dropbox folder, there is a right-click context menu that allows you to copy the URL.

    Update:

    The appspot website has a history of being unstable. As of January 2019, the website appears to be working.

    REFERENCES:
    1. http://display-kml.appspot.com/
    2. https://www.dropbox.com/

提交回复
热议问题