@@ -877,13 +877,8 @@ Nicholas McCready - https://twitter.com/nmccready
877
877
return remove . push ( addEvent ( target , key , _handler ) ) ;
878
878
} ) ;
879
879
return function ( ) {
880
- angular . forEach ( remove , function ( fn ) {
881
- if ( _ . isFunction ( fn ) ) {
882
- fn ( ) ;
883
- }
884
- if ( fn . e !== null && _ . isFunction ( fn . e ) ) {
885
- return fn . e ( ) ;
886
- }
880
+ angular . forEach ( remove , function ( listener ) {
881
+ return google . maps . event . removeListener ( listener ) ;
887
882
} ) ;
888
883
return remove = null ;
889
884
} ;
@@ -3186,7 +3181,7 @@ Nicholas McCready - https://twitter.com/nmccready
3186
3181
return ;
3187
3182
}
3188
3183
return $timeout ( function ( ) {
3189
- var arraySyncer , buildOpts , map , polygon ;
3184
+ var arraySyncer , buildOpts , map , pathPoints , polygon ;
3190
3185
buildOpts = function ( pathPoints ) {
3191
3186
var opts ;
3192
3187
opts = angular . extend ( { } , DEFAULTS , {
@@ -3214,7 +3209,8 @@ Nicholas McCready - https://twitter.com/nmccready
3214
3209
return opts ;
3215
3210
} ;
3216
3211
map = mapCtrl . getMap ( ) ;
3217
- polygon = new google . maps . Polygon ( buildOpts ( convertPathPoints ( scope . path ) ) ) ;
3212
+ pathPoints = convertPathPoints ( scope . path ) ;
3213
+ polygon = new google . maps . Polygon ( buildOpts ( pathPoints ) ) ;
3218
3214
if ( isTrue ( attrs . fit ) ) {
3219
3215
extendMapBounds ( map , pathPoints ) ;
3220
3216
}
@@ -3246,6 +3242,11 @@ Nicholas McCready - https://twitter.com/nmccready
3246
3242
}
3247
3243
} ) ;
3248
3244
}
3245
+ if ( angular . isDefined ( scope . stroke ) && angular . isDefined ( scope . stroke . opacity ) ) {
3246
+ scope . $watch ( "stroke.opacity" , function ( newValue , oldValue ) {
3247
+ return polygon . setOptions ( buildOpts ( polygon . getPath ( ) ) ) ;
3248
+ } ) ;
3249
+ }
3249
3250
if ( angular . isDefined ( scope . stroke ) && angular . isDefined ( scope . stroke . weight ) ) {
3250
3251
scope . $watch ( "stroke.weight" , function ( newValue , oldValue ) {
3251
3252
if ( newValue !== oldValue ) {
@@ -3387,7 +3388,7 @@ Nicholas McCready - https://twitter.com/nmccready
3387
3388
return ;
3388
3389
}
3389
3390
return $timeout ( function ( ) {
3390
- var arraySyncer , buildOpts , map , polyline ;
3391
+ var arraySyncer , buildOpts , map , pathPoints , polyline ;
3391
3392
buildOpts = function ( pathPoints ) {
3392
3393
var opts ;
3393
3394
opts = angular . extend ( { } , DEFAULTS , {
@@ -3413,7 +3414,8 @@ Nicholas McCready - https://twitter.com/nmccready
3413
3414
return opts ;
3414
3415
} ;
3415
3416
map = mapCtrl . getMap ( ) ;
3416
- polyline = new google . maps . Polyline ( buildOpts ( convertPathPoints ( scope . path ) ) ) ;
3417
+ pathPoints = convertPathPoints ( scope . path ) ;
3418
+ polyline = new google . maps . Polyline ( buildOpts ( pathPoints ) ) ;
3417
3419
if ( isTrue ( attrs . fit ) ) {
3418
3420
extendMapBounds ( map , pathPoints ) ;
3419
3421
}
0 commit comments