从 yandex 地图工具包中获取屏幕截图

Get screenshot from yandex map kit

我有yandex.yandexmapkit.MapView。我想从中创建屏幕截图。

如何从 yandex 地图工具包中获取屏幕截图?

有两种方法。

第一个是使用 the static Yandex map API(有时您不需要使用复杂的 Mapkit):

http://static-maps.yandex.ru/1.x/?lang=ru-RU&ll=32.810152,39.889847&size=450,450&z=10&l=map

第二种方法是将MapView画成Bitmapit's not difficult

如果您不想使用静态 Yandex 地图 API,您可以使用 MapView.getScreenshot() 方法。

此外,如果此方法 returns 为 null,那么,简而言之,您应该尝试将 xml 属性 app:movable="true" 添加到您的 MapView。