在JVectorMap中,我想添加来自JSON的标记。I found an idea here on Github。
这是我使用的代码:
$.getJSON('/Ajax/Dealers.json', function (data) {
var map = new jvm.WorldMap({
map: 'world_mill_en',
container: $('#world-map'),
markerStyle: {
initial: {
fill: '#4087bd',
stroke: '#28456f'
}
},
series: {
regions: [{
attribute: 'fill'
}]
},
markers: data
});
map.series.regions[0].setValues(customColors);
});但问题是我得到了错误。
TypeError: jvm.WorldMap is not a constructor在这一行上:
var map = new jvm.WorldMap({发布于 2015-07-09 18:03:37
我想你忘了包含库文件,或者它没有放在正确的位置。包括此库文件,然后尝试使用http://jvectormap.com/js/jquery-jvectormap-1.2.2.min.js
https://stackoverflow.com/questions/31312126
复制相似问题