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>
android:layout_height="wrap_content"
android:text="@string/preload_types"
/>
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"
<CheckBox android:id="@+id/preload_hybrid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="wrap_content"
android:text="@string/preload_terrain"
/>
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"
<TextView android:id="@+id/preload_min_zoom_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
private ArrayAdapter<AltosLaunchSite> known_sites_adapter;
private ArrayAdapter<AltosLaunchSite> known_sites_adapter;
private CheckBox hybrid;
private CheckBox satellite;
private CheckBox roadmap;
private CheckBox terrain;
private CheckBox hybrid;
private CheckBox satellite;
private CheckBox roadmap;
private CheckBox terrain;
private Spinner known_sites_spinner;
private Spinner min_zoom;
private Spinner known_sites_spinner;
private Spinner min_zoom;
private int bit(CheckBox box, int value) {
if (box.isChecked())
return 1 << value;
return 0;
}
private int bit(CheckBox box, int value) {
if (box.isChecked())
return 1 << value;
return 0;
}
return (bit(hybrid, AltosMap.maptype_hybrid) |
bit(satellite, AltosMap.maptype_satellite) |
bit(roadmap, AltosMap.maptype_roadmap) |
bit(terrain, AltosMap.maptype_terrain));
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;
latitude = (EditText) findViewById(R.id.preload_latitude);
longitude = (EditText) findViewById(R.id.preload_longitude);
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);
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,
min_zoom = (Spinner) findViewById(R.id.preload_min_zoom);
add_numbers(min_zoom,
}
public boolean set_maptype(int maptype) {
}
public boolean set_maptype(int maptype) {
if (maptype != this.maptype) {
this.maptype = maptype;
tiles.clear();
repaint();
return true;
}
if (maptype != this.maptype) {
this.maptype = maptype;
tiles.clear();
repaint();
return true;
}
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;
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; */
load_centre = new AltosLatLon(lat, lon);
load_radius = radius;
load_listener = listener;
load_centre = new AltosLatLon(lat, lon);
load_radius = radius;
load_listener = listener;
this.min_z = min_z;
this.max_z = max_z;
this.radius = radius;
this.min_z = min_z;
this.max_z = max_z;
this.radius = radius;
this.all_types = all_types;
this.all_types = all_types;
+*/
+ this.all_types = 1 << AltosMap.maptype_hybrid;
this.scale = scale;
this.abort = false;
start();
this.scale = scale;
this.abort = false;
start();
JLabel zoom_label;
public void set_maptype(int type) {
JLabel zoom_label;
public void set_maptype(int type) {
map.set_maptype(type);
maptype_combo.setSelectedIndex(type);
map.set_maptype(type);
maptype_combo.setSelectedIndex(type);
}
/* AltosUIMapPreload functions */
}
/* AltosUIMapPreload functions */
/* internal layout bits */
private GridBagLayout layout = new GridBagLayout();
/* internal layout bits */
private GridBagLayout layout = new GridBagLayout();
JComboBox<String> maptype_combo;
JComboBox<String> maptype_combo;
c.weighty = 0;
add(zoom_out, c);
c.weighty = 0;
add(zoom_out, c);
maptype_combo = new JComboBox<String>(map.maptype_labels);
maptype_combo.setEditable(false);
maptype_combo = new JComboBox<String>(map.maptype_labels);
maptype_combo.setEditable(false);
c.weightx = 0;
c.weighty = 0;
add(maptype_combo, c);
c.weightx = 0;
c.weighty = 0;
add(maptype_combo, c);
map = new AltosMap(this);
}
}
map = new AltosMap(this);
}
}
JToggleButton load_button;
JButton close_button;
JToggleButton load_button;
JButton close_button;
JCheckBox[] maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1];
JCheckBox[] maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1];
JComboBox<Integer> min_zoom;
JComboBox<Integer> max_zoom;
JComboBox<Integer> min_zoom;
JComboBox<Integer> max_zoom;
private int all_types() {
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;
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) {
}
void center_map(double latitude, double longitude) {
pane.add(close_button, c);
pane.add(close_button, c);
JLabel types_label = new JLabel("Map Types");
c.gridx = 2;
c.gridwidth = 2;
JLabel types_label = new JLabel("Map Types");
c.gridx = 2;
c.gridwidth = 2;
c.gridy = (type & 1) + 3;
pane.add(maptypes[type], c);
}
c.gridy = (type & 1) + 3;
pane.add(maptypes[type], c);
}
JLabel min_zoom_label = new JLabel("Minimum Zoom");
c.gridx = 4;
JLabel min_zoom_label = new JLabel("Minimum Zoom");
c.gridx = 4;