简体   繁体   English

如何使用JavaScript或jQuery拍摄Google地图的屏幕截图?

[英]How to take screenshot of a Google map using JavaScript or jQuery?

I want to take a 'screenshot' of a google map in my html file using JavaScript. 我想使用JavaScript在html文件中拍摄Google地图的“屏幕快照”。

The map is currently loading in div tags, so I am not able to get image using this <div> tag. 该地图当前正在div标签中加载,因此我无法使用此<div>标签获取图像。

But if I can load it in canvas <canvas> then I can take a screenshot of it very easily, can anybody tell me solution for this problem - that is, how can I load a google map in canvas. 但是,如果我可以将其加载到canvas <canvas>那么我可以非常轻松地对其进行截图,有人可以告诉我该问题的解决方案吗-也就是说,如何在画布中加载google map。

Or is there any alternative solution for this? 还是为此有其他替代解决方案?

为什么不只使用Google Maps Image API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM