0
我有填充有屬於地圖設置單個區域不可選
var regions = [
{name: 'BE-WV', positions: true},
{name: 'BE-OV', positions: true},
{name: 'BE-AN', positions: false},
{name: 'BE-LI', positions: true},
{name: 'BE-VB', positions: true},
{name: 'BE-BR', positions: true},
{name: 'BE-WB', positions: true},
{name: 'BE-HG', positions: true},
{name: 'BE-NA', positions: true},
{name: 'BE-LK', positions: true},
{name: 'BE-LX', positions: true},
];
,我想知道是否可以創建檢查的區域的功能上的區域的陣列。如果該地區有一個立場:真實的,它應該是可選的,否則它不應該。
我已經創建了一個函數,它可以在懸停時更改鼠標光標,如果它應該可選或不可選。
onRegionOver: function(event, code, region){
for (var i = 0; i < regions.length; i++) {
element = regions[i];
elementName = element['name'];
if (elementName == code){
if (element['positions'] !== false){
document.body.style.cursor = 'pointer';
}
}
}