用于谷歌地图(或类似)的 Java API [英] Java API for Google Maps (or similar)

查看:32
本文介绍了用于谷歌地图(或类似)的 Java API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一个 Java 库可以充当 Google Maps API 的包装器.我感兴趣的是在我的桌面应用程序上显示特定区域(经度、纬度)的卫星地图.不一定非得是 Google 地图,任何地图服务都可以.

不过我需要的是一个与桌面客户端一起使用的库,没有 javascript、GWT 等.

有什么想法吗?

解决方案

如果您只想显示特定纬度经度的卫星地图图像(没有谷歌地图平移/缩放等),那么您应该查看 明确禁止从浏览器外部访问静态地图.但后来我发现这个 FAQ update 似乎允许它.我可能会询问 Google 人员并得到最终结论.

感谢 Paracycle,不确定这是否是常见问题解答的新增内容,但无论如何都是非常明确,不允许这样做.

I was wondering if there is a Java library that acts as a wrapper for the Google Maps API. What I am interested in is displaying a satellite map of a specific region (lon, lat) on my desktop application. It doesn't have to be Google Maps specifically, any map service would do the trick.

What I need though is a library to work with a desktop client, no javascript, GWT etc.

Any ideas?

解决方案

If you are just looking to display a satellite map image for a specific latitude longitude (without the google maps panning/zooming etc), then you should check out Google Static Maps.

You just need to build a URL string, then make an HTTP request (from your java implementation) for the image (in whatever format you like). You can specify a whole bunch of parameters in the URL to get the satellite image you are after:

From the URL:

http://maps.google.com/staticmap?center=40,26&zoom=1&size=150x112&maptype=satellite&key=ABQIAAAAgb5KEVTm54vkPcAkU9xOvBR30EG5jFWfUzfYJTWEkWk2p04CHxTGDNV791-cU95kOnweeZ0SsURYSA&format=jpg

EDIT: Ok, I actually deleted this answer because I discovered section 10.8 in the TOS explicitly forbids accessing static maps from outside a browser. But then I discovered this FAQ update which seems to allow it. I might ask a Google person and get the final word.

EDIT: Thanks Paracycle, not sure if that is a new addition to the FAQ, but in any case it is pretty explicit, you are not allowed to do this.

这篇关于用于谷歌地图(或类似)的 Java API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