title: How to do geocoding with angular-google-maps
body: <p>I have been trying to hours to work out how to use googles geolocation services with the angular module angular-google-maps. Using this module makes it weird and cannot do geolocation in the same manner as with the normal google maps javascript v3 it seems. </p>
  
  <p>e.g:</p>
  
  <pre><code>var geocoder = new google.maps.Geocoder();
  </code></pre>
  
  <p>Google is undefined..</p>
  
  <p>This is what I have worked out so far:</p>
  
  <p>My angular.module:</p>
  
  <pre><code> ...'uiGmapgoogle-maps'])
  
   .config(['uiGmapGoogleMapApiProvider', function (GoogleMapApi) {
                  GoogleMapApi.configure({
                    key: 'X',
                    v: '3.20',
                    libraries: 'weather,geometry,visualization' 
                  });
                }]);
  </code></pre>
  
  <p>My angular controller:</p>
  
  <pre><code>.controller(...., function (.., uiGmapGoogleMapApi, GoogleMapApi){
  
  //Map setup stuff
  
   var geocoder = new GoogleMapApi.Geocoder();
          geocoder.geocode( { 'address': 'something'}, function(results, status) {
           if (status == GoogleMapApi.google.maps.GeocoderStatus.OK) {
             $scope.map.control.getGMap().setCenter(results[0].geometry.location);
             $scope.map.marker.latitude = results[0].geometry.location.lat();
             $scope.map.marker.longitude = results[0].geometry.location.lng();
           } else {
             alert('Geocode was not successful for the following reason: ' + status);
           }
          });
  </code></pre>
  
  <p>Says Geocoder is undefined. 
  Very confused as to what object to use, uiGmapGoogleMapApi or GoogleMapApi to reference the Geocoder(). And how the geocoder.geocode.. should be set?
  Please help</p>