首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无效的Geojson对象Django-leaflet [django]

无效的Geojson对象Django-leaflet [django]
EN

Stack Overflow用户
提问于 2020-05-12 13:22:47
回答 1查看 50关注 0票数 0

这是我试图用django-leaflet和django-geojson在Django上渲染的geojson对象。

代码语言:javascript
复制
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "model": "rent_app.apartment"
      },
      "id": "APT",
      "geometry": {
        "type": "Point",
        "coordinates": [
          38.771353,
          8.984487
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "model": "rent_app.apartment"
      },
      "id": "APT2",
      "geometry": {
        "type": "Point",
        "coordinates": [
          38.773155,
          8.98525
        ]
      }
    }
  ],
  "crs": {
    "type": "link",
    "properties": {
      "href": "http://spatialreference.org/ref/epsg/4326/",
      "type": "proj4"
    }
  }
}

我在尝试渲染geojson时得到了Invalid GeoJSON object。有什么解决方案吗?

EN

回答 1

Stack Overflow用户

发布于 2020-05-28 04:14:20

事实证明,GeoJSON有一个额外的花括号,这打破了geojson格式,或者crs不再被接受。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61744377

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档