我正在尝试使用带有点的geoJson在地图上添加一些标记,我正在遵循leaflet 文档,但它仍然显示:
错误:无效的GeoJSON对象。
throw new Error('无效的GeoJSON对象。');
我的GeoJson:
var meta1nJson={
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-38.3613558,
-8.8044875
]
},
"properties": {
"Ordem": "193",
"Eixo": "Leste",
"Meta": "1L",
"Municipio": "Petrolândia",
"Estado": "PE",
"Nome da Comunidade": "Agrovila 4"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-38.3445892,
-8.7940031
]
},
"properties": {
"Ordem": "194",
"Eixo": "Leste",
"Meta": "1L",
"Municipio": "Petrolândia / Floresta",
"Estado": "PE",
"Nome da Comunidade": "Agrovila 5"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-37.8521847,
-8.6774657
]
},
"properties": {
"Ordem": "195",
"Eixo": "Leste",
"Meta": "1L",
"Municipio": "Inajá/Ibimirim",
"Estado": "PE",
"Nome da Comunidade": "Indígena Kambiwá - Baxa da Alexandra"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-37.9229577,
-8.645232
]
},
"properties": {
"Ordem": "196",
"Eixo": "Leste",
"Meta": "1L",
"Municipio": "Inajá",
"Estado": "PE",
"Nome da Comunidade": "Indígena Kambiwá - Barracão"
}
}
]
};
如何尝试渲染标记:
var layerComunidades1N = L.geoJson(meta1nJson).addTo(map);
我找不到我的错误,根据leaflet文档,如果我不传递pointToLayer选项,它应该渲染默认标记,我错了吗?