-1

i have tried to load two kml files, admin.kml and pibkt.kml , with the same code below:

    <!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>

but when i change admin.kml to pibkt.kml, my browser displays for nothing, i don't know why, because i can view both files online via KML,KMZ viewer Google Drive please help me, i'm totally new, i really appreciate your help, thanks.

Kiki Rizki
  • 21
  • 1
  • 9

2 Answers2

1

That KML isn't valid. I suspect the issue in geoxml3 is the tags inside the tags. If I replace the <Document> tags with <Folder> tags, it works for me:

http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/kml/SO_20150917_MyPlacesNoDoc.kml

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • thank you, your answer is true, but i found another way also, and that was to **export my pibkt.kmz to pibkt.kml via My maps from google map**, because my previous pibkt.kml derived from Google Earth Pro, i think that's bug – Kiki Rizki Sep 18 '15 at 01:44
0

hey that is actually a bug from google earth pro. you can export your .kmz via my maps from google map

Philipus Silaen
  • 221
  • 2
  • 17