From 5225812590dfe1ab3128faa01b147ea3e5873e0e Mon Sep 17 00:00:00 2001 From: Marco Curatitoli Date: Tue, 6 Dec 2022 15:19:35 +0100 Subject: [PATCH 1/2] added emits to polyline.js It allows to emits events without warning --- src/components/polyline.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/polyline.js b/src/components/polyline.js index 112c52b..841575f 100644 --- a/src/components/polyline.js +++ b/src/components/polyline.js @@ -43,9 +43,15 @@ export default buildComponent({ name: 'polyline', ctr: () => google.maps.Polyline, - - afterCreate() { + emits: events, + afterCreate(inst) { let clearEvents = () => {} + + events.forEach((event)=> { + inst.addListener(event, (payload)=> { + this.$emit(event, payload) + }); + }) this.$watch( 'path', From 8477d4c0486c9bc3344e21bf152838cfa4407d7c Mon Sep 17 00:00:00 2001 From: Marco Curatitoli Date: Fri, 9 Dec 2022 12:30:42 +0100 Subject: [PATCH 2/2] added emits to polygon --- src/components/polygon.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/polygon.js b/src/components/polygon.js index 11eac40..1a31073 100644 --- a/src/components/polygon.js +++ b/src/components/polygon.js @@ -47,7 +47,7 @@ export default buildComponent({ mappedProps: props, name: 'polygon', ctr: () => google.maps.Polygon, - + emits: events, beforeCreate(options) { if (!options.path) delete options.path if (!options.paths) delete options.paths @@ -55,6 +55,12 @@ export default buildComponent({ afterCreate(inst) { let clearEvents = () => {} + + events.forEach((event)=> { + inst.addListener(event, (payload)=> { + this.$emit(event, payload) + }); + }) // Watch paths, on our own, because we do not want to set either when it is // empty