diff options
author | Keith Packard <keithp@keithp.com> | 2018-10-07 10:01:30 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2018-10-07 10:01:30 -0700 |
commit | 5c957107ee5917d865eb866319f86cf8c109f212 (patch) | |
tree | 41ad62be720a8c86d6775c2a3dfd502134344e35 | |
parent | e4f4183ce206d4cb7bbc89e1065eb34b05cf11c4 (diff) |
altosui/altosdroid: Disable offline map type selections
Our server only supports hybrid maps for now. If that changes, we can
re-add this support easily enough.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosdroid/res/layout/map_preload.xml | 2 | ||||
-rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java | 9 | ||||
-rw-r--r-- | altoslib/AltosMap.java | 4 | ||||
-rw-r--r-- | altoslib/AltosMapLoader.java | 3 | ||||
-rw-r--r-- | altosuilib/AltosUIMap.java | 7 | ||||
-rw-r--r-- | altosuilib/AltosUIMapPreload.java | 7 |
6 files changed, 30 insertions, 2 deletions
diff --git a/altosdroid/res/layout/map_preload.xml b/altosdroid/res/layout/map_preload.xml index 321e5ee3..4e60df2d 100644 --- a/altosdroid/res/layout/map_preload.xml +++ b/altosdroid/res/layout/map_preload.xml @@ -62,6 +62,7 @@ android:layout_height="wrap_content" android:text="@string/preload_types" /> +<!-- <CheckBox android:id="@+id/preload_hybrid" android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -82,6 +83,7 @@ android:layout_height="wrap_content" android:text="@string/preload_terrain" /> +--> <TextView android:id="@+id/preload_min_zoom_label" android:layout_width="fill_parent" android:layout_height="wrap_content" diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java index 7bc9ab5c..e393b566 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java @@ -54,10 +54,12 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe private ArrayAdapter<AltosLaunchSite> known_sites_adapter; +/* private CheckBox hybrid; private CheckBox satellite; private CheckBox roadmap; private CheckBox terrain; +*/ private Spinner known_sites_spinner; private Spinner min_zoom; @@ -196,17 +198,22 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe return r; } +/* private int bit(CheckBox box, int value) { if (box.isChecked()) return 1 << value; return 0; } +*/ private int types() { +/* return (bit(hybrid, AltosMap.maptype_hybrid) | bit(satellite, AltosMap.maptype_satellite) | bit(roadmap, AltosMap.maptype_roadmap) | bit(terrain, AltosMap.maptype_terrain)); +*/ + return 1 << AltosMap.maptype_hybrid; } private void load() { @@ -318,12 +325,14 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe latitude = (EditText) findViewById(R.id.preload_latitude); longitude = (EditText) findViewById(R.id.preload_longitude); +/* hybrid = (CheckBox) findViewById(R.id.preload_hybrid); satellite = (CheckBox) findViewById(R.id.preload_satellite); roadmap = (CheckBox) findViewById(R.id.preload_roadmap); terrain = (CheckBox) findViewById(R.id.preload_terrain); hybrid.setChecked(true); +*/ min_zoom = (Spinner) findViewById(R.id.preload_min_zoom); add_numbers(min_zoom, diff --git a/altoslib/AltosMap.java b/altoslib/AltosMap.java index e183e933..9e5f578d 100644 --- a/altoslib/AltosMap.java +++ b/altoslib/AltosMap.java @@ -211,12 +211,14 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { } public boolean set_maptype(int maptype) { +/* if (maptype != this.maptype) { this.maptype = maptype; tiles.clear(); repaint(); return true; } +*/ return false; } @@ -350,7 +352,7 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { public void set_load_params(int new_zoom, int new_type, double lat, double lon, int radius, AltosMapTileListener listener) { if (AltosMap.min_zoom <= new_zoom && new_zoom <= AltosMap.max_zoom) zoom = new_zoom; - maptype = new_type; +/* maptype = new_type; */ load_centre = new AltosLatLon(lat, lon); load_radius = radius; load_listener = listener; diff --git a/altoslib/AltosMapLoader.java b/altoslib/AltosMapLoader.java index 727dfbcb..4047907d 100644 --- a/altoslib/AltosMapLoader.java +++ b/altoslib/AltosMapLoader.java @@ -214,7 +214,10 @@ public class AltosMapLoader extends Thread implements AltosMapStoreListener { this.min_z = min_z; this.max_z = max_z; this.radius = radius; +/* this.all_types = all_types; +*/ + this.all_types = 1 << AltosMap.maptype_hybrid; this.scale = scale; this.abort = false; start(); diff --git a/altosuilib/AltosUIMap.java b/altosuilib/AltosUIMap.java index 3fb33d4a..7f114e37 100644 --- a/altosuilib/AltosUIMap.java +++ b/altosuilib/AltosUIMap.java @@ -386,8 +386,10 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM JLabel zoom_label; public void set_maptype(int type) { +/* map.set_maptype(type); maptype_combo.setSelectedIndex(type); +*/ } /* AltosUIMapPreload functions */ @@ -433,7 +435,9 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM /* internal layout bits */ private GridBagLayout layout = new GridBagLayout(); +/* JComboBox<String> maptype_combo; +*/ MapView view; @@ -522,6 +526,7 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM c.weighty = 0; add(zoom_out, c); +/* maptype_combo = new JComboBox<String>(map.maptype_labels); maptype_combo.setEditable(false); @@ -540,7 +545,7 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM c.weightx = 0; c.weighty = 0; add(maptype_combo, c); - +*/ map = new AltosMap(this); } } diff --git a/altosuilib/AltosUIMapPreload.java b/altosuilib/AltosUIMapPreload.java index 36b32c85..ffd974ac 100644 --- a/altosuilib/AltosUIMapPreload.java +++ b/altosuilib/AltosUIMapPreload.java @@ -144,7 +144,9 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I JToggleButton load_button; JButton close_button; +/* JCheckBox[] maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1]; +*/ JComboBox<Integer> min_zoom; JComboBox<Integer> max_zoom; @@ -215,11 +217,14 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I private int all_types() { +/* int all_types = 0; for (int t = AltosMap.maptype_hybrid; t <= AltosMap.maptype_terrain; t++) if (maptypes[t].isSelected()) all_types |= (1 << t); return all_types; +*/ + return 1 << AltosMap.maptype_hybrid; } void center_map(double latitude, double longitude) { @@ -485,6 +490,7 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I pane.add(close_button, c); +/* JLabel types_label = new JLabel("Map Types"); c.gridx = 2; c.gridwidth = 2; @@ -501,6 +507,7 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I c.gridy = (type & 1) + 3; pane.add(maptypes[type], c); } +*/ JLabel min_zoom_label = new JLabel("Minimum Zoom"); c.gridx = 4; |