Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 2dcb004

Browse files
committed
Merge pull request #1451 from nmccready/dev/nmccready/issue_1377_circle_events
issue 1377 fix circle event
2 parents 63637fe + ae4f09b commit 2dcb004

13 files changed

+313
-75
lines changed

dist/angular-google-maps-street-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.5 2015-08-25
1+
/*! angular-google-maps 2.1.5 2015-08-26
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/

dist/angular-google-maps-street-view.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps-street-view_dev_mapped.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps-street-view_dev_mapped.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps.js

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.5 2015-08-25
1+
/*! angular-google-maps 2.1.5 2015-08-26
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -4195,7 +4195,14 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
41954195

41964196
angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapCircleParentModel', [
41974197
'uiGmapLogger', '$timeout', 'uiGmapGmapUtil', 'uiGmapEventsHelper', 'uiGmapCircleOptionsBuilder', function($log, $timeout, GmapUtil, EventsHelper, Builder) {
4198-
var CircleParentModel;
4198+
var CircleParentModel, _settingFromDirective;
4199+
_settingFromDirective = function(scope, fn) {
4200+
scope.settingFromDirective = true;
4201+
fn();
4202+
return $timeout(function() {
4203+
return scope.settingFromDirective = false;
4204+
});
4205+
};
41994206
return CircleParentModel = (function(superClass) {
42004207
extend(CircleParentModel, superClass);
42014208

@@ -4222,6 +4229,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42224229
gObject = new google.maps.Circle(this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));
42234230
this.setMyOptions = (function(_this) {
42244231
return function(newVals, oldVals) {
4232+
if (scope.settingFromDirective) {
4233+
return;
4234+
}
42254235
if (!_.isEqual(newVals, oldVals)) {
42264236
return gObject.setOptions(_this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));
42274237
}
@@ -4259,13 +4269,15 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42594269
}
42604270
lastRadius = newRadius;
42614271
work = function() {
4262-
var ref, ref1;
4263-
if (newRadius !== scope.radius) {
4264-
scope.radius = newRadius;
4265-
}
4266-
if (((ref = scope.events) != null ? ref.radius_changed : void 0) && _.isFunction((ref1 = scope.events) != null ? ref1.radius_changed : void 0)) {
4267-
return scope.events.radius_changed(gObject, 'radius_changed', scope, arguments);
4268-
}
4272+
return _settingFromDirective(scope, function() {
4273+
var ref, ref1;
4274+
if (newRadius !== scope.radius) {
4275+
scope.radius = newRadius;
4276+
}
4277+
if (((ref = scope.events) != null ? ref.radius_changed : void 0) && _.isFunction((ref1 = scope.events) != null ? ref1.radius_changed : void 0)) {
4278+
return scope.events.radius_changed(gObject, 'radius_changed', scope, arguments);
4279+
}
4280+
});
42694281
};
42704282
if (!angular.mock) {
42714283
return scope.$evalAsync(function() {
@@ -4279,13 +4291,15 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42794291
if (this.listeners != null) {
42804292
this.listeners.push(google.maps.event.addListener(gObject, 'center_changed', function() {
42814293
return scope.$evalAsync(function() {
4282-
if (angular.isDefined(scope.center.type)) {
4283-
scope.center.coordinates[1] = gObject.getCenter().lat();
4284-
return scope.center.coordinates[0] = gObject.getCenter().lng();
4285-
} else {
4286-
scope.center.latitude = gObject.getCenter().lat();
4287-
return scope.center.longitude = gObject.getCenter().lng();
4288-
}
4294+
return _settingFromDirective(scope, function() {
4295+
if (angular.isDefined(scope.center.type)) {
4296+
scope.center.coordinates[1] = gObject.getCenter().lat();
4297+
return scope.center.coordinates[0] = gObject.getCenter().lng();
4298+
} else {
4299+
scope.center.latitude = gObject.getCenter().lat();
4300+
return scope.center.longitude = gObject.getCenter().lng();
4301+
}
4302+
});
42894303
});
42904304
}));
42914305
}

dist/angular-google-maps.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps_dev_mapped.js

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.5 2015-08-25
1+
/*! angular-google-maps 2.1.5 2015-08-26
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -4195,7 +4195,14 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
41954195

41964196
angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapCircleParentModel', [
41974197
'uiGmapLogger', '$timeout', 'uiGmapGmapUtil', 'uiGmapEventsHelper', 'uiGmapCircleOptionsBuilder', function($log, $timeout, GmapUtil, EventsHelper, Builder) {
4198-
var CircleParentModel;
4198+
var CircleParentModel, _settingFromDirective;
4199+
_settingFromDirective = function(scope, fn) {
4200+
scope.settingFromDirective = true;
4201+
fn();
4202+
return $timeout(function() {
4203+
return scope.settingFromDirective = false;
4204+
});
4205+
};
41994206
return CircleParentModel = (function(superClass) {
42004207
extend(CircleParentModel, superClass);
42014208

@@ -4222,6 +4229,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42224229
gObject = new google.maps.Circle(this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));
42234230
this.setMyOptions = (function(_this) {
42244231
return function(newVals, oldVals) {
4232+
if (scope.settingFromDirective) {
4233+
return;
4234+
}
42254235
if (!_.isEqual(newVals, oldVals)) {
42264236
return gObject.setOptions(_this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));
42274237
}
@@ -4259,13 +4269,15 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42594269
}
42604270
lastRadius = newRadius;
42614271
work = function() {
4262-
var ref, ref1;
4263-
if (newRadius !== scope.radius) {
4264-
scope.radius = newRadius;
4265-
}
4266-
if (((ref = scope.events) != null ? ref.radius_changed : void 0) && _.isFunction((ref1 = scope.events) != null ? ref1.radius_changed : void 0)) {
4267-
return scope.events.radius_changed(gObject, 'radius_changed', scope, arguments);
4268-
}
4272+
return _settingFromDirective(scope, function() {
4273+
var ref, ref1;
4274+
if (newRadius !== scope.radius) {
4275+
scope.radius = newRadius;
4276+
}
4277+
if (((ref = scope.events) != null ? ref.radius_changed : void 0) && _.isFunction((ref1 = scope.events) != null ? ref1.radius_changed : void 0)) {
4278+
return scope.events.radius_changed(gObject, 'radius_changed', scope, arguments);
4279+
}
4280+
});
42694281
};
42704282
if (!angular.mock) {
42714283
return scope.$evalAsync(function() {
@@ -4279,13 +4291,15 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
42794291
if (this.listeners != null) {
42804292
this.listeners.push(google.maps.event.addListener(gObject, 'center_changed', function() {
42814293
return scope.$evalAsync(function() {
4282-
if (angular.isDefined(scope.center.type)) {
4283-
scope.center.coordinates[1] = gObject.getCenter().lat();
4284-
return scope.center.coordinates[0] = gObject.getCenter().lng();
4285-
} else {
4286-
scope.center.latitude = gObject.getCenter().lat();
4287-
return scope.center.longitude = gObject.getCenter().lng();
4288-
}
4294+
return _settingFromDirective(scope, function() {
4295+
if (angular.isDefined(scope.center.type)) {
4296+
scope.center.coordinates[1] = gObject.getCenter().lat();
4297+
return scope.center.coordinates[0] = gObject.getCenter().lng();
4298+
} else {
4299+
scope.center.latitude = gObject.getCenter().lat();
4300+
return scope.center.longitude = gObject.getCenter().lng();
4301+
}
4302+
});
42894303
});
42904304
}));
42914305
}

dist/angular-google-maps_dev_mapped.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps_dev_mapped.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps_dev_mapped.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)