From 311c42e5e6f4fd5ebaf7549bdbd2ca995576c32a Mon Sep 17 00:00:00 2001 From: xsaco07 Date: Mon, 3 Jun 2019 18:12:33 -0600 Subject: [PATCH 1/2] Comment map tiles sources in preferences --- app/src/main/res/xml/preferences.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index c21577f83..cfa5790f3 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -98,13 +98,13 @@ android:title="@string/prefs_displaytrack_osm" android:summary="@string/prefs_displaytrack_osm_summary" android:defaultValue="false" /> - + android:defaultValue="MAPNIK" />--> Date: Mon, 3 Jun 2019 18:14:04 -0600 Subject: [PATCH 2/2] Use always the default map tile source MAPNIK --- .../osmtracker/activity/DisplayTrackMap.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java b/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java index 4e9f559d1..d0390b914 100644 --- a/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java +++ b/app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java @@ -218,26 +218,27 @@ public void onClick(View v) { public void selectTileSource() { String mapTile = prefs.getString(OSMTracker.Preferences.KEY_UI_MAP_TILE, OSMTracker.Preferences.VAL_UI_MAP_TILE_MAPNIK); Log.e("TileMapName active", mapTile); - osmView.setTileSource(selectMapTile(mapTile)); + //osmView.setTileSource(selectMapTile(mapTile)); + osmView.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE); } - /** - * Returns a ITileSource for the map according to the selected mapTile - * String. The default is mapnik. - * - * @param mapTile String that is the name of the tile provider - * @return ITileSource with the selected Tile-Source - */ - private ITileSource selectMapTile(String mapTile) { - try { - Field f = TileSourceFactory.class.getField(mapTile); - return (ITileSource) f.get(null); - } catch (Exception e) { - Log.e(TAG, "Invalid tile source '"+mapTile+"'", e); - Log.e(TAG, "Default tile source selected: '" + TileSourceFactory.DEFAULT_TILE_SOURCE.name() +"'"); - return TileSourceFactory.DEFAULT_TILE_SOURCE; - } - } +// /** +// * Returns a ITileSource for the map according to the selected mapTile +// * String. The default is mapnik. +// * +// * @param mapTile String that is the name of the tile provider +// * @return ITileSource with the selected Tile-Source +// */ +// private ITileSource selectMapTile(String mapTile) { +// try { +// Field f = TileSourceFactory.class.getField(mapTile); +// return (ITileSource) f.get(null); +// } catch (Exception e) { +// Log.e(TAG, "Invalid tile source '"+mapTile+"'", e); +// Log.e(TAG, "Default tile source selected: '" + TileSourceFactory.DEFAULT_TILE_SOURCE.name() +"'"); +// return TileSourceFactory.DEFAULT_TILE_SOURCE; +// } +// } @Override