优化航次地图航迹显示交互逻辑
This commit is contained in:
parent
8ee0db5f3a
commit
1dadfc0b6b
|
|
@ -76,7 +76,7 @@ import PieChart from './components/PieChart.vue'
|
||||||
import { reportList, shipTotal, shipUnit, shipUnitYear, shipVoyage } from '../../api/statistics'
|
import { reportList, shipTotal, shipUnit, shipUnitYear, shipVoyage } from '../../api/statistics'
|
||||||
import { getYearRange, filterDictItems } from '../../utils/index'
|
import { getYearRange, filterDictItems } from '../../utils/index'
|
||||||
import { initMapbox } from '@/utils/mapbox-utils'
|
import { initMapbox } from '@/utils/mapbox-utils'
|
||||||
import { loadVectorLayer, loadJsonPointFeature, showUnitReport } from '@/utils/vector-layer-utils'
|
import { setMapLayoutProperty, loadVectorLayer, loadJsonPointFeature, showUnitReport } from '@/utils/vector-layer-utils'
|
||||||
import { ColorGenerator } from '@/utils/color-generator'
|
import { ColorGenerator } from '@/utils/color-generator'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -171,7 +171,6 @@ export default {
|
||||||
// 选择科考船
|
// 选择科考船
|
||||||
handleCommand(command) {
|
handleCommand(command) {
|
||||||
this.currentTitle = command
|
this.currentTitle = command
|
||||||
// this.removeSingleLineImg()
|
|
||||||
if (command === '全部科考船') {
|
if (command === '全部科考船') {
|
||||||
this.getShipList()
|
this.getShipList()
|
||||||
this.gitShipVoyage()
|
this.gitShipVoyage()
|
||||||
|
|
@ -243,13 +242,7 @@ export default {
|
||||||
shipVoyage(params).then(res => {
|
shipVoyage(params).then(res => {
|
||||||
if (params.start || params.end) {
|
if (params.start || params.end) {
|
||||||
// 按年份筛选数据,先隐藏所有图层,再根据筛选结果显示对应图层
|
// 按年份筛选数据,先隐藏所有图层,再根据筛选结果显示对应图层
|
||||||
const layers = Vue.config.maps['voyageMap_ship'].getStyle().layers;
|
setMapLayoutProperty('voyageMap_ship', 'none')
|
||||||
layers.forEach(layer => {
|
|
||||||
// 跳过底图
|
|
||||||
if (layer.id !== '影像地图' && layer.type !== 'raster') {
|
|
||||||
Vue.config.maps['voyageMap_ship'].setLayoutProperty(layer.id, 'visibility', 'none');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let i = 0
|
let i = 0
|
||||||
|
|
@ -267,7 +260,6 @@ export default {
|
||||||
selectVoyageYear(val) {
|
selectVoyageYear(val) {
|
||||||
const shipName = this.currentTitle === '全部科考船' ? '' : this.currentTitle
|
const shipName = this.currentTitle === '全部科考船' ? '' : this.currentTitle
|
||||||
if (val) {
|
if (val) {
|
||||||
// this.removeSingleLineImg()
|
|
||||||
const params = getYearRange(val)
|
const params = getYearRange(val)
|
||||||
this.gitShipVoyage({ ...params, ship_name: shipName })
|
this.gitShipVoyage({ ...params, ship_name: shipName })
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue