首页 > 解决方案 > d3 V4 中尝试在 AlbersUSA 上使用 projection.center() 时出现“不是函数”错误

问题描述

我要退出当前的 D3 文档,但似乎我的 D3 版本 4 在我设置投影时没有使用 projection.center([lon, lat]) 函数。

我正在尝试这个:

var projection = d3.geoAlbersUsa().center([-71.382439, 42.407211]);

并不断收到此错误:

d3.geoAlbersUsa(...).center is not a function

是否有新的语法或我缺少的东西?

标签: javascriptd3.js

解决方案


推荐阅读