Completed
Push — master ( 88d3e4...6bf9b2 )
by Felipe
01:15
created

markerfactory.js ➔ hslaString   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
 function compact(array) {
0 ignored issues
show
introduced by
Definition for rule 'keyword-spacing' was not found
Loading history...
2
    var index = -1,
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
3
        length = array ? array.length : 0,
4
        resIndex = 0,
5
        result = [];
6
7
    while (++index < length) {
8
        var value = array[index];
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
9
        if (value) {
10
            result[resIndex++] = value;
11
        }
12
    }
13
    return result;
14
 }
15
16
 function padHex(str_in) {
17
    if (('' + str_in).length === 1) {
18
        return '0' + String(str_in);
19
    } else {
20
        return String(str_in);
21
    }
22
 }
23
24
 var defaults = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
25
    h: 1,
26
    s: 78, // constant saturation
27
    l: 63, // constant luminance
28
    a: 1
29
 };
30
31
 function hslaString(hslcolor) {
32
    return 'hsla(' + hslcolor.h + ',' + hslcolor.s + '%,' + hslcolor.l + '%,' + hslcolor.a + ')';
33
 }
34
35
 function rgbaString(hexcolor) {
36
    return 'rgba(' + hexcolor.r + ',' + hexcolor.g + ',' + hexcolor.b + ',' + hexcolor.a + ')';
37
 }
38
39
 function getColor(val, range) {
40
    defaults.h = Math.floor((360 / range) * val);
41
    return hslaString(defaults);
42
 }
43
44
 function getColor1() {
45
    var defaults1 = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
46
        h: 1,
47
        s: 78, // constant saturation
48
        l: 33, // constant luminance
49
        a: 1
50
    };
51
    return hslaString(defaults1);
52
 }
53
54
 function parseHalf(foo) {
55
    return parseInt(foo / 2, 10);
56
 }
57
58
59
0 ignored issues
show
introduced by
More than 2 blank lines not allowed.
Loading history...
60
 function darken(stringcolor, factor) {
61
    var darkercolor = {};
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
62
    if (!factor) {
63
        factor = 1;
64
    }
65
    if (stringcolor.fillColor.indexOf('rgb') !== -1) {
66
        darkercolor.r = factor * parseHalf(stringcolor.r);
67
        darkercolor.g = factor * parseHalf(stringcolor.g);
68
        darkercolor.b = factor * parseHalf(stringcolor.b);
69
        darkercolor.a = 0.99;
70
        darkercolor.fillColor = rgbaString(darkercolor);
71
    } else if (stringcolor.fillColor.indexOf('hsl') !== -1) {
72
        darkercolor.h = stringcolor.h;
73
        darkercolor.s = stringcolor.s;
74
        darkercolor.l = factor * stringcolor.l - 30;
75
        darkercolor.fillColor = 'hsl(' + darkercolor.h + ',' + darkercolor.s + '%,' + darkercolor.l + '%)';
76
    }
77
78
    return darkercolor;
79
 }
80
81
 function getColors(options) {
82
    var color0, color1;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
83
    if (options.index !== undefined && options.count > 0) {
84
        color0 = getColor(options.index, options.count);
85
        color1 = getColor1();
86
    } else {
87
        var deccolor = toDecColor(options.color);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
introduced by
"toDecColor" was used before it was defined
Loading history...
88
        color0 = deccolor.fillColor;
89
        color1 = darken(deccolor).fillColor;
90
    }
91
    return [color0, color1];
92
 }
93
94
 function parseHex(hexstring, opacity, darkenfactor) {
95
    var hexcolor = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
96
        hex: hexstring
97
    };
98
    darkenfactor = darkenfactor || 1;
99
100
    hexstring = hexstring.replace('#', '');
101
    if (hexstring.length === 3) {
102
        hexstring = hexstring[0] + hexstring[0] + hexstring[1] + hexstring[1] + hexstring[2] + hexstring[2];
103
    }
104
    if (isNaN(parseFloat(opacity, 10))) {
105
        opacity = 1;
106
    }
107
108
    hexcolor.r = parseInt(darkenfactor * (parseInt(hexstring.substring(0, 2), 16)), 10);
109
    hexcolor.g = parseInt(darkenfactor * (parseInt(hexstring.substring(2, 4), 16)), 10);
