File tree Expand file tree Collapse file tree 5 files changed +25
-32
lines changed Expand file tree Collapse file tree 5 files changed +25
-32
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,19 @@ const props = {
4
4
options : {
5
5
type : Object ,
6
6
twoWay : false ,
7
- default : ( ) => {
8
- } ,
7
+ default : ( ) => { } ,
9
8
} ,
10
9
data : {
11
10
type : Array ,
12
- twoWay : true
11
+ twoWay : true ,
13
12
} ,
14
13
}
15
14
16
- const events = [ ] ;
15
+ const events = [ ]
17
16
18
17
export default buildComponent ( {
19
18
mappedProps : props ,
20
19
name : 'heatmap' ,
21
20
ctr : ( ) => google . maps . visualization . HeatmapLayer ,
22
21
events,
23
22
} )
24
-
25
-
Original file line number Diff line number Diff line change @@ -67,14 +67,16 @@ export default buildComponent({
67
67
this .$infoWindowObject .close ()
68
68
if (this .opened ) {
69
69
this .$infoWindowObject .open (this .$map , this .$markerObject )
70
- } else {
71
- this .$emit (' closeclick' )
72
70
}
73
71
},
74
72
},
75
73
76
74
afterCreate () {
77
75
this ._openInfoWindow ()
76
+ this .$infoWindowObject .addListener (' closeclick' , () => {
77
+ this .$emit (' closeclick' )
78
+ this .$infoWindowObject .open (this .$map , this .$markerObject )
79
+ })
78
80
this .$watch (' opened' , () => {
79
81
this ._openInfoWindow ()
80
82
})
Original file line number Diff line number Diff line change
1
+
1
2
import buildComponent from './build-component.js'
2
3
3
4
const props = {
@@ -34,6 +35,7 @@ const events = [
34
35
'mouseover' ,
35
36
'mouseup' ,
36
37
'rightclick' ,
38
+ 'paths_changed' ,
37
39
]
38
40
39
41
export default buildComponent ( {
@@ -43,20 +45,23 @@ export default buildComponent({
43
45
default : false ,
44
46
} ,
45
47
} ,
46
- mappedProps : props ,
47
48
events,
48
- emits : events ,
49
-
49
+ mappedProps : props ,
50
50
name : 'polygon' ,
51
51
ctr : ( ) => google . maps . Polygon ,
52
-
52
+ emits : events ,
53
53
beforeCreate ( options ) {
54
54
if ( ! options . path ) delete options . path
55
55
if ( ! options . paths ) delete options . paths
56
56
} ,
57
57
58
58
afterCreate ( inst ) {
59
59
let clearEvents = ( ) => { }
60
+ events . forEach ( ( event ) => {
61
+ inst . addListener ( event , ( payload ) => {
62
+ this . $emit ( event , payload )
63
+ } )
64
+ } )
60
65
61
66
// Watch paths, on our own, because we do not want to set either when it is
62
67
// empty
@@ -128,11 +133,5 @@ export default buildComponent({
128
133
immediate : true ,
129
134
}
130
135
)
131
-
132
- events . forEach ( ( event ) => {
133
- inst . addListener ( event , ( payload ) => {
134
- this . $emit ( event , payload )
135
- } )
136
- } )
137
136
} ,
138
137
} )
Original file line number Diff line number Diff line change @@ -32,26 +32,27 @@ const events = [
32
32
]
33
33
34
34
export default buildComponent ( {
35
+ mappedProps : props ,
35
36
props : {
36
37
deepWatch : {
37
38
type : Boolean ,
38
39
default : false ,
39
40
} ,
40
41
} ,
41
- mappedProps : props ,
42
42
events,
43
- emits : events ,
44
43
45
44
name : 'polyline' ,
46
45
ctr : ( ) => google . maps . Polyline ,
47
-
48
- beforeCreate ( options ) {
49
- if ( ! options . path ) delete options . path
50
- } ,
51
-
46
+ emits : events ,
52
47
afterCreate ( inst ) {
53
48
let clearEvents = ( ) => { }
54
49
50
+ events . forEach ( ( event ) => {
51
+ inst . addListener ( event , ( payload ) => {
52
+ this . $emit ( event , payload )
53
+ } )
54
+ } )
55
+
55
56
this . $watch (
56
57
'path' ,
57
58
( path ) => {
@@ -83,11 +84,5 @@ export default buildComponent({
83
84
immediate : true ,
84
85
}
85
86
)
86
-
87
- events . forEach ( ( event ) => {
88
- inst . addListener ( event , ( payload ) => {
89
- this . $emit ( event , payload )
90
- } )
91
- } )
92
87
} ,
93
88
} )
Original file line number Diff line number Diff line change @@ -45,5 +45,5 @@ export default buildComponent({
45
45
this . $emit ( event , payload )
46
46
} )
47
47
} )
48
- }
48
+ }
49
49
} )
You can’t perform that action at this time.
0 commit comments