guanqb
2023-04-12 3d0eb36471cfc8f6e3e72d10600be4e255e3db13
src/views/activity/components/videoControlBox.vue
@@ -179,6 +179,8 @@
    mounted () {
        this.$nextTick(() => {
            tc = new global.DC.TrackController(global.viewer)
        })
    },
@@ -188,18 +190,19 @@
         * @return {*}
         */
        watchVideo (linePosition, polygonPosition) {
            const that = this
            const line = this.$turf.lineString(linePosition.split(';').filter(item => item != '').map(item => item.split(',').map(i => Number(i))))
            // const lineLength = this.$turf.length(line) * 1000
            const chunkLine = this.$turf.lineChunk(line, 0.1)
            console.log('chunkLine', chunkLine)
            let arr = chunkLine.features.reduce((pre, cur) =>
                pre.concat(cur.geometry.coordinates)
                , []).map(item => item.join(','))
            const time = arr.filter(item => arr.indexOf(item) == arr.lastIndexOf(item)).length * 16
            const newPostion = arr.filter((item, index) => index == arr.lastIndexOf(item)).join(';')
            console.log('arr', arr, 'time', time, 'newPostion', newPostion)
            this.getRegionList(polygonPosition)
            this.videoShow = true