110
    hexcolor.b = parseInt(darkenfactor * (parseInt(hexstring.substring(4, 6), 16)), 10);
111
    hexcolor.a = opacity;
112
    hexcolor.fillColor = rgbaString(hexcolor);
113
    hexcolor.strokeColor = ['rgba(' + parseHalf(hexcolor.r), parseHalf(hexcolor.g), parseHalf(hexcolor.b), hexcolor.a + ')'].join(',');
114
    hexcolor.rgb = hexcolor.fillColor;
115
    return hexcolor;
116
 }
117
118
119
0 ignored issues
show
introduced by
More than 2 blank lines not allowed.
Loading history...
120
 function parseHSL(hslstring, opacity) {
121
    var hslcolor = {},
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
122
        hslcolor_stroke = {},
123
        hslparts = compact(hslstring.split(/hsla?\(|\,|\)|\%/));
124
125
    if (hslparts[3] === undefined) {
126
        hslparts[3] = 1;
127
    }
128
    if (isNaN(parseFloat(opacity, 10))) {
129
        opacity = 1;
130
    }
131
132
    hslcolor.h = hslcolor_stroke.h = parseFloat(hslparts[0], 10);
133
    hslcolor.s = hslcolor_stroke.s = parseFloat(hslparts[1], 10);
134
    hslcolor.l = parseFloat(hslparts[2], 10);
135
    hslcolor.a = hslcolor_stroke.a = parseFloat(opacity * hslparts[3], 10);
136
    hslcolor_stroke.l = parseInt(hslcolor.l / 2, 10);
137
138
139
    hslcolor.fillColor = hslaString(hslcolor);
140
    hslcolor.strokeColor = hslaString(hslcolor_stroke);
141
    hslcolor.hsl = hslcolor.fillColor;
142
    return hslcolor;
143
 };
0 ignored issues
show
introduced by
Unnecessary semicolon.
Loading history...
144
145
 function parseRGB(rgbstring, opacity, darkenfactor) {
146
    var rgbcolor = {},
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
147
        rgbparts = compact(rgbstring.split(/rgba?\(|\,|\)/));
148
149
    darkenfactor = darkenfactor || 1;
150
151
    if (rgbparts[3] === undefined) {
152
        rgbparts[3] = 1;
153
    }
154
155
    if (isNaN(parseFloat(opacity, 10))) {
156
        opacity = 1;
157
    }
158
159
    rgbcolor.r = parseInt(darkenfactor * (parseInt(rgbparts[0], 10) % 256), 10);
160
    rgbcolor.g = parseInt(darkenfactor * (parseInt(rgbparts[1], 10) % 256), 10);
161
    rgbcolor.b = parseInt(darkenfactor * (parseInt(rgbparts[2], 10) % 256), 10);
162
    rgbcolor.a = parseFloat(opacity * rgbparts[3], 10);
163
    rgbcolor.fillColor = rgbaString(rgbcolor);
164
    rgbcolor.strokeColor = 'rgba(' + rgbcolor.r / 2 + ',' + rgbcolor.g / 2 + ',' + rgbcolor.b / 2 + ',' + rgbcolor.a + ')';
165
    rgbcolor.rgb = rgbcolor.fillColor;
166
    return rgbcolor;
167
 }
168
169
 function rgbToHSL(r, g, b, a) {
170
    r = (r % 256) / 255;
171
    g = (g % 256) / 255;
172
    b = (b % 256) / 255;
173
    if (a === undefined) {
174
        a = 1;
175
    }
176
    var max = Math.max(r, g, b),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
177
        min = Math.min(r, g, b);
178
    var h, s, l = (max + min) / 2;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
179
180
    if (max === min) {
181
        h = s = 0; // achromatic
182
    } else {
183
        var d = max - min;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
184
        s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
185
        switch (max) {
186
        case r:
0 ignored issues
show
Bug introduced by
The variable r seems to be never declared. If this is a global, consider adding a /** global: r */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
187
            h = (g - b) / d + (g < b ? 6 : 0);
188
            break;
189
        case g:
0 ignored issues
show
Bug introduced by
The variable g seems to be never declared. If this is a global, consider adding a /** global: g */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
190
            h = (b - r) / d + 2;
191
            break;
192
        case b:
0 ignored issues
show
Bug introduced by
The variable b seems to be never declared. If this is a global, consider adding a /** global: b */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
193
            h = (r - g) / d + 4;
194
            break;
195
        default:
196
            h = 0;
197
            break;
198
        }
199
200
        h /= 6;
201
    }
202
    var hsl = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
203
        h: Math.round(360 * h),
204
        s: Math.round(100 * s),
205
        l: Math.round(100 * l),
206
        a: Math.round(100 * a) / 100
207
    };
