优化航次地图航迹显示交互逻辑

This commit is contained in:
hym 2026-04-06 11:01:12 +08:00
parent 8ee0db5f3a
commit 1dadfc0b6b
1 changed files with 2 additions and 10 deletions

View File

@ -76,7 +76,7 @@ import PieChart from './components/PieChart.vue'
import { reportList, shipTotal, shipUnit, shipUnitYear, shipVoyage } from '../../api/statistics'
import { getYearRange, filterDictItems } from '../../utils/index'
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'
export default {
@ -171,7 +171,6 @@ export default {
//
handleCommand(command) {
this.currentTitle = command
// this.removeSingleLineImg()
if (command === '全部科考船') {
this.getShipList()
this.gitShipVoyage()
@ -243,13 +242,7 @@ export default {
shipVoyage(params).then(res => {
if (params.start || params.end) {
//
const layers = Vue.config.maps['voyageMap_ship'].getStyle().layers;
layers.forEach(layer => {
//
if (layer.id !== '影像地图' && layer.type !== 'raster') {
Vue.config.maps['voyageMap_ship'].setLayoutProperty(layer.id, 'visibility', 'none');
}
});
setMapLayoutProperty('voyageMap_ship', 'none')
}
let i = 0
@ -267,7 +260,6 @@ export default {
selectVoyageYear(val) {
const shipName = this.currentTitle === '全部科考船' ? '' : this.currentTitle
if (val) {
// this.removeSingleLineImg()
const params = getYearRange(val)
this.gitShipVoyage({ ...params, ship_name: shipName })
} else {