Geo-Location


#1

I am using the following default code for the map example like this:


function($scope, uiGmapGoogleMapApi) {
// Do stuff with your $scope.
// Note: Some of the directives require at least something to be defined originally!
// e.g. $scope.markers = []

// uiGmapGoogleMapApi is a promise.
// The "then" callback function provides the google.maps object.
uiGmapGoogleMapApi.then(function(maps){
    // Configuration needed to display the road-map with traffic
    // Displaying Ile-de-france (Paris neighbourhood)
    $scope.map = {
        center: {
          latitude: -23.598763,
          longitude: -46.676547
        },
        zoom: 13,
        options: {
            mapTypeId: google.maps.MapTypeId.HYBRID, // This is an example of a variable that cannot be placed outside of uiGmapGooogleMapApi without forcing of calling the google.map helper outside of the function
            streetViewControl: false,
            mapTypeControl: false,
            scaleControl: false,
            rotateControl: false,
            zoomControl: false
        }, 
        showTraficLayer:true
    };
});

}


I’d like to incorporate the default location to be the user’s location. I found a snippet of code that appears to do what I need but have no idea how to incorporate it. Here is the snippet, can you help me adjust the default code:


geocoder = new maps.Geocoder();
geocoder.geocode({‘latLng’: latlng}, function(results, status) {
// Do something with result
});


What do you think?