208
209
    hsl.fillColor = hslaString(hsl);
210
211
    return hsl;
212
 }
213
214
 function hue2rgb(p, q, t) {
215
    if (t < 0) {
216
        t += 1;
217
    }
218
    if (t > 1) {
219
        t -= 1;
220
    }
221
    if (t < 1 / 6) {
222
        return p + (q - p) * 6 * t;
223
    }
224
    if (t < 1 / 2) {
225
        return q;
226
    }
227
    if (t < 2 / 3) {
228
        return p + (q - p) * (2 / 3 - t) * 6;
229
    }
230
    return p;
231
 }
232
233
 function hslToRGB(h, s, l, a, darkenfactor) {
234
    var r, g, b;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
235
236
    darkenfactor = darkenfactor || 1;
237
    h = parseFloat(h, 10) / 360;
238
    s = parseFloat(s, 10) / 100;
239
    l = parseFloat(l, 10) / 100;
240
    if (a === undefined) {
241
        a = 1;
242
    }
243
    if (s === 0) {
244
        r = g = b = l; // achromatic
245
    } else {
246
247
248
        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
249
        var p = 2 * l - q;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
250
        r = hue2rgb(p, q, h + 1 / 3);
251
        g = hue2rgb(p, q, h);
252
        b = hue2rgb(p, q, h - 1 / 3);
253
    }
254
255
    if (a === undefined) {
256
        a = 1;
257
    }
258
259
    var rgb = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
260
        r: Math.round(r * 255 * darkenfactor),
261
        g: Math.round(g * 255 * darkenfactor),
262
        b: Math.round(b * 255 * darkenfactor),
263
        a: parseFloat(a, 10)
264
    };
265
266
    rgb.fillColor = rgbaString(rgb);
267
268
    return rgb;
269
270
 };
0 ignored issues
show
introduced by
Unnecessary semicolon.
Loading history...
271
272
 function toDecColor(stringcolor) {
273
    var parsedcolor = {};
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
274
    if (!stringcolor) {
275
        parsedcolor.fillColor = 'rgba(100,250,50,0.99)';
276
    } else if (stringcolor.indexOf('rgb') !== -1) {
277
        parsedcolor = parseRGB(stringcolor);
278
    } else if (stringcolor.indexOf('hsl') !== -1) {
279
        parsedcolor = parseHSL(stringcolor);
280
    } else {
281
        parsedcolor = parseHex(stringcolor);
282
    }
283
284
    return parsedcolor;
285
 };
0 ignored issues
show
introduced by
Unnecessary semicolon.
Loading history...
286
287
 var IconObject = function (canvas, markerOpts) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
288
    this.url = canvas.toDataURL();
289
    this.fillColor = canvas.fillColor;
290
    this.markerOpts = markerOpts;
291
    Object.assign(this, markerOpts);
292
    return this;
293
 };
294
 IconObject.prototype.toJSON = function () {
295
    return {
296
        url: null,
297
        markerOpts: this.markerOpts
298
    };
299
 };
300
301
 var createTextMarker = function (theoptions) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
302
303
    var generateCanvas = function (options) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
304
        var canvas = document.createElement("canvas");
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
305
        var ancho = 30,
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
306
            alto = 40;
307
        canvas.width = ancho + 18;
308
        canvas.height = alto;
309
        var x = canvas.width / 2,
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
310
            y = canvas.height - 2,
311
            radius = ancho / 2,
312
            angulo = 0.6;
313
314
        var font = "'" + options.font + "'" || 'Arial';
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
315
        var fontsize = options.fontsize || 11;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
316
317
        var context = canvas.getContext("2d");
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
318
319
        context.clearRect(0, 0, canvas.width, canvas.height);
320
321
        var radius0 = 2 * radius,
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
322
            cx = x + 0.95 * radius0,
323
            cy = y + 0.45 * radius0;
324
325
        var grad = context.createLinearGradient(0, 0, 0, canvas.height),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
326
            colors = getColors(options),
327
            color0 = colors[0],
328
            color1 = colors[1];
329
330
        grad.addColorStop(0, color0);
331
        grad.addColorStop(1, color1);
332
333
        context.fillStyle = grad;
334
        context.strokeStyle = 'rgba(200,200,200,0.7)';
335
336
        context.beginPath();
337
338
        //arco izquierdo
339
        context.arc(cx - 1, cy, radius0, 9 * Math.PI / 8, -6 * Math.PI / 8, false);
340
341
        // arco superior
342
        context.arc(x, (y - 7) / 2, radius, angulo, Math.PI - angulo, true);
343
344
        //arco derecho
345
        context.arc(2 * x - cx + 1, cy, radius0, -0.95 * Math.PI / 3, -Math.PI / 8, false);
346
        context.fill();
347
        context.stroke();
348
349
        context.beginPath();
350
        context.arc(x, 0.40 * y, 2 * radius / 3, 0, 2 * Math.PI, false);
351
        context.fillStyle = 'white';
352
        context.fill();
353
354
        context.beginPath();
355
356
        // Render Label
357
        //context.font = "11pt Arial";
358
        context.font = fontsize + "pt " + font;
359
        context.textBaseline = "top";
360
361
        var textWidth = context.measureText(options.label);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
362
363
        if (textWidth.width > ancho || String(options.label).length > 3) {
364
            context.rect(x - 2 - textWidth.width / 2, y - 30, x - 2 + textWidth.width / 2, y - 23);
365
            context.fillStyle = '#F7F0F0';
366
            context.fill();
367
            context.stroke();
368
        }
369
370
        context.fillStyle = "black";
371
        context.strokeStyle = "black";
372
        // centre the text.
373
        context.fillText(options.label, 1 + Math.floor((canvas.width / 2) - (textWidth.width / 2)), 8);
374
375
        return canvas;
376
377
    };
378
    theoptions.scale = theoptions.scale || 0.75;
379
    var markerCanvas = generateCanvas(theoptions),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
380
        markerOpts = {};
381
382
    theoptions.type = 'textmarker';
383
384
    Object.assign(markerOpts, theoptions);
385
386
    if (window && window.google && window.google.maps) {
387
        Object.assign(markerOpts, {
388
            size: new google.maps.Size(48, 40),
0 ignored issues
show
Bug introduced by
The variable google seems to be never declared. If this is a global, consider adding a /** global: google */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
389
            origin: new google.maps.Point(0, 0),
390
            anchor: new google.maps.Point(24 * theoptions.scale, 40 * theoptions.scale),
391
            scaledSize: new google.maps.Size(48 * theoptions.scale, 40 * theoptions.scale)
392
        });
393
    }
394
    var iconObj = new IconObject(markerCanvas, markerOpts);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
395
396
    return iconObj;
397
 };
398
399
400
0 ignored issues
show
introduced by
More than 2 blank lines not allowed.
Loading history...
401
 var createClusterIcon = function (theoptions) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
402
403
    var generateClusterCanvas = function (options) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
404
        var canvas = options.canvas || document.createElement("canvas"),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
405
            anchorX = 27,
406
            anchorY = 53,
407
            radius = (anchorX - 9),
408
            angulo = 1.1,
0 ignored issues
show
Unused Code introduced by
The variable angulo seems to be never used. Consider removing it.
Loading history...
409
            font = options.font || 'fontello',
410
            fontsize = options.fontsize || 14,
1 ignored issue
show
Unused Code introduced by
The assignment to variable fontsize seems to be never used. Consider removing it.
Loading history...
411
            context = canvas.getContext("2d"),
412
            grad = context.createLinearGradient(0, 0, 0, anchorY);
0 ignored issues
show
Unused Code introduced by
The variable grad seems to be never used. Consider removing it.
Loading history...
413
414
        canvas.width = anchorX * 2;
415
        canvas.height = anchorY + 1;
416
417
        var colors = getColors(options),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
418
            color0 = colors[0],
0 ignored issues
show
Unused Code introduced by
The variable color0 seems to be never used. Consider removing it.
Loading history...
419
            color1 = colors[1];
0 ignored issues
show
Unused Code introduced by
The assignment to variable color1 seems to be never used. Consider removing it.
Loading history...
420
421
422
        context.clearRect(0, 0, canvas.width, canvas.height);
423
        context.moveTo(anchorX, anchorY);
424
425
        var labelvalue = parseInt(options.label);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
introduced by
Missing radix parameter.
Loading history...
426
        if (labelvalue < 10) {
427
            color1 = 'orange';
428
            fontsize = 14;
429
        } else if (labelvalue < 30) {
430
            color1 = 'red';
431
            fontsize = 15;
432
        } else {
433
            color1 = 'purple';
434
            fontsize = 16;
435
        }
436
        if (labelvalue > 99) {
437
            radius = radius + 3;
438
            context.setLineDash([5, 5])
439
            context.beginPath();
440
            context.arc(anchorX, 2 + (0.50 * anchorY), (radius + 7), 0, 2 * Math.PI, false);
441
            context.fillStyle = 'transparent';
442
            context.strokeStyle = color1;
443
            context.lineWidth = 2;
444
            context.fill();
445
            context.stroke();
446
        }
447
448
        context.setLineDash([5, 5])
449
        context.beginPath();
450
        context.arc(anchorX, 2 + (0.50 * anchorY), (radius + 2), 0, 2 * Math.PI, false);
451
        context.fillStyle = 'transparent';
452
        context.strokeStyle = color1;
453
        context.lineWidth = 2;
454
        context.fill();
455
        context.stroke();
456
457
        // Círculo blanco
458
        context.setLineDash([5, 0])
459
        context.beginPath();
460
        context.arc(anchorX, 2 + (0.50 * anchorY), (radius - 3), 0, 2 * Math.PI, false);
461
        context.fillStyle = 'white';
462
        context.strokeStyle = color1;
463
        context.lineWidth = 4;
464
        context.fill();
465
        context.stroke();
466
467
        context.beginPath();
468
469
        context.font = 'normal normal normal ' + fontsize + 'px ' + font;
470
        console.log('context font', context.font);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
471
        context.fillStyle = '#333';
472
        context.textBaseline = "top";
473
        var textWidth = context.measureText(options.label);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
474
475
        // centre the text.
476
        context.fillText(options.label, Math.floor((canvas.width / 2) - (textWidth.width / 2)), 1 + Math.floor(canvas.height / 2 - fontsize / 2));
477
478
        return canvas;
479
480
    };
481
    theoptions.scale = theoptions.scale || 1;
482
    var markerCanvas = generateClusterCanvas(theoptions),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
483
        markerOpts = {},
484
        scale = theoptions.scale;
485
486
    Object.assign(markerOpts, theoptions);
487
488
    if (window && window.google && window.google.maps) {
489
        Object.assign(markerOpts, {
490
            size: new google.maps.Size(54, 48),
0 ignored issues
show
Bug introduced by
The variable google seems to be never declared. If this is a global, consider adding a /** global: google */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
491
            origin: new google.maps.Point(0, 0),
492
            anchor: new google.maps.Point(27 * scale, 24 * scale),
493
            scaledSize: new google.maps.Size(54 * scale, 48 * scale)
494
        });
495
    }
496
497
    var iconObj = new IconObject(markerCanvas, markerOpts);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
498
499
    return iconObj;
500
 };
501
502
 var createFatMarkerIcon = function (theoptions) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
503
504
    var generateFatCanvas = function (options) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
505
        var canvas = options.canvas || document.createElement("canvas"),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
506
            anchorX = 27,
507
            anchorY = 53,
508
            radius = (anchorX - 9),
509
            angulo = 1.1,
510
            font = options.font || 'fontello',
511
            fontsize = options.fontsize || 14,
512
            context = canvas.getContext("2d"),
513
            grad = context.createLinearGradient(0, 0, 0, anchorY);
514
515
        canvas.width = anchorX * 2;
516
        canvas.height = anchorY + 1;
517
518
        var colors = getColors(options),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
519
            color0 = colors[0],
520
            color1 = colors[1];
521
522
        context.clearRect(0, 0, canvas.width, canvas.height);
523
524
        grad.addColorStop(0, color0);
525
        grad.addColorStop(1, color1);
526
527
        context.fillStyle = grad;
528
        context.strokeStyle = color1;
529
        context.beginPath();
530
531
        context.moveTo(anchorX, anchorY);
532
533
        // arco superior
534
        context.arc(anchorX, 2 + (0.50 * anchorY), radius, angulo, Math.PI - angulo, true);
535
536
        //punta inferior
537
        context.lineTo(anchorX, anchorY);
538
539
        context.fill();
540
        context.stroke();
541
542
        // Círculo blanco
543
        context.beginPath();
544
        context.arc(anchorX, 2 + (0.50 * anchorY), (radius - 3), 0, 2 * Math.PI, false);
545
        context.fillStyle = 'white';
546
        context.fill();
547
548
        context.beginPath();
549
550
        context.font = 'normal normal normal ' + fontsize + 'px ' + font;
551
        //console.log('context font', context.font);
552
        context.fillStyle = color1;
553
        context.textBaseline = "top";
554
        var textWidth = context.measureText(options.unicodelabel);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
555
556
        // centre the text.
557
        context.fillText(options.unicodelabel, Math.floor((canvas.width / 2) - (textWidth.width / 2)), 1 + Math.floor(canvas.height / 2 - fontsize / 2));
0 ignored issues
show
Coding Style introduced by
This line exceeds the maximum configured line length of 150.
Loading history...
558
        canvas.fillColor = color0;
559
        return canvas;
560
561
    };
562
    var scale = theoptions.scale || 1,
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
563
        markerCanvas = generateFatCanvas(theoptions),
564
        markerOpts = {};
565
566
    theoptions.type = 'fatmarker';
567
568
    Object.assign(markerOpts, theoptions);
569
570
    if (window && window.google && window.google.maps) {
571
        Object.assign(markerOpts, {
572
            size: new google.maps.Size(54, 48),
0 ignored issues
show
Bug introduced by
The variable google seems to be never declared. If this is a global, consider adding a /** global: google */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
573
            origin: new google.maps.Point(0, 0),
574
            anchor: new google.maps.Point(21 * scale, 36 * scale),
575
            scaledSize: new google.maps.Size(42 * scale, 36 * scale),
576
            scale: scale
577
        });
578
    }
579
    var iconObj = new IconObject(markerCanvas, markerOpts);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
580
    return iconObj;
581
 };
582
583
 var createTransparentMarkerIcon = function (theoptions) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
584
585
    var generateTransparentCanvas = function (options) {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
586
        var canvas = options.canvas || document.createElement("canvas"),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
587
            context = canvas.getContext("2d"),
588
            font = options.font || 'fontello',
589
            fontsize = options.fontsize || 26;
590
591
        canvas.width = 54;
592
        canvas.height = 48;
593
        context.clearRect(0, 0, canvas.width, canvas.height);
594
595
        /*context.rect(1, 1, canvas.width - 2, canvas.height - 2);
596
        context.lineWidth = 1;
597
        context.strokeStyle = 'black';
598
        context.stroke();*/
599
600
        var colors = getColors(options),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
601
            color0 = colors[0],
602
            color1 = colors[1];
603
        context.beginPath();
604
605
        if (options.shadow) {
606
607
            context.font = 'normal normal normal ' + fontsize + 'px ' + font;
608
609
            context.textBaseline = "top";
610
            var textWidth = context.measureText(options.unicodelabel),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
611
                text_x = Math.floor((canvas.width / 2) - (textWidth.width / 2));
612
613
            context.shadowOffsetX = -2;
614
            context.shadowOffsetY = -2;
615
            context.shadowBlur = 0;
616
617
            context.fillStyle = '#FFFFFF';
618
            context.shadowColor = '#666666';
619
620
            context.fillText(options.unicodelabel, text_x - 4, 2);
621
            context.fillText(options.unicodelabel, text_x, 5);
622
            context.fillStyle = color0;
623
            context.fillText(options.unicodelabel, text_x + 4, 8);
624
625
            context.strokeStyle = '#FFFFFF';
626
            context.strokeText(options.unicodelabel, text_x + 4, 8);
627
628
        } else {
629
630
            context.font = 'normal normal normal ' + (fontsize - 3) + 'px ' + font;
631
632
            context.textBaseline = "top";
633
            var textmetric = context.measureText(options.unicodelabel),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
634
                text_x = Math.floor((canvas.width / 2) - (textmetric.width / 2));
0 ignored issues
show
Comprehensibility Naming Best Practice introduced by
The variable text_x already seems to be declared on line 611. Consider using another variable name or omitting the var keyword.

This check looks for variables that are declared in multiple lines. There may be several reasons for this.

In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.

If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.

Loading history...
introduced by
"text_x" is already defined
Loading history...
635
636
            //console.debug('textmetric', textmetric);
637
638
            context.shadowOffsetX = 2;
639
            context.shadowOffsetY = 2;
640
            context.shadowBlur = 0;
641
            context.shadowColor = '#FFFFFF';
642
            context.fillStyle = color0;
643
            context.fillText(options.unicodelabel, text_x + 1, 6);
644
645
            context.shadowOffsetX = 2;
646
            context.shadowOffsetY = 2;
647
            context.shadowBlur = 1;
648
            context.shadowColor = '#FFFFFF';
649
            context.strokeStyle = color1;
650
            context.strokeText(options.unicodelabel, text_x + 1, 6);
651
652
        }
653
654
        canvas.fillColor = color0;
655
656
        return canvas;
657
658
    };
