Skip to content

Commit d424291

Browse files
author
Allen Kim
committed
added documentation
1 parent 6e2e32d commit d424291

File tree

3 files changed

+26
-120
lines changed

3 files changed

+26
-120
lines changed

services/ng-map-pool.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
/**
2+
* @ngdoc factory
3+
* @name NgMapPool
4+
* @description
5+
* Provide map instance to avoid memory leak
6+
*/
17
(function() {
28
'use strict';
9+
/**
10+
* @memberof NgMapPool
11+
* @desc map instance pool
12+
*/
313
var mapInstances = [];
414
var $window, $document;
515

@@ -27,6 +37,12 @@
2737
return notInUseMap;
2838
};
2939

40+
/**
41+
* @memberof NgMapPool
42+
* @function getMapInstance
43+
* @param {HtmlElement} el map container element
44+
* @return map instance for the given element
45+
*/
3046
var getMapInstance = function(el) {
3147
var map = find(el);
3248
if (!map) {
@@ -36,6 +52,13 @@
3652
return map;
3753
};
3854

55+
/**
56+
* @memberof NgMapPool
57+
* @function returnMapInstance
58+
* @param {Map} an instance of google.maps.Map
59+
* @desc sets the flag inUse of the given map instance to false, so that it
60+
* can be reused later
61+
*/
3962
var returnMapInstance = function(map) {
4063
map.inUse = false;
4164
};

services/ng-map.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@
156156

157157
/**
158158
* @memberof NgMap
159-
* @function getMap
160-
* @param {Hash} options optional, e.g., {id: 'foo, timeout: 5000}
161-
* @returns promise
159+
* @function setStyle
160+
* @param {HtmlElement} map contriner element
161+
* @desc set display, width, height of map container element
162162
*/
163163
var setStyle = function(el) {
164164
//if style is not given to the map element, set display and height

0 commit comments

Comments
 (0)