0

I am developing a Titanium app using Google Maps v2. I want to know is there a hook in Ti that allow me to capture mapview as image. I want to take map snap shot at certain point.

I checked in Android documentation and found it's possible: Capture screen shot of GoogleMap Android API V2

https://developer.android.com/reference/com/google/android/gms/maps/GoogleMap.SnapshotReadyCallback.html

Anybody does have knowledge if this is possible.

Community
  • 1
  • 1
Wikki
  • 590
  • 3
  • 7
  • 26

1 Answers1

0

You can do this in Titanium. Simply refer to the UIView, example:

var snapshotImgBlog = mapView.toImage(); // OR containerViewOfMapView.toImage()

Documentation http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.View-method-toImage

If you want to take the snapshot at a certain point on your map, you'll have to position a view on top of the map (can be an empty) at a location (I'll leave the position/size logic up to you), and use that view: overlayView.toImage().

Yozef
  • 829
  • 11
  • 27