经纬度转换地址
anssin用的是高德地图,实现逆地理位置,首先需要去高德地图开放平台(https://lbs.amap.com/)获取key
我的key就不分享给大家了
逆地理位置用的是http请求 在maven项目里面导入http请求工具包的依赖就可以
<!--发送HTTP请求的Java工具包 --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.7</version> </dependency>
http请求api val httpclient = HttpClients.createDefault val httpGet = new HttpGet(s"https://restapi.amap.com/v3/geocode/regeo?&location=$longitude,$latitude&key=$key")
val response = httpclient.execute(httpGet)
package cn.spark.teacherText.gaodeMap