Highmaps 不会显示我的 GeoJSON 湖层
Highmaps won't display my GeoJSON lake layer
我没有成功将最后一层添加到我的 Highmaps。我已经有了地面地图和一些额外的图层。但是湖层没有显示成功。这是为什么?它确实正确加载到 QGIS 中。
顺便说一句,事实是我还没有理解像这样调用 GeoJSON 文件(适用于我的附加层)之间的区别:
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['lakes'], 'mapline'),
或者像这样(适用于底层):
mapData: Highcharts.maps['lakes'],
data : data,
但不确定这在这里是否相关。它不能以一种或另一种方式工作。 Here is a fiddle.
感谢任何提示。
问题是由具有空值的几何之一引起的:
{
"type": "Feature",
"geometry": null,
"properties": {
"OBJECTID": 13,
"NAME": "Lake St. Martin",
"Shape_Leng": 1.1857234063,
"Shape_Area": 0.0450760801303
}
}
删除不正确的项目后,一切正常。关于你的第二个问题:请同时检查 chart.map
属性: https://api.highcharts.com/highmaps/chart.map and a precise description here: https://www.highcharts.com/forum/viewtopic.php?t=39602
现场演示: https://jsfiddle.net/BlackLabel/ga396zwo/
文档: https://www.highcharts.com/docs/maps/custom-geojson-maps
API参考:
https://api.highcharts.com/class-reference/Highcharts#.geojson
我没有成功将最后一层添加到我的 Highmaps。我已经有了地面地图和一些额外的图层。但是湖层没有显示成功。这是为什么?它确实正确加载到 QGIS 中。
顺便说一句,事实是我还没有理解像这样调用 GeoJSON 文件(适用于我的附加层)之间的区别:
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['lakes'], 'mapline'),
或者像这样(适用于底层):
mapData: Highcharts.maps['lakes'],
data : data,
但不确定这在这里是否相关。它不能以一种或另一种方式工作。 Here is a fiddle.
感谢任何提示。
问题是由具有空值的几何之一引起的:
{
"type": "Feature",
"geometry": null,
"properties": {
"OBJECTID": 13,
"NAME": "Lake St. Martin",
"Shape_Leng": 1.1857234063,
"Shape_Area": 0.0450760801303
}
}
删除不正确的项目后,一切正常。关于你的第二个问题:请同时检查 chart.map
属性: https://api.highcharts.com/highmaps/chart.map and a precise description here: https://www.highcharts.com/forum/viewtopic.php?t=39602
现场演示: https://jsfiddle.net/BlackLabel/ga396zwo/
文档: https://www.highcharts.com/docs/maps/custom-geojson-maps
API参考:
https://api.highcharts.com/class-reference/Highcharts#.geojson