forked from allenhwkim/angular-jsdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
attr2-options.js
90 lines (81 loc) · 2.67 KB
/
attr2-options.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(function() {
'use strict';
/**
* @memberof ngmap
* @ngdoc service
* @name Attr2Options
* @param {service} $parse angular html parser
* @param {service} $timeout angular window.setTimeout service
* @param {service} NavigatorGeolocation Google NavigatorGeolocation wrapper
* @param {service} GeoCoder Google GeoCoder wrapper
* @description
* Converts html attributes to google api v3 object options
*/
var Attr2Options = function($parse, $timeout, NavigatorGeolocation, GeoCoder) {
/**
* Convert input to Google Map option input
* @memberof Attr2Options
* @param {Objec} input a value to convert
* @param {Hash} options to convert the input
* @returns {Hash} attributes
*/
var toOptionValue = function(input, options) {
// .. code ..
};
/**
* filters attributes by skipping angularjs methods $.. $$..
* @memberof Attr2Options
* @param {Hash} attrs tag attributes
* @returns {Hash} filterd attributes
*/
var filter = function(attrs) {
// .. code ..
};
/**
* converts attributes hash to Google Maps API v3 options
* ```
* . converts numbers to number
* . converts class-like string to google maps instance
* i.e. `LatLng(1,1)` to `new google.maps.LatLng(1,1)`
* . converts constant-like string to google maps constant
* i.e. `MapTypeId.HYBRID` to `google.maps.MapTypeId.HYBRID`
* i.e. `HYBRID"` to `google.maps.MapTypeId.HYBRID`
* ```
* @memberof Attr2Options
* @param {Hash} attrs tag attributes
* @param {scope} scope angularjs scope
* @returns {Hash} options converted attributess
*/
var getOptions = function(attrs, scope) {
// .. code ..
};
/**
* converts attributes hash to scope-specific event function
* @memberof Attr2Options
* @param {scope} scope angularjs scope
* @param {Hash} attrs tag attributes
* @returns {Hash} events converted events
*/
var getEvents = function(scope, attrs) {
// .. code ..
};
/**
* Return options of Google map control, i.e streetview, pan, etc, not a general control
* @memberof Attr2Options
* @param {Hash} filtered filtered tag attributes
* @returns {Hash} Google Map options
*/
var getControlOptions = function(filtered) {
// .. code ..
};
return {
filter: filter,
getOptions: getOptions,
getEvents: getEvents,
getControlOptions: getControlOptions,
toOptionValue: toOptionValue,
orgAttributes: orgAttributes
}; // return
};
angular.module('ngMap').service('Attr2Options', Attr2Options);
})();