Is there a Google Maps equivalent to mkmapsnapshotter?

巧了我就是萌 提交于 2019-12-04 05:40:13
Saxon Druce

There used to be a GMSScreenshot class in the SDK, that could be used to take screenshots. However in v1.2 Google removed this, as you could use renderInContext instead. You can see some background info and sample code here:

Google Maps IOS SDK 1.2 need snapshot of map view

Issue taking screen capture of GMSMapView on Google Maps SDK for iOS

https://developers.google.com/maps/documentation/ios/releases#version_12_-_april_2013

I think though that renderInContext (and GMSScreenshot before it) is designed for taking a screenshot of a map view that is already on a view, has been displayed for a while, has downloaded map tiles etc. I'm not sure that it would work well if you created a map view in the background, set the camera position to your desired lat/lon, rendered it to an image, and then repeated for the other locations you want.

So, I suspect that the Google Maps image API would work better for what you are doing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!