如何在mapbox上绘制JSON数据?

问题描述 投票:-1回答:1

我有这种格式的数据:JSON Data

但是mapbox不接受这种格式的数据。我搜索了很多将这些数据转换成geojson但却找不到更好的方法。如何在地图上绘制此类数据?有什么建议?

编辑:我的问题是如何格式化这种类型的数据,以便mapbox接受它。

json mapbox geojson
1个回答
0
投票

此kotlin脚本查询数据集API,然后在静态地图集图像上绘制它们

https://github.com/yschimke/oksocial/blob/master/commands/london-hospitals

fun staticMap(start: Location, hospitals: List<Location>): String {
  var markers = mutableListOf<String>();
  markers.add("pin-m-marker+CCC(" + start.longitude + "," + start.latitude + ")");

  hospitals.forEach {
    markers.add("pin-s-hospital(" + it.longitude + "," + it.latitude + ")");
  }

  return "https://api.mapbox.com/v4/mapbox.dark/${markers.joinToString(",")}/auto/800x800.png";
}
© www.soinside.com 2019 - 2024. All rights reserved.