[android] - add experimental pointer (#13889)
This commit is contained in:
@@ -228,6 +228,13 @@ public final class MapboxMap {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Experimental feature. Do not use.
|
||||
*/
|
||||
long getNativeMapPtr() {
|
||||
return nativeMapView.getNativePtr();
|
||||
}
|
||||
|
||||
// Style
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,7 +70,7 @@ final class NativeMapView implements NativeMap {
|
||||
|
||||
// Holds the pointer to JNI NativeMapView
|
||||
@Keep
|
||||
long nativePtr = 0;
|
||||
private long nativePtr = 0;
|
||||
|
||||
// Listener invoked to return a bitmap of the map
|
||||
private MapboxMap.SnapshotReadyCallback snapshotReadyCallback;
|
||||
@@ -1378,6 +1378,10 @@ final class NativeMapView implements NativeMap {
|
||||
return viewCallback.getHeight();
|
||||
}
|
||||
|
||||
long getNativePtr() {
|
||||
return nativePtr;
|
||||
}
|
||||
|
||||
//
|
||||
// Snapshot
|
||||
//
|
||||
|
||||
@@ -35,6 +35,7 @@ class MapboxMapTest {
|
||||
every { nativeMapView.isDestroyed } returns false
|
||||
every { nativeMapView.setOnFpsChangedListener(any()) } answers {}
|
||||
every { nativeMapView.prefetchTiles = any() } answers {}
|
||||
every { nativeMapView.nativePtr } returns 5
|
||||
every { nativeMapView.setLatLngBounds(any()) } answers {}
|
||||
every { transform.minZoom = any() } answers {}
|
||||
every { transform.maxZoom = any() } answers {}
|
||||
@@ -102,4 +103,9 @@ class MapboxMapTest {
|
||||
fun testEaseCameraChecksDurationPositive() {
|
||||
mapboxMap.easeCamera(CameraUpdateFactory.newLatLng(LatLng(30.0, 30.0)), 0, null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testGetNativeMapPtr() {
|
||||
assertEquals(5, mapboxMap.nativeMapPtr)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user