我好像用错了geojson。
我修改了我的代码,现在它按预期工作,新的模式也是draft-7。
这是我更新的代码:
"boundary": {
"title": "The boundary of the plot",
"anyOf": [
{
"$ref": "http://geojson.org/schema/MultiPolygon.json"
},
{
"$ref": "http://geojson.org/schema/Polygon.json"
}
],
"additionalProperties": false
和
"geoLocation": {
"title": "Front door geolocation",
"$ref": "http://geojson.org/schema/Point.json",
"additionalProperties": false
},
JSON可以是:
"boundary":
{
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0],
[100.0, 0.0]
]
]
}
和
"geoLocation": {
"coordinates": [125.25, 135.255],
"type": "Point"
}