659
660
    theoptions.scale = theoptions.scale || 1;
661
    theoptions.fontsize = theoptions.fontsize || 26;
662
663
    var markerCanvas = generateTransparentCanvas(theoptions),
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
664
        markerOpts = {};
665
666
    var scale = theoptions.scale;
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
667
    /*if (theoptions.shadow) {
668
        scale = 0.9 * scale;
669
    }*/
670
    theoptions.type = 'transparent';
671
672
    Object.assign(markerOpts, theoptions);
673
674
    if (window.google && window.google.maps) {
675
        Object.assign(markerOpts, {
676
            size: new google.maps.Size(54 * scale, 48 * scale),
0 ignored issues
show
Bug introduced by
The variable google seems to be never declared. If this is a global, consider adding a /** global: google */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
677
            origin: new google.maps.Point(0, 0),
678
            anchor: new google.maps.Point(27 * scale, 24 * scale),
679
            scaledSize: new google.maps.Size(54 * scale, 48 * scale)
680
        });
681
    }
682
    var iconObj = new IconObject(markerCanvas, markerOpts);
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
683
684
    return iconObj;
685
 };
686
687
688
689
0 ignored issues
show
introduced by
More than 2 blank lines not allowed.
Loading history...
690
 var MarkerFactory = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
691
    createTransparentMarkerIcon: createTransparentMarkerIcon,
692
    createFatMarkerIcon: createFatMarkerIcon,
693
    createTextMarker: createTextMarker,
694
    /**
695
     * Receives a color string rgb(a), hsl(a) or hex, returns its components
696
     * in rgba and hsla, with optional transparency
697
     * plus a darkened version (default is half of each RGB component) and a 
0 ignored issues
show
introduced by
Trailing spaces not allowed.
Loading history...
698
     *
699
     * @param {string} somecolor          - A color string in  rgb(a), hsl(a) or hex format
700
     * @param {Number} [opacity=1]        - Opacity to apply to the color
0 ignored issues
show
Documentation Bug introduced by
The parameter opacity=1 does not exist. Did you maybe mean opacity instead?
Loading history...
701
     * @param {Number} [darkenfactor=1] - How much darker should the resulting color be
0 ignored issues
show
Documentation Bug introduced by
The parameter darkenfactor=1 does not exist. Did you maybe mean darkenfactor instead?
Loading history...
702
     * 
0 ignored issues
show
introduced by
Trailing spaces not allowed.
Loading history...
703
     * @return     {Object}  input color parsed and modified as requested
704
     */
