Skip to content

Commit

Permalink
feat(ors-l-polyline): do not show route popup on new route when in lo…
Browse files Browse the repository at this point in the history
…w resolution or mobile devices

do not show route details popup when a new route is calculated when in low resolution or mobile
devices
  • Loading branch information
amoncaldas committed Aug 2, 2021
1 parent 557c64f commit 9374d22
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/fragments/map-view/components/ors-l-polyline/ors-l-polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import OrsExtendedPolyline from './ors-extended-polyline'
import { LPolyline, LTooltip, LPopup} from 'vue2-leaflet'
import constants from '@/resources/constants'
import GeoUtils from '@/support/geo-utils'
import Utils from '@/support/utils'
import theme from '@/config/theme'
import store from '@/store/store'
import lodash from 'lodash'
Expand Down Expand Up @@ -75,6 +76,14 @@ export default {
},
route: {
handler: function (newVal, oldVal) {
this.openPopupWhenRouteChange(newVal, oldVal)
},
deep: true
}
},
methods: {
openPopupWhenRouteChange (newVal, oldVal) {
if (this.$mdAndUpResolution && !Utils.isMobile()) {
this.active = false
let context = this
if (JSON.stringify(newVal.geometry.coordinates) !== JSON.stringify(oldVal.geometry.coordinates)) {
Expand All @@ -83,11 +92,8 @@ export default {
context.updatePopup()
}, 100)
}
},
deep: true
}
},
methods: {
}
},
addStopViaPolylineDrag (data) {
this.$emit('addStopViaPolylineDrag', data)
},
Expand Down Expand Up @@ -228,6 +234,8 @@ export default {
}
},
mounted() {
this.updatePopup()
if (this.$mdAndUpResolution && !Utils.isMobile()) {
this.updatePopup()
}
},
}

0 comments on commit 9374d22

Please sign in to comment.