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 /altoslib/AltosMap.java | |
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 'altoslib/AltosMap.java')
-rw-r--r-- | altoslib/AltosMap.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/altoslib/AltosMap.java b/altoslib/AltosMap.java index 1841277f..08ac5f3c 100644 --- a/altoslib/AltosMap.java +++ b/altoslib/AltosMap.java @@ -51,6 +51,7 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { }; AltosMapInterface map_interface; + int scale; AltosMapCache cache; @@ -328,7 +329,8 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { if (!tiles.containsKey(point)) { AltosLatLon ul = transform.lat_lon(point); AltosLatLon center = transform.lat_lon(new AltosPointDouble(x + AltosMap.px_size/2, y + AltosMap.px_size/2)); - AltosMapTile tile = map_interface.new_tile(cache, ul, center, zoom, maptype, px_size); + AltosMapTile tile = map_interface.new_tile(cache, ul, center, zoom, maptype, px_size, scale); + debug("show state %s url %s\n", AltosMapTile.status_name(tile.store.status()), tile.store.url); tile.add_listener(this); tiles.put(point, tile); } @@ -475,11 +477,16 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { drag_stop(x, y); } - public AltosMap(AltosMapInterface map_interface) { + public AltosMap(AltosMapInterface map_interface, int scale) { this.map_interface = map_interface; + this.scale = scale; cache = new AltosMapCache(map_interface); line = map_interface.new_line(); path = map_interface.new_path(); set_zoom_label(); } + + public AltosMap(AltosMapInterface map_interface) { + this(map_interface, 1); + } } |