【发布时间】:2014-10-07 19:42:29
【问题描述】:
首先,我要感谢您为回答所做的努力。
其次,我创建了一个包含Google Earth插件的站点,我想使用本地KML文件显示两个坐标。
HTML 代码:
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"> </script>
<script type="text/javascript">
var ge;
google.load("earth", "1", {"other_params":"sensor=false"});
var fso, kmlString, fh;
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
}
function failureCB(errorCode) {
}
google.setOnLoadCallback(init);
</script>
</head>
<body>
<div id="map3d" style="height: 300px; width: 400px;"></div>
</body>
</html>
KML 代码:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Simple placemark</name>
<description>Attached to the ground. Intelligently places itself
at the height of the underlying terrain.</description>
<Point>
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
</Point>
</Placemark>
</kml>
我在 Google 上搜索了一些答案,但没有任何帮助我了解如何在 HTML 和 KML(Google 地球插件)之间进行组合。请帮我。 非常感谢你, 奥里安。
【问题讨论】:
-
var fso, kmlString, fh;这些似乎与处理文件的一些缺失代码有关。错过了一些您正在使用的示例代码?也许这会有所帮助developers.google.com/earth/articles/earthapikml
标签: javascript html kml google-earth-plugin