Merge branch 'main' of http://121.37.111.42:3000/ThbTech/gis-bi into main
This commit is contained in:
commit
bf74c8a6b0
@ -6,7 +6,9 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
|
<script
|
||||||
|
src="https://webapi.amap.com/maps?v=2.0&key=YOUR_KEY&plugin=AMap.TileLayer.Satellite">
|
||||||
|
</script>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/pages/index/main.ts"></script>
|
<script type="module" src="/src/pages/index/main.ts"></script>
|
||||||
|
@ -246,6 +246,7 @@ const mapStyleOptions = [
|
|||||||
{ name: t('chart.map_style_fresh'), value: 'fresh' },
|
{ name: t('chart.map_style_fresh'), value: 'fresh' },
|
||||||
{ name: t('chart.map_style_grey'), value: 'grey' },
|
{ name: t('chart.map_style_grey'), value: 'grey' },
|
||||||
{ name: t('chart.map_style_blue'), value: 'blue' },
|
{ name: t('chart.map_style_blue'), value: 'blue' },
|
||||||
|
{ name: '卫星地图', value: 'Satellite' },
|
||||||
{ name: t('commons.custom'), value: 'custom' }
|
{ name: t('commons.custom'), value: 'custom' }
|
||||||
]
|
]
|
||||||
const heatMapTypeOptions = [
|
const heatMapTypeOptions = [
|
||||||
|
@ -103,7 +103,13 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
|||||||
// 底层
|
// 底层
|
||||||
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
|
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
|
||||||
let scene = chartObj?.getScene()
|
let scene = chartObj?.getScene()
|
||||||
if (!scene) {
|
if(scene){
|
||||||
|
if (scene.getLayers()?.length) {
|
||||||
|
await scene.removeAllLayer()
|
||||||
|
scene.setPitch(misc.mapPitch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mapStyle.indexOf('Satellite') == -1) {
|
||||||
scene = new Scene({
|
scene = new Scene({
|
||||||
id: container,
|
id: container,
|
||||||
logoVisible: false,
|
logoVisible: false,
|
||||||
@ -111,7 +117,7 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
|||||||
token: mapKey?.key ?? undefined,
|
token: mapKey?.key ?? undefined,
|
||||||
style: mapStyle,
|
style: mapStyle,
|
||||||
pitch: misc.mapPitch,
|
pitch: misc.mapPitch,
|
||||||
center: basicStyle.autoFit === false ? center : undefined,
|
center,
|
||||||
zoom: basicStyle.autoFit === false ? basicStyle.zoomLevel : undefined,
|
zoom: basicStyle.autoFit === false ? basicStyle.zoomLevel : undefined,
|
||||||
showLabel: !(basicStyle.showLabel === false),
|
showLabel: !(basicStyle.showLabel === false),
|
||||||
WebGLParams: {
|
WebGLParams: {
|
||||||
@ -120,20 +126,64 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
if (scene.getLayers()?.length) {
|
scene = new Scene({
|
||||||
await scene.removeAllLayer()
|
id: container,
|
||||||
scene.setPitch(misc.mapPitch)
|
logoVisible: false,
|
||||||
scene.setMapStyle(mapStyle)
|
map: new GaodeMap({
|
||||||
scene.map.showLabel = !(basicStyle.showLabel === false)
|
token: mapKey?.key ?? undefined,
|
||||||
}
|
style: mapStyle,
|
||||||
if (basicStyle.autoFit === false) {
|
features: ['bg', 'road'], // 必须开启路网层
|
||||||
scene.setZoomAndCenter(basicStyle.zoomLevel, center)
|
plugin: ['AMap.TileLayer.Satellite'], // 显式声明卫星图层
|
||||||
|
WebGLParams: {
|
||||||
|
preserveDrawingBuffer: true
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
// if (!scene) {
|
||||||
|
// scene = new Scene({
|
||||||
|
// id: container,
|
||||||
|
// logoVisible: false,
|
||||||
|
// map: new GaodeMap({
|
||||||
|
// token: mapKey?.key ?? undefined,
|
||||||
|
// style: mapStyle,
|
||||||
|
// pitch: misc.mapPitch,
|
||||||
|
// center: basicStyle.autoFit === false ? center : undefined,
|
||||||
|
// zoom: basicStyle.autoFit === false ? basicStyle.zoomLevel : undefined,
|
||||||
|
// showLabel: !(basicStyle.showLabel === false),
|
||||||
|
// WebGLParams: {
|
||||||
|
// preserveDrawingBuffer: true
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// if (scene.getLayers()?.length) {
|
||||||
|
// await scene.removeAllLayer()
|
||||||
|
// scene.setPitch(misc.mapPitch)
|
||||||
|
// scene.setMapStyle(mapStyle)
|
||||||
|
// scene.map.showLabel = !(basicStyle.showLabel === false)
|
||||||
|
// }
|
||||||
|
// if (basicStyle.autoFit === false) {
|
||||||
|
// scene.setZoomAndCenter(basicStyle.zoomLevel, center)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
mapRendering(container)
|
mapRendering(container)
|
||||||
|
if (mapStyle.indexOf('Satellite') == -1) {
|
||||||
scene.once('loaded', () => {
|
scene.once('loaded', () => {
|
||||||
mapRendered(container)
|
mapRendered(container)
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
scene.once('loaded', () => {
|
||||||
|
// 创建卫星图层实例
|
||||||
|
const satelliteLayer = new AMap.TileLayer.Satellite()
|
||||||
|
// 与矢量图层叠加显示
|
||||||
|
satelliteLayer.setMap(scene.map)
|
||||||
|
mapRendered(container)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// scene.once('loaded', () => {
|
||||||
|
// mapRendered(container)
|
||||||
|
// })
|
||||||
this.configZoomButton(chart, scene)
|
this.configZoomButton(chart, scene)
|
||||||
if (xAxis?.length < 2 || xAxisExt?.length < 2) {
|
if (xAxis?.length < 2 || xAxisExt?.length < 2) {
|
||||||
return new L7Wrapper(scene, undefined)
|
return new L7Wrapper(scene, undefined)
|
||||||
|
@ -84,7 +84,14 @@ export class HeatMap extends L7ChartView<Scene, L7Config> {
|
|||||||
// 底层
|
// 底层
|
||||||
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
|
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
|
||||||
let scene = chartObj?.getScene()
|
let scene = chartObj?.getScene()
|
||||||
if (!scene) {
|
if(scene){
|
||||||
|
if (scene.getLayers()?.length) {
|
||||||
|
await scene.removeAllLayer()
|
||||||
|
scene.setPitch(miscStyle.mapPitch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapStyle.indexOf('Satellite') == -1) {
|
||||||
scene = new Scene({
|
scene = new Scene({
|
||||||
id: container,
|
id: container,
|
||||||
logoVisible: false,
|
logoVisible: false,
|
||||||
@ -101,20 +108,47 @@ export class HeatMap extends L7ChartView<Scene, L7Config> {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (scene.getLayers()?.length) {
|
scene = new Scene({
|
||||||
await scene.removeAllLayer()
|
id: container,
|
||||||
scene.setPitch(miscStyle.mapPitch)
|
logoVisible: false,
|
||||||
scene.setMapStyle(mapStyle)
|
map: new GaodeMap({
|
||||||
scene.map.showLabel = !(basicStyle.showLabel === false)
|
token: mapKey?.key ?? undefined,
|
||||||
if (basicStyle.autoFit === false) {
|
style: mapStyle,
|
||||||
scene.setZoomAndCenter(basicStyle.zoomLevel, center)
|
features: ['bg', 'road'], // 必须开启路网层
|
||||||
}
|
plugin: ['AMap.TileLayer.Satellite'], // 显式声明卫星图层
|
||||||
|
WebGLParams: {
|
||||||
|
preserveDrawingBuffer: true
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// // if (scene.getLayers()?.length) {
|
||||||
|
// await scene.removeAllLayer()
|
||||||
|
// scene.setPitch(miscStyle.mapPitch)
|
||||||
|
// scene.setMapStyle(mapStyle)
|
||||||
|
// scene.map.showLabel = !(basicStyle.showLabel === false)
|
||||||
|
// if (basicStyle.autoFit === false) {
|
||||||
|
// scene.setZoomAndCenter(basicStyle.zoomLevel, center)
|
||||||
|
// }
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
mapRendering(container)
|
mapRendering(container)
|
||||||
|
if (mapStyle.indexOf('Satellite') == -1) {
|
||||||
scene.once('loaded', () => {
|
scene.once('loaded', () => {
|
||||||
mapRendered(container)
|
mapRendered(container)
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
scene.once('loaded', () => {
|
||||||
|
// 创建卫星图层实例
|
||||||
|
const satelliteLayer = new AMap.TileLayer.Satellite()
|
||||||
|
// 与矢量图层叠加显示
|
||||||
|
satelliteLayer.setMap(scene.map)
|
||||||
|
mapRendered(container)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.configZoomButton(chart, scene)
|
this.configZoomButton(chart, scene)
|
||||||
if (xAxis?.length < 2 || yAxis?.length < 1) {
|
if (xAxis?.length < 2 || yAxis?.length < 1) {
|
||||||
return new L7Wrapper(scene, undefined)
|
return new L7Wrapper(scene, undefined)
|
||||||
|
@ -28,7 +28,7 @@ import { isDashboard, trackBarStyleCheck } from '@/utils/canvasUtils'
|
|||||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
import { L7ChartView } from '@/views/chart/components/js/panel/types/impl/l7'
|
import { L7ChartView } from '@/views/chart/components/js/panel/types/impl/l7'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { ExportImage } from '@antv/l7'
|
import { ExportImage,Scale } from '@antv/l7'
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, embeddedCallBack, inMobile } =
|
const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, embeddedCallBack, inMobile } =
|
||||||
@ -332,6 +332,8 @@ const renderL7Plot = async (chart: ChartObj, chartView: L7PlotChartView<any, any
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mapL7Timer: number
|
let mapL7Timer: number
|
||||||
|
let scaleControl: Scale | null = null // 存储比例尺实例
|
||||||
|
|
||||||
const renderL7 = async (chart: ChartObj, chartView: L7ChartView<any, any>, callback) => {
|
const renderL7 = async (chart: ChartObj, chartView: L7ChartView<any, any>, callback) => {
|
||||||
mapL7Timer && clearTimeout(mapL7Timer)
|
mapL7Timer && clearTimeout(mapL7Timer)
|
||||||
mapL7Timer = setTimeout(async () => {
|
mapL7Timer = setTimeout(async () => {
|
||||||
@ -341,12 +343,25 @@ const renderL7 = async (chart: ChartObj, chartView: L7ChartView<any, any>, callb
|
|||||||
chart: chart,
|
chart: chart,
|
||||||
action
|
action
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 清除已有比例尺
|
||||||
|
if (scaleControl) {
|
||||||
|
myChart.getScene()?.removeControl(scaleControl)
|
||||||
|
scaleControl = null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建并添加新比例尺
|
||||||
|
scaleControl = new Scale({
|
||||||
|
position: 'bottomleft',
|
||||||
|
imperial: false
|
||||||
|
})
|
||||||
|
myChart.getScene()?.addControl(scaleControl)
|
||||||
|
|
||||||
myChart?.render()
|
myChart?.render()
|
||||||
callback?.()
|
callback?.()
|
||||||
emit('resetLoading')
|
emit('resetLoading')
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
const pointClickTrans = () => {
|
const pointClickTrans = () => {
|
||||||
if (embeddedCallBack.value === 'yes') {
|
if (embeddedCallBack.value === 'yes') {
|
||||||
trackClick('pointClick')
|
trackClick('pointClick')
|
||||||
|
Loading…
Reference in New Issue
Block a user