2
我使用jVectorMap v1.1和我有這個相關的代碼:有沒有辦法使用「填充」和「筆畫」作爲區域比例尺顏色的屬性?
var america = "#d84148";
var europe = "#0060d0";
var africa = "#44984d";
var asia = "#e3a430";
var oceania = "#2ecdd0";
series: {
regions: [{
values: data['colours'],
scale: {
"America" : america,
"Europe" : europe,
"Africa" : africa,
"Asia" : asia,
"Oceania" : oceania
},
normalizeFunction: 'linear',
attribute: 'fill'
}]
}
我得到的矢量數據是從naturalearth.com的world_mill_en,它包含每個國家1px的分離,作爲該國的邊界。我正在構建的應用程序必須顯示整個大洲,因此不允許任何邊界。
在attribute
我只能設置fill
或stroke
作爲參數,我可以在使用fill
時爲邊框設置純色。
我想知道是否有可能在同一時間使用fill
和stroke
作爲屬性。或者,如果有一種方法可以將區域的筆劃設置爲與相應區域具有相同的顏色。即。
if (stroke == "none")
{
stroke = "that region's colour"
}