Update dependencies and improve build system

This commit is contained in:
Fawad Mirzad
2021-02-13 17:30:46 +01:00
parent 04431e1b39
commit 9a20c42459
57 changed files with 8395 additions and 1064 deletions

View File

@@ -2,13 +2,90 @@
<template>
<div>
<div ref="flyaway"> <!-- so named because it will fly away to another component -->
<slot>
</slot>
<div ref="flyaway">
<!-- so named because it will fly away to another component -->
<slot> </slot>
</div>
</div>
</template>
<script>
export default (function (x) { return x.default || x })(require('./infoWindowImpl.js'))
import mapElementFactory from './mapElementFactory.js'
const props = {
options: {
type: Object,
required: false,
default() {
return {}
},
},
position: {
type: Object,
twoWay: true,
},
zIndex: {
type: Number,
twoWay: true,
},
}
const events = ['domready', 'closeclick', 'content_changed']
export default mapElementFactory({
mappedProps: props,
events,
name: 'infoWindow',
ctr: () => google.maps.InfoWindow,
props: {
opened: {
type: Boolean,
default: true,
},
},
inject: {
$markerPromise: {
default: null,
},
},
mounted() {
const el = this.$refs.flyaway
el.parentNode.removeChild(el)
},
beforeCreate(options) {
options.content = this.$refs.flyaway
if (this.$markerPromise) {
delete options.position
return this.$markerPromise.then((mo) => {
this.$markerObject = mo
return mo
})
}
},
methods: {
_openInfoWindow() {
if (this.opened) {
if (this.$markerObject !== null) {
this.$infoWindowObject.open(this.$map, this.$markerObject)
} else {
this.$infoWindowObject.open(this.$map)
}
} else {
this.$infoWindowObject.close()
}
},
},
afterCreate() {
this._openInfoWindow()
this.$watch('opened', () => {
this._openInfoWindow()
})
},
})
</script>