ang-google-services
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "ang-google-services", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Consuming google's APIs services", | ||
@@ -5,0 +5,0 @@ "main": "./src/module.js", |
{ | ||
"name": "ang-google-services", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Consuming google's APIs services", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,2 +14,4 @@ # Ang Google Services | ||
2. Add markers into the map | ||
3. Get the names of the place for the given coordinates | ||
4. Get the list of address, and their coordinates for the given address | ||
@@ -22,3 +24,6 @@ ## Screenshots | ||
### Demo #3 | ||
![Demo 3](https://github.com/khalednobani/ang-google-services/blob/master/assets/img/2.%20demo%20%233.png?raw=true) | ||
### Need help | ||
@@ -25,0 +30,0 @@ |
@@ -20,2 +20,5 @@ (function($A, $G) { | ||
return getLocationsName.call($Self, $GeocodeService, options, $q); | ||
}, | ||
getGeoCode: function(options) { | ||
return getGeoCode.call($Self, $GeocodeService, options, $q); | ||
} | ||
@@ -171,3 +174,3 @@ | ||
var $Deffered = $q.defer(); | ||
var $Defer = $q.defer(); | ||
@@ -177,5 +180,5 @@ $GeocodeService.geocode({'location' : options['coords'] || {lat: null, lng: null } }, function(results, status) { | ||
if (status == $G.maps.GeocoderStatus.OK) { | ||
$Deffered.resolve(results); | ||
$Defer.resolve(results); | ||
} else { | ||
$Deffered.resolve({error: { message: 'Failed to get the result' }}); | ||
$Defer.resolve({error: { message: 'Failed to get the result' }}); | ||
} | ||
@@ -185,6 +188,29 @@ | ||
return $Deffered.promise; | ||
return $Defer.promise; | ||
} | ||
/** | ||
* Gets the list of address. | ||
* | ||
* @param {Object} options | ||
*/ | ||
function getGeoCode($GeocodeService, options, $q) { | ||
var $Defer = $q.defer(); | ||
$GeocodeService.geocode({'address' : options['address'] || '' }, function(results, status) { | ||
if (status == $G.maps.GeocoderStatus.OK) { | ||
$Defer.resolve(results); | ||
} else { | ||
$Defer.resolve(undefined); | ||
} | ||
}); | ||
return $Defer.promise; | ||
} | ||
}(angular, google)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2596561
16
248
33