From 30e9b20a5bc9dc18c34dc61e5bef38071a14c281 Mon Sep 17 00:00:00 2001 From: Archaejohn Date: Tue, 16 Jan 2018 17:04:41 -0800 Subject: [PATCH] Improved Map Performance for OSM basemaps (#1784) This increases the displayed size of the tiles on the screen and therefore reduces the numbers of tiles being requested at any given time to speed up the entire map display as well as increase the size of objects on the screen while maintaining the appropriate zoom level for the tile provider. --- .../odk/collect/android/activities/GeoPointOsmMapActivity.java | 1 + .../odk/collect/android/activities/GeoShapeOsmMapActivity.java | 1 + .../odk/collect/android/activities/GeoTraceOsmMapActivity.java | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/collect_app/src/main/java/org/odk/collect/android/activities/GeoPointOsmMapActivity.java b/collect_app/src/main/java/org/odk/collect/android/activities/GeoPointOsmMapActivity.java index 0d6504f11ca..9e3d8505c64 100644 --- a/collect_app/src/main/java/org/odk/collect/android/activities/GeoPointOsmMapActivity.java +++ b/collect_app/src/main/java/org/odk/collect/android/activities/GeoPointOsmMapActivity.java @@ -125,6 +125,7 @@ protected void onCreate(Bundle savedInstanceState) { map.setMultiTouchControls(true); map.setBuiltInZoomControls(true); + map.setTilesScaledToDpi(true); } marker = new Marker(map); diff --git a/collect_app/src/main/java/org/odk/collect/android/activities/GeoShapeOsmMapActivity.java b/collect_app/src/main/java/org/odk/collect/android/activities/GeoShapeOsmMapActivity.java index b5b9c8d3439..2adb0ea1694 100644 --- a/collect_app/src/main/java/org/odk/collect/android/activities/GeoShapeOsmMapActivity.java +++ b/collect_app/src/main/java/org/odk/collect/android/activities/GeoShapeOsmMapActivity.java @@ -95,6 +95,7 @@ protected void onCreate(Bundle savedInstanceState) { helper = new MapHelper(this, map, this); map.setMultiTouchControls(true); map.setBuiltInZoomControls(true); + map.setTilesScaledToDpi(true); map.setMapListener(mapViewListener); overlayPointPathListener(); saveButton.setOnClickListener(new View.OnClickListener() { diff --git a/collect_app/src/main/java/org/odk/collect/android/activities/GeoTraceOsmMapActivity.java b/collect_app/src/main/java/org/odk/collect/android/activities/GeoTraceOsmMapActivity.java index d71e5944d06..e8c06cba434 100644 --- a/collect_app/src/main/java/org/odk/collect/android/activities/GeoTraceOsmMapActivity.java +++ b/collect_app/src/main/java/org/odk/collect/android/activities/GeoTraceOsmMapActivity.java @@ -124,6 +124,7 @@ protected void onCreate(Bundle savedInstanceState) { mapView.setMultiTouchControls(true); mapView.setBuiltInZoomControls(true); + mapView.setTilesScaledToDpi(true); mapView.getController().setZoom(zoomLevel); inflater = this.getLayoutInflater(); @@ -893,4 +894,4 @@ public void setMyLocationOverlay(MyLocationNewOverlay myLocationOverlay) { public AlertDialog getErrorDialog() { return errorDialog; } -} \ No newline at end of file +}