2016-09-23 95 views
0

我得到了答案从stackoverflow java reverse code to get address from lattitude and longitude。但在这个问题的答案我不能访问packege GeoApi背景下,GeocodingResult,GeocodingApi.I我写的Java Web application.could谁能告诉我什么是packege或jar文件我下载到包括那些packege 我的答案代码是java反向代码从经度和纬度获取地址

GeoApiContext gtx = new GeoApiContext().setApiKey("**<<<<your-key-here>>>>**"); 
try { 
    GeocodingResult[] gResp = GeocodingApi.newRequest(gtx) 
     .latlng(new LatLng(37, -121)).await(); 
    System.out.println(gResp[0].formattedAddress); 
} catch (Exception e) { 
    // TODO Auto-generated catch block 
    e.printStackTrace(); 
} 
+0

https://github.com/googlemaps/google-maps-services-java – shmosel

回答

1

如果你想下载的罐子,你可以做到这一点上mvnrepository.comgoogle-maps-services-0.1.15.jar

Maven的

如果您正在使用maven这里的坐标:

<dependency> 
    <groupId>com.google.maps</groupId> 
    <artifactId>google-maps-services</artifactId> 
    <version>0.1.15</version> 
</dependency> 

更多的信息,你会发现这里:developers.google.com

+0

但我得到一个错误,因为找不到符号:LatLng – vignesh

+0

@vignesh你会在包中找到它:'com.google.maps.model' – dit