Commit f74c8e57 by 韩艳丽

float

parent 7f442311
......@@ -29,7 +29,7 @@ export function baseFloatMapOption(chartDom, chartId, chart, action) {
// pitch: size.mapPitch,
style: mapStyle,
// style: 'dark',
center: [104.58631, 30.71882], // 成阿中心经纬度
// center: [104.58631, 30.71882], // 成阿中心经纬度
zoom: 6.2,
maxZoom: 10
}),
......@@ -42,31 +42,31 @@ export function baseFloatMapOption(chartDom, chartId, chart, action) {
chartDom.setMapStyle(mapStyle)
}
}
// if (xAxis?.length < 3) {
// chartDom.removeAllLayer()
// return chartDom
// }
if (xAxis?.length < 3) {
chartDom.removeAllLayer()
return chartDom
}
const texts = []
const newTableRow = chart.data.tableRow.map((item, index) => {
const name = item[xAxis[0].dataeaseName]
const center = item[xAxis[1].dataeaseName]
const center = JSON.parse(item[xAxis[1].dataeaseName])
const [lng, lat] = center
texts.push({ name, lng, lat })
return {
type: 'Feature',
geometry: {
type: 'MultiPolygon',
coordinates: item[xAxis[2].dataeaseName]
coordinates: JSON.parse(item[xAxis[2].dataeaseName])
},
properties: {
name: item[xAxis[0].dataeaseName],
center: item[xAxis[1].dataeaseName]
center: JSON.parse(item[xAxis[1].dataeaseName])
}
}
})
const mapData = { type: 'FeatureCollection', features: newTableRow }
const proData = { type: 'FeatureCollection', features: [newTableRow[0]] }
console.log(mapData, proData)
console.log(mapData, proData, texts)
chartDom.removeAllLayer()
.then(() => {
const textLayer = new PointLayer({ zIndex: 2 })
......@@ -116,7 +116,6 @@ export function baseFloatMapOption(chartDom, chartId, chart, action) {
sourceColor: '#0DCCFF',
targetColor: 'rbga(255,255,255, 0)'
})
chartDom.addLayer(lineLayer)// 底部地图上的线
const provincelayer = new PolygonLayer({})
.source(proData)
......@@ -132,7 +131,6 @@ export function baseFloatMapOption(chartDom, chartId, chart, action) {
raisingHeight: 200000,
opacity: 0.8
})
chartDom.addLayer(provincelayer)// 省份
provincelayer.on('mousemove', () => {
provincelayer.style({
raisingHeight: 200000 + 100000
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论