如果数据在外部文件(geojson)中,如何将坐标从 Leaflet 坐标系转换为 Google 使用的坐标系(WGS-84?)?在使用外部 geojson 文件的示例中,我已经为巴黎和萨格勒布定义了坐标,我正在寻找将这些坐标转换为准确位置的解决方案:)
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "par",
"properties": {
"name": "Paris"
},
"geometry": {
"type": "Point",
"coordinates": [
48.858093,
2.294694
]
}
},
{
"type": "Feature",
"id": "zg",
"properties": {
"name": "Zagreb"
},
"geometry": {
"type": "Point",
"coordinates": [
45.815399,
15.966568
]
}
}
]
}
有 Proj4js JavaScript 库,但我找不到这种情况的类似示例(带有外部文件)。