@@ -184,7 +184,7 @@ <h1 class="title">
184184 * @desc map instance pool
185185 */
186186 var mapInstances = [];
187- var $window, $document;
187+ var $window, $document, $timeout ;
188188 var add = function(el) {
189189 var mapDiv = $document.createElement("div");
190190 mapDiv.style.width = "100%";
@@ -217,6 +217,11 @@ <h1 class="title">
217217 var map = find(el);
218218 if (!map) {
219219 map = add(el);
220+ } else {
221+ /* firing map idle event, which is used by map controller */
222+ $timeout(function() {
223+ google.maps.event.trigger(map, 'idle');
224+ }, 100);
220225 }
221226 map.inUse = true;
222227 return map;
@@ -231,15 +236,15 @@ <h1 class="title">
231236 var returnMapInstance = function(map) {
232237 map.inUse = false;
233238 };
234- var NgMapPool = function(_$document_, _$window_) {
235- $document = _$document_[0], $window = _$window_;
239+ var NgMapPool = function(_$document_, _$window_, _$timeout_ ) {
240+ $document = _$document_[0], $window = _$window_, $timeout = _$timeout_ ;
236241 return {
237242 mapInstances: mapInstances,
238243 getMapInstance: getMapInstance,
239244 returnMapInstance: returnMapInstance
240245 };
241246 };
242- NgMapPool.$inject = [ '$document', '$window' ];
247+ NgMapPool.$inject = [ '$document', '$window', '$timeout' ];
243248 angular.module('ngMap').factory('NgMapPool', NgMapPool);
244249})();
245250</ code > </ pre >
0 commit comments