单位统计页面去掉航次地图
This commit is contained in:
parent
f4f411f3b9
commit
8403c26edf
|
|
@ -9,21 +9,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 地图板块(与科考船汇总统计页 ships 一致:Mapbox + shipUnit + shipVoyage) -->
|
||||
<!-- 地图板块(与科考船汇总统计页 ships 一致:Mapbox + shipUnit -->
|
||||
<div class="map-module">
|
||||
<div class="bezel">
|
||||
<div class="map-title">参航单位</div>
|
||||
<div id="workUnitMap_uuv" ref="workUnitMap_uuv" style="height: 100%;width:100%;" />
|
||||
</div>
|
||||
<!-- <div class="bezel">
|
||||
<div class="map-title">航次地图</div>
|
||||
<div class="map-year-panel">
|
||||
<span class="map-year-label">年份</span>
|
||||
<el-date-picker v-model="voyageYear" type="year" size="small" placeholder="全部" class="map-year" clearable
|
||||
format="yyyy" @change="selectVoyageYear" />
|
||||
</div>
|
||||
<div id="voyageMap_uuv" ref="voyageMap_uuv" style="height: 100%;width:100%;" />
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="unit-toolbar">
|
||||
<div class="unit-toolbar-inner">
|
||||
|
|
@ -149,7 +140,6 @@ export default {
|
|||
this.loadUnitTotalFromApi()
|
||||
this.getHovUnit()
|
||||
this.getShipUnit()
|
||||
this.gitShipVoyage()
|
||||
},
|
||||
mounted() {
|
||||
initMapbox('workUnitMap_uuv', {
|
||||
|
|
@ -159,13 +149,6 @@ export default {
|
|||
minZoom: 2,
|
||||
maxZoom: 29
|
||||
})
|
||||
// initMapbox('voyageMap_uuv', {
|
||||
// tileKey: 'GEBCO_basemap_NCEI',
|
||||
// zoom: 3,
|
||||
// center: [113, 15],
|
||||
// minZoom: 2,
|
||||
// maxZoom: 29
|
||||
// })
|
||||
},
|
||||
beforeDestroy() {
|
||||
const unitMap = Vue.config.maps && Vue.config.maps['workUnitMap_uuv']
|
||||
|
|
@ -173,11 +156,6 @@ export default {
|
|||
unitMap.remove()
|
||||
delete Vue.config.maps['workUnitMap_uuv']
|
||||
}
|
||||
const voyageMap = Vue.config.maps && Vue.config.maps['voyageMap_uuv']
|
||||
if (voyageMap) {
|
||||
voyageMap.remove()
|
||||
delete Vue.config.maps['voyageMap_uuv']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
|
|
@ -356,36 +334,6 @@ export default {
|
|||
loadJsonPointFeature('workUnit', 'blue', geojson, 'unit_name', 'workUnitMap_uuv')
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 科考船航次轨迹(与 ships 页地图同源接口),通过 Mapbox 矢量图层渲染。
|
||||
* @param {Object} [params] 查询参数
|
||||
* @returns {void}
|
||||
*/
|
||||
gitShipVoyage(params = {}) {
|
||||
shipVoyage(params).then(res => {
|
||||
let i = 0
|
||||
const colors = ColorGenerator.generateDivergingColors((res.array || []).length)
|
||||
; (res.array || []).forEach(item => {
|
||||
loadVectorLayer(item.voyage_name, ['line', 'symbol'], [colors[i], '#FFFFFF'], 'visible', 'voyageMap_uuv', 'dsds')
|
||||
i++
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择航次地图年份。
|
||||
* @param {*} val 年份值
|
||||
* @returns {void}
|
||||
*/
|
||||
selectVoyageYear(val) {
|
||||
if (val) {
|
||||
const params = getYearRange(val)
|
||||
this.gitShipVoyage({ ...params })
|
||||
} else {
|
||||
this.gitShipVoyage({})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue