Total Complexity | 6 |
Complexity/F | 2 |
Lines of Code | 37 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import { omit } from "./helpers.js"; |
||
2 | |||
3 | function IconObject(url, fillColor, markerOpts) { |
||
4 | this.url = url; |
||
5 | this.fillColor = fillColor; |
||
6 | this.markerOpts = markerOpts; |
||
7 | Object.assign(this, markerOpts); |
||
8 | if (window && window.google && window.google.maps) { |
||
9 | this.origin = new google.maps.Point( |
||
|
|||
10 | this.markerOpts.origin.x, |
||
11 | this.markerOpts.origin.y |
||
12 | ); |
||
13 | this.anchor = new google.maps.Point( |
||
14 | this.markerOpts.anchor.x, |
||
15 | this.markerOpts.anchor.y |
||
16 | ); |
||
17 | this.size = new google.maps.Size( |
||
18 | this.markerOpts.size.width, |
||
19 | this.markerOpts.size.height |
||
20 | ); |
||
21 | this.scaledSize = new google.maps.Size( |
||
22 | this.markerOpts.scaledSize.width, |
||
23 | this.markerOpts.scaledSize.height |
||
24 | ); |
||
25 | } |
||
26 | return this; |
||
27 | } |
||
28 | |||
29 | IconObject.prototype.toJSON = function() { |
||
30 | var serialized = omit(this.markerOpts, function(prop) { |
||
31 | return prop.indexOf("gm_") === 0 || prop === "url"; |
||
32 | }); |
||
33 | serialized.fillColor = this.fillColor; |
||
34 | return serialized; |
||
35 | }; |
||
36 | |||
37 | export { IconObject }; |
||
38 |
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.