diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-01-22 16:15:28 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-01-24 14:40:17 +0100 |
commit | 079a0892e99e8674f1457e72893ed623cd99bc0c (patch) | |
tree | a83b3c1347bd1b644d73ffecb625e4e3fa2d8b69 | |
parent | 8f230e94dcf064e8c8972050712af1356fc2dd64 (diff) | |
download | qtlocation-mapboxgl-079a0892e99e8674f1457e72893ed623cd99bc0c.tar.gz |
[android] fix zoom precision in GeoJSON cluster example
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java index dfc478eed0..b07aabe169 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.java @@ -58,6 +58,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.textSize; */ public class GeoJsonClusteringActivity extends AppCompatActivity { + private static final double CAMERA_ZOOM_DELTA = 0.01; private MapView mapView; private MapboxMap mapboxMap; @@ -121,7 +122,7 @@ public class GeoJsonClusteringActivity extends AppCompatActivity { if (clickOptionCounter == 0) { double nextZoomLevel = clusterSource.getClusterExpansionZoom(cluster); double zoomDelta = nextZoomLevel - mapboxMap.getCameraPosition().zoom; - mapboxMap.animateCamera(CameraUpdateFactory.zoomBy(zoomDelta, clickPoint)); + mapboxMap.animateCamera(CameraUpdateFactory.zoomBy(zoomDelta + CAMERA_ZOOM_DELTA, clickPoint)); Toast.makeText(this, "Zooming to " + nextZoomLevel, Toast.LENGTH_SHORT).show(); } else if (clickOptionCounter == 1) { FeatureCollection collection = clusterSource.getClusterChildren(cluster); |