-
Couldn't load subscription status.
- Fork 80
Open
Description
你好作者,我这边用openlayer3 结合 charts 时候发生了坐标问题
openlayers 版本 3
chart 版本 当前时间官网最新
坐标数据 坐标系 EPSG:4326
代码如下:
`
fetch('./新建文本文档.txt').then(res => res.json()).then(data => {
console.log(data)
let d = data.slice(0, 1000)
// d.forEach(item => {
// item.x = parseInt(item.coord[0])
// item.y = parseInt(item.coord[1])
//
// })
var data = [
// {
// name:'2323',
// value: [121.46842534814978,31.23573218171289, 10]
// },
// {
// name: '66666',
// value: [121.46842508556256,31.23573183686057, 10]
// }
];
d.forEach(item => {
item.coord.push(0)
data.push({
name:item.name,
value: item.coord
})
})
var option = {
tooltip: {
trigger: 'item'
},
series: [
{
coordinateSystem: 'geo',
name: 'pm2.5',
type: 'scatter',
data: data,
symbolSize: function (val) {
return 20;
},
label: {
normal: {
formatter: '{b}',
position: 'right',
show: false
},
emphasis: {
show: true
}
},
itemStyle: {
normal: {
color: '#ddb926'
}
}
}]
};
var echartslayer = new ol3Echarts(option);
echartslayer.appendTo(Maps.getMap());
})
}
}
</script>
`
代码中新建文本文档.txt 是我的一个点位坐标文件
发生的问题: 在大比例尺的时候 点位才散开, 其实我这个用openlayer 直接叠加的话 会在大比例尺就散开,不知为什么在这里发生了这样的问题

Metadata
Metadata
Assignees
Labels
No labels