705
    parseColorString: function (somecolor, opacity, darkenfactor) {
706
        var parsedcolor = {
0 ignored issues
show
Coding Style introduced by
As per coding-style, prefer block-scoped variables using let or const which have better semantics than var.

Since ECMAScript 6, you can create block-scoped vars or constants with the keywords let or const. These variables/constants are only valid in the code block where they have been declared.

Consider the following two pieces of code:

if (true)
 {
    var x = "Hello, Stonehenge!";
}

console.log(x); //prints Hello, Stonehenge! to the console

and

if (true)
 {
    let x = "Hello, Stonehenge!";
}

console.log(x); //ReferenceError: x is not defined

The variable is not defined otuside of its block. This limits bleeding of variables into other contexts.

To know more about this ECMA6 feature, look at the MDN pages on let and const.

Loading history...
707
                original: somecolor
708
            },
709
            hsl, rgb;
710
711
        darkenfactor = darkenfactor || 1;
712
        opacity = opacity || 1;
713
714
        if (somecolor.indexOf('hsl') !== -1) {
715
            hsl = parseHSL(somecolor, opacity);
716
            rgb = hslToRGB(hsl.h, hsl.s, hsl.l, hsl.a, darkenfactor);
717
718
        } else {
719
            if (somecolor.indexOf('rgb') !== -1) {
0 ignored issues
show
introduced by
Unexpected if as the only statement in an else block.
Loading history...
720
                rgb = parseRGB(somecolor, opacity, darkenfactor);
721
            } else {
722
                rgb = parseHex(somecolor, opacity, darkenfactor);
723
            }
724
725
726
        }
727
728
729
        hsl = rgbToHSL(rgb.r, rgb.g, rgb.b, rgb.a);
730
731
732
        parsedcolor.hsl = {
733
            h: hsl.h,
734
            s: hsl.s,
735
            l: hsl.l,
736
            a: hsl.a
737
        };
738
        parsedcolor.rgb = {
739
            r: rgb.r,
740
            g: rgb.g,
741
            b: rgb.b,
742
            a: rgb.a
743
        };
744
745
746
0 ignored issues
show
introduced by
More than 2 blank lines not allowed.
Loading history...
747
        parsedcolor.fillColor = rgb.fillColor;
748
        parsedcolor.rgba = rgb.fillColor;
749
        parsedcolor.hsla = hsl.fillColor;
750
        parsedcolor.strokeColor = rgb.strokeColor;
751
        parsedcolor.hex = ['#', padHex(rgb.r.toString(16)), padHex(rgb.g.toString(16)), padHex(rgb.b.toString(16))].join('');
752
        return parsedcolor;
753
    },
754
    /**
755
     * Generates an google maps marker (or an image as dataurl from the given options)
756
     *
757
     * @param      {Object}  options  The options
758
     * @return     {Object}  { description_of_the_return_value }
759
     */
760
    autoIcon: function (options) {
761
762
        if (typeof (options) !== 'object') {
763
            console.warn('autoIcon expects an object as its only parameter');
764
            return null;
765
        }
766
767
        options.label = String(options.label || 'A');
768
        options.color = options.color || '#FF0000';
769
770
        // unless explicitly set to false, the icon doesn't have a marker-like wrapper
771
        if (options.transparent_background === undefined) {
772
            options.transparent_background = true;
773
        }
774
775
        if (options.label.length === 4 || options.label.substring(0, 2) === '0x') {
776
777
778
            options.font = options.font || 'fontello';
779
            options.label = (options.label || 'e836').slice(-4);
780
            options.unicodelabel = String.fromCharCode('0x' + options.label);
781
            options.scale = options.scale || 1;
782
783
            if (options.transparent_background) {
784
                console.log('createTransparentMarkerIcon', options.font);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
785
                return MarkerFactory.createTransparentMarkerIcon(options);
786
            } else {
787
                console.log('createFatMarkerIcon', options.font);
788
                return MarkerFactory.createFatMarkerIcon(options);
789
            }
790
        } else if (options.shadow) {
791
            return createClusterIcon(options);
792
        } else {
793
            options.scale = options.scale || 0.75;
794
            options.label = String(options.label || 'A');
795
            options.fontsize = options.fontsize || 11;
796
            options.font = options.font || 'Arial';
797
            // This is text I should print literally
798
            return MarkerFactory.createTextMarker(options);
799
        }
800
801
    }
802
 };
803
804
805
 export {
806
    MarkerFactory
807
 };
808
 export default MarkerFactory;
0 ignored issues
show
Coding Style introduced by
As per coding-style, please add a newline (\n) at the end of the file.
Loading history...