【问题标题】:GeoJson data rendering off the mapGeoJson 数据从地图上渲染
【发布时间】:2017-03-20 15:27:49
【问题描述】:

我正在尝试使用 geojson 数据在地图上放置点。当我通过验证器运行我的 geojson 数据时,这些点出现在北极圈上方的地图边缘,我不知道为什么。我计划将这些数据与传单地图和使用 angularjs 构建的项目一起使用。如果有人可以在下面我的 geojson 代码中添加有关任何问题的见解,或者在使用传单和角度时要注意的事项,我将不胜感激!谢谢! 这是我的geojson代码

{"type":"FeatureCollection",
"features":[
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.1199, -86.7775]
    },
    "properties":{
        "name":"Kroger"
    }
},
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.0903, -86.7323]
    },
    "properties":{
        "name":"ALDI"
    }
},
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.1266, -86.8474]
    },
    "properties":{
        "name":"Publix"
    }
}
]
}

【问题讨论】:

    标签: leaflet geojson


    【解决方案1】:

    GeoJSON 使用经度-纬度(或东-北)格式的坐标(阅读relevant bit of the GeoJSON specification),但您的点似乎是纬度-经度。

    我知道这很令人困惑,因为 Leaflet 使用的是 lat-lng 而不是 lng-lat。 Confusion abounds.

    确保使用经纬度作为 GeoJSON 的坐标,你会没事的。

    【讨论】:

    • 感谢伊万桑切斯!这就是解决方法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-11
    • 2021-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-11
    相关资源
    最近更新 更多