kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Report map session only on first actual map load per application init
rodzic
3040dbad3e
commit
4214371ff8
|
@ -17,7 +17,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import { MglMap, MglGeolocateControl, MglNavigationControl, MglScaleControl, MglAttributionControl } from 'vue-mapbox'
|
||||
import MapRoute from './MapRoute.vue'
|
||||
import MapPhoto from './MapPhoto.vue'
|
||||
|
@ -27,6 +26,7 @@ import MapWebcams from './MapWebcams.vue'
|
|||
import mapstyle from '../mixins/mapstyle.js'
|
||||
import utils from '../mixins/utils.js'
|
||||
import longtouch from '../mixins/longtouch.js'
|
||||
import reportMapSession from '../mapsession.js'
|
||||
|
||||
export default {
|
||||
name: 'MiniMap',
|
||||
|
@ -173,7 +173,7 @@ export default {
|
|||
}
|
||||
this.highlightCurrentSummit()
|
||||
|
||||
axios.post(process.env.VUE_APP_API_URL + '/mapsession', { type: 'mini' })
|
||||
reportMapSession()
|
||||
},
|
||||
onMapClicked (event) {
|
||||
if (event.mapboxEvent.originalEvent.hitMarker) {
|
||||
|
|
|
@ -100,8 +100,6 @@ axios.interceptors.response.use(response => {
|
|||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
axios.post(process.env.VUE_APP_API_URL + '/mapsession', { type: 'init' })
|
||||
|
||||
function startVue () {
|
||||
new Vue({
|
||||
store,
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import axios from 'axios'
|
||||
|
||||
let mapSessionReported = false
|
||||
|
||||
function reportMapSession () {
|
||||
if (mapSessionReported) {
|
||||
return
|
||||
}
|
||||
axios.post(process.env.VUE_APP_API_URL + '/mapsession', { type: 'first' })
|
||||
mapSessionReported = true
|
||||
}
|
||||
|
||||
export default reportMapSession
|
|
@ -45,6 +45,7 @@ import utils from '../mixins/utils.js'
|
|||
import smptracks from '../mixins/smptracks.js'
|
||||
import mapstyle from '../mixins/mapstyle.js'
|
||||
import longtouch from '../mixins/longtouch.js'
|
||||
import reportMapSession from '../mapsession.js'
|
||||
|
||||
import { MglMap, MglPopup, MglNavigationControl, MglGeolocateControl, MglScaleControl, MglAttributionControl } from 'vue-mapbox'
|
||||
import MapFilterControl from '../components/MapFilterControl.vue'
|
||||
|
@ -248,7 +249,7 @@ export default {
|
|||
})
|
||||
this.updateRoute()
|
||||
|
||||
axios.post(process.env.VUE_APP_API_URL + '/mapsession', { type: 'main' })
|
||||
reportMapSession()
|
||||
},
|
||||
onMapClicked (event) {
|
||||
if (this.$refs.draw.isDrawing() || event.mapboxEvent.originalEvent.hitMarker) {
|
||||
|
|
Ładowanie…
Reference in New Issue