自定义土地的行程宽度

时间:2017-04-19 14:06:25

标签: javascript d3.js planetary.js

Planetary JS Earth plugin采用一个配置对象,可以为海洋,陆地和边界定义填充和描边颜色。遗憾的是,文档中没有提供任何有关这些信息的信息可以传递到配置中。我想控制边框的笔触宽度,如下所示:

const lightGray = 'rgb(222,224,223)';
const lightBlue = 'rgb(160,205,226)';
const blue = 'rgb(144,182,203)';
planet.loadPlugin(
  planetary.plugins.earth({
    topojson: {world: topojson},
    oceans: {fill: lightBlue},

    /* strokeWidth is ignored: */
    borders: {stroke: blue, strokeWidth: '5px'},

    land: {fill: lightGray, stroke: blue},
  })
);

有办法做到这一点吗?

1 个答案:

答案 0 :(得分:0)

根据documentation,它必须是lineWidth,并且值必须是一个数字,没有单位。

以下是一个例子:

planetaryjs.plugins.borders({
    stroke: '#008000', lineWidth: 0.25
});
相关问题