Android的生成位图,从谷歌地图没有图形页面 [英] android generate bitmap from google map without mapView

查看:130
本文介绍了Android的生成位图,从谷歌地图没有图形页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要生成使用谷歌地图的位图文件,而无需传递数据通过一个图形页面,就像一个后台线程(为了写位图下载瓦)

I want to generate a bitmap file using google maps without passing data through a mapView, like a background thread (downloading tiles in order to write the bitmap)

有没有人有一个想法?

一个例子是:输入坐标,然后点击一个按钮后,巴纽在SD卡中产生,包含完整的装砖

an example is: entering coordinates and after clicking a button, the .png is generated in the SD Card, containing the COMPLETE loaded tiles.

任何建议?

谢谢!

推荐答案

这个方法返回的URL与地图图像

This method returns url with map image

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的显示它

You can download or display it on ImageView

这篇关于Android的生成位图,从谷歌地图没有图形页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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