[英]Zoom in not working on Highmaps
我從演示部分舉了一個Highmaps示例,放大工作正常。 然后,我用自己的數據替換了數據對象,並用自己的GeoJSON數據更改了世界地圖。
現在變焦不再起作用。
請參閱此JSFiddle。
到目前為止,我設法簡化了代碼:
var geoJson = { ... }
var data = [...]
// Initiate the chart
$('#container').highcharts('Map', {
mapNavigation: {
enabled: true,
navigationButtons: true
},
colorAxis: {
min: 1,
max: 1000,
type: 'logarithmic'
},
series: [{
data: data,
mapData: geoJson,
joinBy: ['name', 'name'],
}]
});
如何使縮放正常工作?
這必須是一個錯誤,如果您更改坐標數據,它將起作用。 jsFiddle :
var geoJson = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "a"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[3125, 6250],
[5625, 6250],
[5624, 8750],
[3125, 8750],
[3125, 6250]
]
]
}
}, {
"type": "Feature",
"properties": {
"name": "b"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[6875, 6250],
[9375, 6250],
[9375, 8750],
[6875, 8750],
[6875, 6250]
]
]
}
}]
};
// Initiate the chart
$('#container').highcharts('Map', {
mapNavigation: {
enabled: true,
},
series: [{
mapData: geoJson
}]
});
我建議在GitHub上提交問題 ,我們將對其進行詳細調查。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.