Open Google Earth and load specific KML file when user clicks link on web page

前端 未结 1 1844
不知归路
不知归路 2021-01-24 05:55

I\'m currently working on a site which displays map data in Google Maps, but also has a link to display it in Google Earth.

To get view this data in Google Earth, a user

相关标签:
1条回答
  • 2021-01-24 06:38

    No, you can't force the users machine to launch an application like that. However, a user can set this up themselves if they wish in certain operating systems with certain browsers.

    For example, in Windows I have Google Earth associated with the kml and kmz file extensions. I browse using Google Chrome. When I click a link to a kml/kmz file it is downloaded as per normal. In the download bar I can then choose to "Always open files of this type". Thus, when ever I click a link to a kml/kmz file it is automatically opened in Google Earth.

    If a site could 'force' this behaviour not only would it be immensely annoying it would also be a massive security risk.

    Also, why not just use the web based version of Google Earth? It is pretty simple to intergate it directly using the Google Maps Api.

    i.e:

    http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/index.html

    http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/beefy.html

    0 讨论(0)
提交回复
热议问题