user2082413
user2082413

Reputation: 11

Can't show image from kml file using google maps api v3 and geoxml3

i try to put my kml file on google maps using geoxml3. here is the code`

<script src="https://maps.googleapis.com/maps/api/js?&sensor=false"></script>
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>
<script>
  function initialize() {
    var myLatlng = new google.maps.LatLng(-3.899540, 104.463014);
    var mapOptions = {
      zoom: 4,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }

    var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);

    myParser = new geoXML3.parser({map: map});
    myParser.parse('bpnsumsel.kml');

  }
</script>
`

but nothing shows up. any idea?

update:

my kml file looks like this

<?xml version="1.0" encoding="utf-8"?><kml xmlns="http://earth.google.com/kml/2.0"><GroundOverlay><name> MapInfo Saved View</name><visibility>1</visibility><Icon><href>Peta BPN Sumsel.JPG</href></Icon><LatLonBox><north>-3.378408</north><south>-4.506592</south><east>105.590007</east><west>103.723993</west><rotation>0</rotation></LatLonBox></GroundOverlay></kml>

yes. i don't include ProjectedOverlayed.js is there any good tutorial for full code example?

thanks

Upvotes: 0

Views: 1606

Answers (1)

geocodezip
geocodezip

Reputation: 161334

Per the documentation:

The geoxml3 library is specifically designed to accomodate a range of use cases, covering developer needs from beginner to advanced. In all cases, you'll need to download a copy of geoxml3.js (and ProjectedOverlay.js, if you want ground overlays) from this site and serve them to your map page from your own host, as follows:

  <script type="text/javascript" src="geoxml3.js"></script>
[ <script type="text/javascript" src="ProjectedOverlay.js"></script> ]

Upvotes: 1

Related Questions