Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ang-google-services

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ang-google-services - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

demos/assets/css

2

bower.json
{
"name": "ang-google-services",
"version": "1.0.0",
"version": "1.0.1",
"description": "Consuming google's APIs services",

@@ -5,0 +5,0 @@ "main": "./src/module.js",

{
"name": "ang-google-services",
"version": "1.0.0",
"version": "1.0.1",
"description": "Consuming google's APIs services",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,5 +6,22 @@ (function($A, $G) {

$A.module('ang-google-services', [])
.factory('$Geocode', ['$q', function($q) { return Geocode($q); }])
.factory('$Marker', ['$q', function($q) { return Marker($q); }])
.factory('$Places', ['$q', function($q) { return Places($q); }]);
function Geocode($q) {
var $Self = this,
$GeocodeService = new $G.maps.Geocoder;
return {
getCoords: function() {},
getNames: function(options) {
return getLocationsName.call($Self, $GeocodeService, options, $q);
}
};
};
/**

@@ -79,12 +96,12 @@ * The factory of Marker

if ('placesservice' in $Map) {
} else {
$Map.placesservice = new $G.maps.places.PlacesService($Map);
}
console.log($Map.placesservice);
$Map.placesservice.nearbySearch($Req, function(results, status) {
if (status == 'OK') {
if (status == $G.maps.GeocoderStatus.OK) {
$Deffered.resolve(results);

@@ -94,7 +111,7 @@ } else {

}
});
return $Deffered.promise;
}

@@ -109,5 +126,5 @@

function getMarker(options) {
if (!options['map']) return undefined;
return new $G.maps.Marker({

@@ -118,3 +135,3 @@ map: options['map'],

});
}

@@ -128,14 +145,14 @@

function addMarkers(options) {
var $Options = options || {},
$Markers = options['markers'] || [],
$Map = $Options['map'];
if(!$Map) return 0;
for (var index = 0, length = $Markers.length; index < length; index++) {
var $M = $Markers[index],
$Position = ('geometry' in $M) ? $M['geometry']['location'] : $M['position'] || { lat: null, lng: null};
$Markers[index].$marker = getMarker({

@@ -145,6 +162,5 @@ position: $Position,

});
$Map.panTo($Position);
}

@@ -154,2 +170,25 @@

/**
* Gets the names of location from coordinates
*
* @param {Object} options
*/
function getLocationsName($GeocodeService, options, $q) {
var $Deffered = $q.defer();
$GeocodeService.geocode({'location' : options['coords'] || {lat: null, lng: null } }, function(results, status) {
if (status == $G.maps.GeocoderStatus.OK) {
$Deffered.resolve(results);
} else {
$Deffered.resolve({error: { message: 'Failed to get the result' }});
}
});
return $Deffered.promise;
}
}(angular, google));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc