我需要你在jVectorMap安裝上的幫助。請看看這個項目:jVectorMap:無鼠標懸停和點擊可能
向下滾動到左下欄,並嘗試將鼠標懸停或點擊任何國家。
我初始化jVectorMap的代碼是:
$.ajax({
type: "POST",
url: "worldmapdata.php",
dataType: "json",
data: dataString,
cache: false,
success: function(html)
{
var mapData;
mapData = html;
$('#world-map').html('');
$('#world-map').vectorMap({
map: 'world_mill_en',
backgroundColor: '#a5bfdd',
regionsSelectable: true,
focusOn: {
x: 0.4,
y: 0.3,
scale: 2.61464672130868
},
regionStyle: {
initial: {
fill: 'white',
"fill-opacity": 1,
stroke: 'none',
"stroke-width": 0,
"stroke-opacity": 1
},
hover: {
"fill-opacity": 0.8
},
selected: {
fill: 'yellow'
},
selectedHover: {
}
},
series: {
regions: [{
values: mapData,
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial'
}]
},
onRegionOver: function(e, el, code){
el.html(el.html()+' (GDP - '+mapData[code]+')');
}
}).trigger('create');
}
});
將是巨大的得到一個提示正確的方向來解決這個問題。