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

Commit

Permalink
[android] - add experimental pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Feb 7, 2019
1 parent b8d2038 commit b05cce8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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)
}
}

0 comments on commit b05cce8

Please sign in to comment.