keithjgrant
keithjgrant

Reputation: 12759

Customize stroke width of land

The Planetary JS Earth plugin takes a config object that can define fill and stroke colors for oceans, land, and border. Unfortunately, the docs don’t give any information about can be passed into the configs for each of these. I’d like to control the stroke width of the borders, something like this:

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},
  })
);

Is there a way to do this?

Upvotes: 1

Views: 89

Answers (1)

Gerardo Furtado
Gerardo Furtado

Reputation: 102198

According to the documentation, it has to be lineWidth, and the value has to be a number, with no units.

Here is an example:

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

Upvotes: 0

Related Questions