Add runtime API for setting tile prefetch delta for Source class (#184)
* Add runtime API for setting tile prefetch delta for Source class * Use Integer as param. * Update gl native submodule.
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mapbox.mapboxsdk.style.sources;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapbox.mapboxsdk.LibraryLoader;
|
||||
import com.mapbox.mapboxsdk.utils.ThreadUtils;
|
||||
|
||||
@@ -68,6 +70,28 @@ public abstract class Source {
|
||||
return nativeGetAttribution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve current pre-fetching zoom delta.
|
||||
*
|
||||
* @return current zoom delta or null if not set.
|
||||
*/
|
||||
@Nullable
|
||||
public Integer getPrefetchZoomDelta() {
|
||||
return nativeGetPrefetchZoomDelta();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tile pre-fetching zoom delta for current source. Pre-fetching makes sure that a low-resolution
|
||||
* tile at the (current_zoom_level - delta) is rendered as soon as possible at the
|
||||
* expense of a little bandwidth.
|
||||
* If delta has not been set or set to null, it will use the value in MapboxMap instance.
|
||||
*
|
||||
* @param delta zoom delta
|
||||
*/
|
||||
public void setPrefetchZoomDelta(@Nullable Integer delta) {
|
||||
nativeSetPrefetchZoomDelta(delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use
|
||||
*
|
||||
@@ -85,6 +109,14 @@ public abstract class Source {
|
||||
@Keep
|
||||
protected native String nativeGetAttribution();
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
protected native Integer nativeGetPrefetchZoomDelta();
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
protected native void nativeSetPrefetchZoomDelta(Integer delta);
|
||||
|
||||
public void setDetached() {
|
||||
detached = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user