Merge pull request #44 from halservice/main
added emits to polyline and polygon objects
This commit is contained in:
@@ -47,7 +47,7 @@ export default buildComponent({
|
|||||||
mappedProps: props,
|
mappedProps: props,
|
||||||
name: 'polygon',
|
name: 'polygon',
|
||||||
ctr: () => google.maps.Polygon,
|
ctr: () => google.maps.Polygon,
|
||||||
|
emits: events,
|
||||||
beforeCreate(options) {
|
beforeCreate(options) {
|
||||||
if (!options.path) delete options.path
|
if (!options.path) delete options.path
|
||||||
if (!options.paths) delete options.paths
|
if (!options.paths) delete options.paths
|
||||||
@@ -56,6 +56,12 @@ export default buildComponent({
|
|||||||
afterCreate(inst) {
|
afterCreate(inst) {
|
||||||
let clearEvents = () => {}
|
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
|
// Watch paths, on our own, because we do not want to set either when it is
|
||||||
// empty
|
// empty
|
||||||
this.$watch(
|
this.$watch(
|
||||||
|
|||||||
@@ -43,10 +43,16 @@ export default buildComponent({
|
|||||||
|
|
||||||
name: 'polyline',
|
name: 'polyline',
|
||||||
ctr: () => google.maps.Polyline,
|
ctr: () => google.maps.Polyline,
|
||||||
|
emits: evants,
|
||||||
afterCreate() {
|
afterCreate(inst) {
|
||||||
let clearEvents = () => {}
|
let clearEvents = () => {}
|
||||||
|
|
||||||
|
events.forEach((event)=> {
|
||||||
|
inst.addListener(event, (payload)=> {
|
||||||
|
this.$emit(event, payload)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
this.$watch(
|
this.$watch(
|
||||||
'path',
|
'path',
|
||||||
(path) => {
|
(path) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user