Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add experimental pointer #13889

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ void onUpdateFullyRendered() {
}
}

/**
* Experimental feature. Do not use.
*/
long getNativeMapPtr() {
return nativeMapView.getNativePtr();
}

// Style

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1378,6 +1378,10 @@ int getHeight() {
return viewCallback.getHeight();
}

long getNativePtr() {
return nativePtr;
}

//
// Snapshot
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down Expand Up @@ -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)
}
}