File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 11
11
* @desc map instance pool
12
12
*/
13
13
var mapInstances = [ ] ;
14
- var $window , $document ;
14
+ var $window , $document , $timeout ;
15
15
16
16
var add = function ( el ) {
17
17
var mapDiv = $document . createElement ( "div" ) ;
47
47
var map = find ( el ) ;
48
48
if ( ! map ) {
49
49
map = add ( el ) ;
50
+ } else {
51
+ /* firing map idle event, which is used by map controller */
52
+ $timeout ( function ( ) {
53
+ google . maps . event . trigger ( map , 'idle' ) ;
54
+ } , 100 ) ;
50
55
}
51
56
map . inUse = true ;
52
57
return map ;
63
68
map . inUse = false ;
64
69
} ;
65
70
66
- var NgMapPool = function ( _$document_ , _$window_ ) {
67
- $document = _$document_ [ 0 ] , $window = _$window_ ;
71
+ var NgMapPool = function ( _$document_ , _$window_ , _$timeout_ ) {
72
+ $document = _$document_ [ 0 ] , $window = _$window_ , $timeout = _$timeout_ ;
68
73
69
74
return {
70
75
mapInstances : mapInstances ,
71
76
getMapInstance : getMapInstance ,
72
77
returnMapInstance : returnMapInstance
73
78
} ;
74
79
} ;
75
- NgMapPool . $inject = [ '$document' , '$window' ] ;
80
+ NgMapPool . $inject = [ '$document' , '$window' , '$timeout' ] ;
76
81
77
82
angular . module ( 'ngMap' ) . factory ( 'NgMapPool' , NgMapPool ) ;
78
83
You can’t perform that action at this time.
0 commit comments