这是我试图用django-leaflet和django-geojson在Django上渲染的geojson对象。
{
"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"
}
}
}
我得到的是 Invalid GeoJSON object
试图渲染geojson的时候。有什么解决办法吗?
事实证明,GeoJSON要么有一个额外的大括号,破坏了geojson格式,要么是 crs
并非不再接受。