[android] Add a method to make map snapshots

Fixes: https://github.com/mapbox/mapbox-gl-native/issues/3466
This commit is contained in:
Vladimir Kurchatkin
2016-03-29 18:00:17 +03:00
committed by Tobrun
parent e692096581
commit 862305d935
6 changed files with 211 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
android:orientation="vertical" >
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/cameraMapView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/snapshotImageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_make_snapshot"
android:id="@+id/makeSnapshotButton"
android:layout_margin="@dimen/fab_margin"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:background="@color/white"/>
</RelativeLayout>

View File

@@ -33,6 +33,7 @@
<string name="activity_geocoder">Geocoder</string>
<!-- Other -->
<string name="activity_snapshot">Snapshot Activity</string>
<string name="activity_user_tracking_mode">User tracking mode</string>
<string name="activity_custom_layer">Custom Layer (experimental)</string>
<string name="activity_map_padding">Map Padding</string>
@@ -63,6 +64,7 @@
<string name="description_directions">Example with Directions API</string>
<string name="description_geocoder">Example with Geocoder API</string>
<string name="description_scroll_by">Scroll with pixels in x,y direction</string>
<string name="description_snapshot">Example to make a snapshot of the map</string>
<string name="menuitem_title_concurrent_infowindow">Concurrent Open InfoWindows</string>
@@ -80,6 +82,7 @@
<string name="button_camera_move">Move</string>
<string name="button_camera_ease">Ease</string>
<string name="button_camera_animate">Animate</string>
<string name="button_make_snapshot">Snapshot</string>
<string name="label_fps">FPS:</string>