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 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',