ang-google-maps
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "ang-google-maps", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"homepage": "https://github.com/khalednobani/ang-google-maps", | ||
@@ -5,0 +5,0 @@ "description": "Initialise Google Maps, Set Location, Drop Pins, Get Connected Routes between the current location and the destination.", |
@@ -116,3 +116,5 @@ (function(ang) { | ||
$scope.setLocation = function($Position, $Model, $CoreModel) { | ||
console.log($scope.location[$scope.currentDestination]); | ||
var current = $scope.location['pickUp'], | ||
@@ -157,3 +159,3 @@ destination = $scope.location[$scope.currentDestination]; | ||
console.log("Before Updating dropoffs"); | ||
console.log($scope.dropOffs); | ||
console.log(JSON.stringify($scope.dropOffs)); | ||
@@ -165,7 +167,2 @@ $scope.updateWaypoints($parentScope, $Leg, $Leg.waypoints); | ||
$scope.updateWaypoints = function($parentScope, $Leg, $WayPoints) { | ||
console.log("Line 167"); | ||
console.log($scope.dropOffs); | ||
console.log($WayPoints); | ||
//return; | ||
@@ -181,2 +178,3 @@ if (!$scope.waypoints.length) return; | ||
$scope.dropOffs[key]['location'] = $Leg.destination.coords; | ||
console.log($scope.dropOffs[key]['location']); | ||
console.log('Skipping'); | ||
@@ -202,3 +200,2 @@ continue; | ||
console.log("After change : " + $scope.dropOffs[index]['location'].toString()); | ||
@@ -209,5 +206,5 @@ | ||
} | ||
console.log($scope.dropOffs); | ||
console.log(JSON.stringify($scope.dropOffs)); | ||
}; | ||
@@ -214,0 +211,0 @@ |
{ | ||
"name": "ang-google-maps", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Module to initialize Google Maps API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,7 +13,15 @@ (function(ang, g) { | ||
$DirectionDisplay = new g.maps.DirectionsRenderer({ | ||
draggable: true | ||
draggable: true, | ||
hideRouteList: true, | ||
markerOptions: { | ||
crossOnDrag: false | ||
} | ||
}); | ||
console.log($DirectionDisplay); | ||
$DirectionDisplay.addListener('directions_changed', function(res) { | ||
console.log(this); | ||
var $Directions = this.directions, | ||
@@ -23,3 +31,3 @@ $Map = this.map, | ||
$ProcessedLeg = processLegs($Directions); | ||
if (typeof $Map.ondirectionchange == 'function') $Map.ondirectionchange({$Leg: $ProcessedLeg, $parentScope: $rootScope, $Directions: $Directions}); | ||
@@ -44,3 +52,3 @@ | ||
$Legs = $Routes.legs, | ||
$Result = {waypoints: []}; | ||
$Result = {waypoints: [], totalDuration: 0, totalDistance: 0}; | ||
@@ -66,2 +74,5 @@ console.log($Legs); | ||
} | ||
$Result['totalDistance'] += $Legs[0]['distance']['value']; | ||
$Result['totalDuration'] += $Legs[0]['duration']['value']; | ||
@@ -71,3 +82,3 @@ } else { | ||
for (var index = 0, length = $Legs.length; index < length; index++) { | ||
if (index + 1 == length) { | ||
@@ -84,4 +95,7 @@ $Result['destination'] = { | ||
$Result['totalDistance'] += $Legs[index]['distance']['value']; | ||
$Result['totalDuration'] += $Legs[index]['duration']['value']; | ||
} | ||
$Result['waypoints'] = $Result['waypoints'].reverse(); | ||
@@ -473,3 +487,3 @@ | ||
} | ||
function Direction(configs) { | ||
@@ -476,0 +490,0 @@ |
Sorry, the diff of this file is not supported yet
565456
933