我試圖裝載兩個KML文件,admin.kml和pibkt.kml,與下面的相同的代碼加載KML文件:無法使用geoxml3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Google Maps KML</title>
<meta name="description" content="menampilkan polygon dari kml di googlemaps">
<meta name="author" content="El Cicko">
<style type="text/css">
body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px;}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>
<script type="text/javascript" src="ProjectedOverlay.js"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
var peta;
function peta_awal(){
// var jawa_barat = new google.maps.LatLng(0.89176, 123.38894);
var petaoption = {
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
peta = new google.maps.Map(document.getElementById("petaku"),petaoption);
var geoXml = new geoXML3.parser({map: peta});
geoXml.parse('admin.kml');
google.maps.event.addListener(peta,'click',function(event){
kasihtanda(event.latLng);
});
}
</script>
</head>
<body onload="peta_awal()">
<h2>Google Maps KML</h2>
<div id="petaku" style="height:500px"></div>
</body>
</html>
但是當我改變admin.kml到pibkt.kml,我的瀏覽器沒有顯示任何內容,我不知道爲什麼,因爲我可以通過KML在線查看這兩個文件,KMZ查看器Google Drive 請幫助我,我是全新的,我非常感謝您的幫助,謝謝。
KML的外觀如何? – geocodezip
像https://goo.gl/ccmrMC(admin.kml)和這個https://goo.gl/AP6XQn(pibkt.kml) –
我在[goo.gl/AP6XQn]上看不到任何KML( https://goo.gl/AP6XQn)(pibkt.kml) – geocodezip