Tag: 谷歌方向

Kotlin klaxon解析Google方向Api

对不起,我的英文(谷歌翻译)。 我试图用klaxon( https://github.com/cbeust/klaxon )在Kotlin上从google的方向得到两点之间的距离。 fun distanceDier (start: LatLng, end: LatLng, mode: String) { val url = ("http://maps.googleapis.com/maps/api/directions/json?" + "origin=" + start.latitude + "," + start.longitude + "&destination=" + end.latitude + "," + end.longitude + "&sensor=false&units=metric&mode=" + mode) val result = URL("$url").readText() val parser: Parser = Parser() val stringBuilder: StringBuilder = StringBuilder(result) val json: JsonObject = […]