【发布时间】:2018-03-02 10:25:57
【问题描述】:
我正在 Android 上开发一个地图应用程序,用于寻找最佳道路。 问题不是所有道路名称都在 Google API 上,所以我将它放在一个 JSon 文件中。 这是从 JSon 文件中获取坐标并将其显示给 Android 应用程序的最佳方法 从位置 A 到 B 的线条。
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"features": [
{
"type": "Feature",
"properties": {
"Name": "po",
"description": "",
"timestamp": null,
"begin": null,
"end": null,
"altitudeMode": null,
"tessellate": -1,
"extrude": 0,
"visibility": -1,
"drawOrder": null,
"icon": null,
"description_1": null,
"Number": "10",
"RoadNameCo": "03_10234",
"RoadNameAL": "MEHDI HOXHA"
},
"geometry": {
"type": "Point",
"coordinates": [
20.853835,
42.601668,
0
]
}
},
{
"type": "Feature",
"properties": {
"Name": "po",
"description": "",
"timestamp": null,
"begin": null,
"end": null,
"altitudeMode": null,
"tessellate": -1,
"extrude": 0,
"visibility": -1,
"drawOrder": null,
"icon": null,
"description_1": null,
"Number": "16",
"RoadNameCo": "03_10234",
"RoadNameAL": "MEHDI HOXHA"
},
"geometry": {
"type": "Point",
"coordinates": [
20.854006,
42.60127,
0
]
}
}
]
}
【问题讨论】:
-
究竟是什么问题?你不能解析 JSON,或者你不能在地图上做路线?这是 2 个不同的问题,每个问题都已经在这里回答了数百次。
-
不知道如何将 json 解析为谷歌地图?
-
您无法将 JSON 解析为谷歌地图。正如我所说,这是两个不同的问题。首先将 JSON 解析为坐标,然后将坐标设置为谷歌地图。那么您的问题是 2 个不同且完全不相关的任务中的哪一个?
-
好的,谢谢或您的帮助。 l 如何将JSON解析为坐标?
-
each of which was answered here already for few hundred times- 搜索Android parse json,你会找到100多个答案
标签: android json google-maps