MapSnapshot attribution (#10362)
* [android] - add attribution * [android] - optimise attribution sources * [android] - rework datamodel to attribution class * [android] - refactor Attribution, add tests * [android] - add getter for attribution string * [android] - rework attribution to include small logo, add layout placement * [android] - finalise integration and layout logic
This commit is contained in:
@@ -69,7 +69,7 @@ public class MapSnapshotterActivity extends AppCompatActivity {
|
||||
.withPixelRatio(1)
|
||||
|
||||
// Optionally the style
|
||||
.withStyle((column + row) % 2 == 0 ? Style.TRAFFIC_DAY : Style.DARK);
|
||||
.withStyle((column + row) % 2 == 0 ? Style.MAPBOX_STREETS : Style.DARK);
|
||||
|
||||
// Optionally the visible region
|
||||
if (row % 2 == 0) {
|
||||
|
||||
@@ -9,14 +9,12 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
||||
import com.mapbox.mapboxsdk.constants.Style;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.snapshotter.MapSnapshot;
|
||||
import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
/**
|
||||
@@ -46,7 +44,7 @@ public class MapSnapshotterMarkerActivity extends AppCompatActivity implements M
|
||||
getApplicationContext(),
|
||||
new MapSnapshotter
|
||||
.Options(Math.min(container.getMeasuredWidth(), 1024), Math.min(container.getMeasuredHeight(), 1024))
|
||||
.withStyle(Style.TRAFFIC_DAY)
|
||||
.withStyle(Style.OUTDOORS)
|
||||
.withCameraPosition(new CameraPosition.Builder().target(new LatLng(52.090737, 5.121420)).zoom(15).build())
|
||||
);
|
||||
mapSnapshotter.start(MapSnapshotterMarkerActivity.this);
|
||||
@@ -54,6 +52,12 @@ public class MapSnapshotterMarkerActivity extends AppCompatActivity implements M
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mapSnapshotter.cancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSnapshotReady(MapSnapshot snapshot) {
|
||||
Timber.i("Snapshot ready");
|
||||
|
||||
Reference in New Issue
Block a user