Add runtime styling APIs on MapSnapshotter (#268)

* Add styleable snapshotter.

* Add style API for snapshotter

* Add observer interface to snapshotter

* WIP Add styling to snapshotter activity

* Update interface and implement addlayer functions.

* Deprecate methods instead of removing

* Implement addSource functions.

* Implement addImage function

* Still use the previous callback interface.

* Expose onStyleDidloaded interface

* Add setStyle method

* Start native snapshotter from start method

* Fix snapshotter test.

* Fix check style

* Keep the original interface

* Update gl-native

* Add demo for snapshotter heatmap layer

* bump gl-native

Co-authored-by: Alexander Shalamov <alexander.shalamov@mapbox.com>
This commit is contained in:
Kevin Li
2020-03-25 09:59:38 +08:00
committed by GitHub
parent 02b5e60f86
commit da6d8a2b06
19 changed files with 565 additions and 88 deletions

View File

@@ -5,12 +5,6 @@ import android.graphics.Bitmap;
import android.graphics.PointF;
import android.graphics.RectF;
import android.os.Bundle;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Size;
import androidx.annotation.UiThread;
import android.text.TextUtils;
import android.view.View;
@@ -44,6 +38,13 @@ import com.mapbox.mapboxsdk.style.expressions.Expression;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Size;
import androidx.annotation.UiThread;
/**
* The general class to interact with in the Android Mapbox SDK. It exposes the entry point for all
* methods related to the MapView. You cannot instantiate {@link MapboxMap} object directly, rather,
@@ -93,6 +94,13 @@ public final class MapboxMap {
this.developerAnimationStartedListeners = developerAnimationStartedListeners;
}
/**
* Trigger the mapview to repaint.
*/
public void triggerRepaint() {
nativeMapView.triggerRepaint();
}
void initialise(@NonNull Context context, @NonNull MapboxMapOptions options) {
transform.initialise(this, options);
uiSettings.initialise(context, options);