我尝试遵循这个简单的例子,其中标签被渲染到 map 的区域中。 http://jvectormap.com/examples/region-labels/
我将我的代码归结为一个 fiddle http://jsfiddle.net/V8dyd/189/,但我看不出我做错了什么。
http://jsfiddle.net/V8dyd/188/
$(function()
{
var map = $('#map')
.vectorMap(
{
map: 'us_aea_en',
regionLabelStyle:
{
initial:
{
fill: '#B90E32'
},
hover:
{
fill: 'black'
}
},
labels:
{
regions:
{
render: function (code)
{
return "label";
}
}
}
});
});
最佳答案
您使用的是旧版本的 jVectorMap。从 2.0 版开始支持区域静态标签。这是一个 updated fiddle .
jquery-jvectormap-2.0.1.min.js
关于javascript - 无法使用 Jvectormap 呈现区域标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28835442/