diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-11 12:48:10 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-05-11 23:22:15 -0700 |
commit | 2ec7e14f0104e3a227ff566fa2fc1f6286ddd9d0 (patch) | |
tree | 17f703dc3e92a6d0dc86976b02934a13d9bbaa1a /altosuilib | |
parent | ab905d2f7d8929080042cfd16cc418ea5792c3cb (diff) |
altoslib: Get rid of AltosMap from AltosMapLoader
Cleans up the loader API and eliminates a AltosMapTile for every chunk
of map data.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib')
-rw-r--r-- | altosuilib/AltosUIMapNew.java | 8 | ||||
-rw-r--r-- | altosuilib/AltosUIMapPreloadNew.java | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/altosuilib/AltosUIMapNew.java b/altosuilib/AltosUIMapNew.java index a90e8c91..768fd058 100644 --- a/altosuilib/AltosUIMapNew.java +++ b/altosuilib/AltosUIMapNew.java @@ -241,8 +241,8 @@ public class AltosUIMapNew extends JComponent implements AltosFlightDisplay, Alt } class MapTile extends AltosMapTile { - public MapTile(AltosMapCache cache, AltosLatLon upper_left, AltosLatLon center, int zoom, int maptype, int px_size) { - super(cache, upper_left, center, zoom, maptype, px_size); + public MapTile(AltosMapCache cache, AltosLatLon upper_left, AltosLatLon center, int zoom, int maptype, int px_size, int scale) { + super(cache, upper_left, center, zoom, maptype, px_size, scale); } public void paint(AltosMapTransform t) { @@ -332,8 +332,8 @@ public class AltosUIMapNew extends JComponent implements AltosFlightDisplay, Alt return new MapMark(lat, lon, state); } - public AltosMapTile new_tile(AltosMapCache cache, AltosLatLon upper_left, AltosLatLon center, int zoom, int maptype, int px_size) { - return new MapTile(cache, upper_left, center, zoom, maptype, px_size); + public AltosMapTile new_tile(AltosMapCache cache, AltosLatLon upper_left, AltosLatLon center, int zoom, int maptype, int px_size, int scale) { + return new MapTile(cache, upper_left, center, zoom, maptype, px_size, scale); } public int width() { diff --git a/altosuilib/AltosUIMapPreloadNew.java b/altosuilib/AltosUIMapPreloadNew.java index 3e4a604f..7cdba382 100644 --- a/altosuilib/AltosUIMapPreloadNew.java +++ b/altosuilib/AltosUIMapPreloadNew.java @@ -138,6 +138,7 @@ public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener JComboBox<Integer> min_zoom; JComboBox<Integer> max_zoom; JComboBox<Double> radius; + int scale = 1; Integer[] zooms = { -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6 }; @@ -249,9 +250,12 @@ public class AltosUIMapPreloadNew extends AltosUIFrame implements ActionListener else r = r * 1000; - loader = new AltosMapLoader(map.map, this, + map.map.centre(new AltosLatLon(latitude, longitude)); + + loader = new AltosMapLoader(this, latitude, longitude, - min_z, max_z, r, all_types()); + min_z, max_z, r, + all_types(), scale); } catch (ParseException pe) { load_button.setSelected(false); |