DanielAttard
DanielAttard

Reputation: 3605

Uncaught TypeError when using loadGeoJSON

I am getting this error:

Uncaught TypeError: undefined is not a function

when I run the following javascript code:

<script>
function initialize() {
  var mapOptions = {
    zoom: 5,
    center: {lat: -28, lng: 137.883}
  }
  var map = new google.maps.Map(document.getElementById('mycanvas'), mapOptions);
  map.data.loadGeoJSON("<?php echo site_url() ?>js/google.json");

}
google.maps.event.addDomListener(window, 'load', initialize);
</script>

Any ideas why? Thanks.

Upvotes: 0

Views: 365

Answers (1)

closure
closure

Reputation: 7452

Typo: use loadGeoJson instead of 'loadGeoJSON'

Upvotes: 1

Related Questions