gpt4 book ai didi

javascript - 放大不适用于 Highmaps

转载 作者:行者123 更新时间:2023-11-30 17:05:11 31 4
gpt4 key购买 nike

我从演示部分获取了一个 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
}]
});

我建议 filing an issue在 GitHub 上,我们将对其进行详细研究。

关于javascript - 放大不适用于 Highmaps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28181179/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com