如何将Geojson嵌入Github的Markdown中?

发布于 2025-01-23 08:08:11 字数 813 浏览 4 评论 0原文

他们的玩具示例 docs.github.com 被打破了:

{
  "type": "Polygon",
  "coordinates": [
      [
          [-90,30],
          [-90,35],
          [-90,35],
          [-85,35],
          [-85,30]
      ]
  ]
}

它不会按照承诺呈现,甚至不会通过 linter

我已经创建了一个小的 peprex 表明修复衬里问题并不能使它起作用。 Github然后抱怨“我们不能用一个空的未知集合渲染地图。”修复似乎也无济于事。但是也许我犯了一个错误。

我在做什么错?

Their toy example at docs.github.com is broken:

{
  "type": "Polygon",
  "coordinates": [
      [
          [-90,30],
          [-90,35],
          [-90,35],
          [-85,35],
          [-85,30]
      ]
  ]
}

It doesn't render as promised, and it doesn't even pass a linter.

I've created a smallish reprex to show that fixing the linter issues doesn't make it work. GitHub then complains "We can't render a map with an empty unknown collection." Fixing that doesn't seem to help either. But maybe I'm making a mistake.

What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眸中客 2025-01-30 08:08:11

解决:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": 1,
      "properties": {
        "ID": 0
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
              [-90,35],
              [-90,30],
              [-85,30],
              [-85,35],
              [-90,35]
          ]
        ]
      }
    }
  ]
}

Solved:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": 1,
      "properties": {
        "ID": 0
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
              [-90,35],
              [-90,30],
              [-85,30],
              [-85,35],
              [-90,35]
          ]
        ]
      }
    }
  ]
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文