allow MapZoom parent to get svg size data
This commit is contained in:
@@ -21,6 +21,7 @@ export default {
|
|||||||
name: 'MapZoom',
|
name: 'MapZoom',
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
value: { type: Object, default: () => ({ width: undefined, height: undefined }) },
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
minZoom: { type: Number, default: 0.3 },
|
minZoom: { type: Number, default: 0.3 },
|
||||||
maxZoom: { type: Number, default: 1 }
|
maxZoom: { type: Number, default: 1 }
|
||||||
@@ -49,6 +50,7 @@ export default {
|
|||||||
updateSize () {
|
updateSize () {
|
||||||
const { width, height } = this.$el.getBoundingClientRect()
|
const { width, height } = this.$el.getBoundingClientRect()
|
||||||
Object.assign(this.$data, { width, height })
|
Object.assign(this.$data, { width, height })
|
||||||
|
this.$emit('input', { width, height })
|
||||||
},
|
},
|
||||||
|
|
||||||
onZoom (direction) {
|
onZoom (direction) {
|
||||||
@@ -76,6 +78,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
cursor: grab;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user