Skip to content

Commit

Permalink
fix issues with vl-overlay (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghettovoice committed Oct 18, 2018
1 parent de4956a commit ebfcb3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/component/map/view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@
const watch = {
center (value) {
if (this.$view && !this.$view.getAnimating() && !isEqual(value, this.viewCenter)) {
this.$view.setCenter(this.pointToViewProj(value))
value = this.pointToViewProj(value)
if (this.$view && !this.$view.getAnimating() && !isEqual(value, this.viewCenterViewProj)) {
this.$view.setCenter(value)
}
},
resolution (value) {
Expand Down
19 changes: 9 additions & 10 deletions src/component/overlay/overlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :id="[$options.name, id].join('-')" :class="$options.name" style="display: none !important;">
<div :id="[$options.name, id].join('-')" :class="$options.name">
<slot :id="id" :position="position" :offset="offset" :positioning="positioning"/>
</div>
</template>
Expand Down Expand Up @@ -56,10 +56,7 @@
type: Number,
default: 20,
},
autoPanAnimation: {
type: Object,
default: () => ({ duration: 300 }),
},
autoPanAnimation: Object,
}
/**
Expand Down Expand Up @@ -106,10 +103,11 @@
mount () {
hasOverlay(this)
this.$overlay.setElement(this.$el)
this.$overlaysContainer && this.$overlaysContainer.addOverlay(this.$overlay)
// reset position to trigger panIntoView
this.$nextTick(() => {
this.$overlay.setElement(this.$el.children[0])
this.$overlay.setPosition(this.pointToViewProj(this.position))
this.$overlay.setPosition(this.positionViewProj.slice())
})
this.subscribeAll()
},
Expand Down Expand Up @@ -140,8 +138,9 @@
}
},
position (value) {
if (this.$overlay && !isEqual(value, this.positionDataProj)) {
this.$overlay.setPosition(this.pointToViewProj(value))
value = this.pointToViewProj(value)
if (this.$overlay && !isEqual(value, this.positionViewProj)) {
this.$overlay.setPosition(value)
}
},
positioning (value) {
Expand Down Expand Up @@ -200,7 +199,7 @@
function subscribeToOverlayChanges () {
hasOverlay(this)
const ft = 100
const ft = 1000 / 60
const changes = mergeObs(
observableFromOlChangeEvent(this.$overlay, 'position', true, ft,
() => this.pointToDataProj(this.$overlay.getPosition())),
Expand Down

0 comments on commit ebfcb3d

Please sign in to comment.