Skip to content
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
37 changes: 19 additions & 18 deletions app/src/main/java/net/osmtracker/activity/DisplayTrackMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
android:title="@string/prefs_displaytrack_osm"
android:summary="@string/prefs_displaytrack_osm_summary"
android:defaultValue="false" />
<ListPreference
<!--<ListPreference
android:entries="@array/prefs_map_tile_keys"
android:title="@string/prefs_map_tile"
android:entryValues="@array/prefs_map_tile_values"
android:key="ui.map.tile"
android:summary="@string/prefs_map_tile_summary"
android:defaultValue="MAPNIK" />
android:defaultValue="MAPNIK" />-->
<ListPreference
android:defaultValue="none"
android:key="ui.orientation"
Expand Down