ang-google-maps
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "ang-google-maps", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"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.", |
@@ -13,5 +13,3 @@ (function(ang) { | ||
$scope.currentDestination = 'dropOff1'; | ||
$scope.test = 123123; | ||
setModel.call($scope); | ||
@@ -21,4 +19,2 @@ | ||
$scope.location[$Model.name] = $Event.latLng; | ||
$Geocode.getNames({ | ||
@@ -34,10 +30,2 @@ coords: $Event.latLng | ||
$scope.$watch('test', function(newValue, oldValue) { | ||
console.log('has been changed 1'); | ||
return newValue | ||
}).bind($scope); | ||
//$scope.$digest(); | ||
$scope.setPickup = function($Position, $Model, $CoreModel) { | ||
@@ -57,6 +45,2 @@ | ||
$scope.getBindName = function(name) { | ||
return $scope[name]; | ||
}; | ||
$scope.setLocation = function($Position, $Model, $CoreModel) { | ||
@@ -96,9 +80,11 @@ | ||
function setModel() { | ||
this.appName = "Google Maps API"; | ||
// Set the model | ||
this.location = {}; | ||
this.location = { | ||
'pickUp': '', | ||
'dropOff1': '' | ||
}; | ||
} | ||
}(angular)); |
{ | ||
"name": "ang-google-maps", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Module to initialize Google Maps API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,4 +15,3 @@ (function(ang, g) { | ||
}); | ||
$DirectionDisplay.addListener('directions_changed', function(res) { | ||
@@ -24,5 +23,5 @@ | ||
if (typeof $Map.ondirectionchange == 'function') $Map.ondirectionchange($Leg, function($scope) { | ||
if ($scope) $scope.$digest(); | ||
}); | ||
if (typeof $Map.ondirectionchange == 'function') $Map.ondirectionchange({$Leg: $Leg, done: function($scope) { | ||
if ($scope) $scope.$apply(); | ||
}}); | ||
@@ -93,5 +92,4 @@ }); | ||
id: "=id", | ||
configs: "=configs", | ||
oncenterchange: "=oncenterchange", | ||
ondirectionchange: "=?ondirectionchange" | ||
configs: "=", | ||
ondirectionchange: "&ondirectionchange" | ||
}, | ||
@@ -125,5 +123,5 @@ template: '<div class="filter" ng-transclude=""></div>', | ||
map: '=map', | ||
model: '=model', | ||
onfill: '=onfill', | ||
ondrop: '=ondrop' | ||
name: '@', | ||
onfill: '&onfill', | ||
ondrop: '&ondrop' | ||
} | ||
@@ -202,2 +200,4 @@ | ||
this.mapOptions['disableDefaultUI'] = true; | ||
this.$parent.map = this.map = new g.maps.Map(this.mapContainer, this.mapOptions); | ||
@@ -240,4 +240,4 @@ | ||
function autoCompleteTempCtrl($scope) { | ||
$scope.model = { label: '', name: $scope.name, show: 0 }; | ||
$scope.fillInAdress = fillInAdress; | ||
$scope.model = $scope.model || {}; | ||
} | ||
@@ -266,7 +266,7 @@ | ||
$scope.element = element[0]; | ||
$scope.$parent[$scope.model['name']] = ''; | ||
$scope.$parent.$watch($scope.model['name'], function(newValue, oldValue) { | ||
$scope.element.value = newValue; | ||
$scope.$parent[$scope['name']] = ''; | ||
$scope.$parent.$watch($scope['name'], function(newValue, oldValue) { | ||
console.log("Something is being changed"); | ||
if(newValue) $scope.element.value = newValue; | ||
return newValue; | ||
}).bind($scope.$parent); | ||
@@ -334,5 +334,5 @@ | ||
$Position = GetPosition(lat, lng); | ||
console.log($Self.model); | ||
if ( !($Self['model']) ) $Self.model = { label: '', name: '', show: 0 }; | ||
$Self.map.setCenter($Position); | ||
@@ -356,16 +356,10 @@ | ||
$Self.model.marker.addListener('dragend', function($Event) { | ||
if(typeof $Self.ondrop == 'function') $Self.ondrop($Event, $Self.model, $Self); | ||
if(typeof $Self.ondrop == 'function') $Self.ondrop({$Event: $Event, $Model: $Self.model, $AutoCompScope: $Self}); | ||
}); | ||
/* | ||
$Self.model.marker.addListener('click', function($Event) { | ||
handleMakerClick.call($Self, $Event); | ||
}); | ||
*/ | ||
// Push a new marker into markers list | ||
appendMarker($Self.map.markers, $Self.model); | ||
if(typeof $Self.onfill == 'function') $Self.onfill($Position, $Self.model, place, $Self.element); | ||
if(typeof $Self.onfill == 'function') $Self.onfill({$Position: $Position, $Model: $Self.model, $CoreModel: place, $Element: $Self.element}); | ||
@@ -372,0 +366,0 @@ |
Sorry, the diff of this file is not supported yet
555632
771