0

我想使用谷歌地图生成位图文件,而不通过 mapView 传递数据,例如后台线程(下载图块以写入位图)

有人有想法吗?

一个例子是:输入坐标并单击按钮后,在 SD 卡中生成 .png,其中包含 COMPLETE 加载的图块。

有什么建议吗?

谢谢!!!

4

1 回答 1

7

此方法返回带有地图图像的 url

public static String getMapUrl(Double lat, Double lon, int width, int height) {
    final String coordPair = lat + "," + lon;
    return "http://maps.googleapis.com/maps/api/staticmap?"
            + "&zoom=16"
            + "&size=" + width + "x" + height
            + "&maptype=roadmap&sensor=true"
            + "&center=" + coordPair
            + "&markers=color:black|" + coordPair;
}

您可以下载或在 ImageView 上显示

于 2012-08-24T10:31:28.813 回答