File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change 35
35
options: {
36
36
type: Object ,
37
37
default : () => {}
38
+ },
39
+ debug: {
40
+ type: Boolean ,
41
+ default: false
38
42
}
39
43
},
40
44
mounted () {
45
+ if (this .debug ) {
46
+ console .log (' mounted' )
47
+ }
41
48
this .$nextTick (() => {
42
49
this .hg = L .control .heightgraph ({... this .options ,... {
43
50
// merges quick settings with options if they are defined
48
55
})
49
56
},
50
57
beforeDestroy () {
58
+ if (this .debug ) {
59
+ console .log (' beforeDestroy' )
60
+ }
51
61
if (this .hg ) {
52
62
this .hg .remove ()
53
63
}
54
64
},
55
65
methods: {
56
66
updateGraph () {
67
+ if (this .debug ) {
68
+ console .log (' updateGraph' )
69
+ }
57
70
if (this .hg ) {
58
71
this .hg .remove ()
59
72
}
60
73
const map = this .$parent .mapObject
61
- this .hg .addTo (map)
62
- let p = Object .keys (this .availableParsers ).includes (this .parser ) ? this .parser : ' normal'
63
- let dataCollections = this .availableParsers [p](this .data )
64
- this .hg .addData (dataCollections)
74
+ let dataCollections = null ;
75
+ try {
76
+ this .hg .addTo (map)
77
+ let p = Object .keys (this .availableParsers ).includes (this .parser ) ? this .parser : ' normal'
78
+
79
+ dataCollections = this .availableParsers [p](this .data )
80
+ this .hg .addData (dataCollections)
81
+ } catch (err) {
82
+ console .log (' Error in updateGraph: ' )
83
+ console .log (err)
84
+ console .log (' data' , this .data )
85
+ console .log (' dataCollections' , dataCollections)
86
+ }
65
87
}
66
88
},
67
89
watch: {
68
90
data : function () {
91
+ if (this .debug ) {
92
+ console .log (' watch.data' )
93
+ }
69
94
if (! this .data && this .hg ) {
70
95
this .hg .remove ()
71
96
} else {
You can’t perform that action at this time.
0 commit comments