Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
217 views
in Technique[技术] by (71.8m points)

使用D3投射地图时出现偏移的问题。

在使用D3.js+ThreeJs开发一个3D地图应用,中心点从高德地图上POI查询获取的,实际上绘制出来的效果并不在设置的中心点上。如图所示:

image.png

不太理解是哪一步出现了问题?

代码如下:

lnglatToVector3(lnglat) {
    this.projection || 
    this.projection = d3.geoMercator()
        .center(this.mapCenter)
        .scale(200000)
        .translate([0,0]);
    const [x, y] = this.projection([lnglat[0], lnglat[1]]);
    const z = 0;
    return [y, x, z]
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...