title: Call Google Map Geocode with PhantomJS
body: <p>I want to write a geocode function with phantomjs {input:address} -> {output:laglat}</p>
  
  <p>However, after I include google api and write the following code it gives error and says: "ReferenceError: Can't find variable: google"</p>
  
  <pre><code>var page = new WebPage()
  page.includeJs("http://maps.googleapis.com/maps/api/js?key={MY_KEY}&amp;sensor=false", function() {
    var geocoder;
    geocoder = new google.maps.Geocoder();
    var address = "507 W Florida Street, Chicago, Illinois"; // not real here
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        console.log(results[0].geometry.location);
      } else {
        console.log("error");
      }
    });
  });
  </code></pre>
  
  <p>here is the error from the console:</p>
  
  <pre><code>ReferenceError: Can't find variable: google
  
  geocode.js:4
  :/modules/webpage.js:337
  </code></pre>
  
  <p>I am new to PhantomJS, could anybody give me a hint about how to revise my code? I would really appreciate it.</p>