X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosMap.java;h=0c775f333ee79aacf9ffb08a4c11c243fd9910e5;hb=7175774c4f60ed3efd54417f2035b50ea0108c7b;hp=26851e961453e985169e990939e5b92da4137646;hpb=a995d73838c8e7ec5126e563baa2e59d5e071b28;p=fw%2Faltos diff --git a/altoslib/AltosMap.java b/altoslib/AltosMap.java index 26851e96..0c775f33 100644 --- a/altoslib/AltosMap.java +++ b/altoslib/AltosMap.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_10; +package org.altusmetrum.altoslib_11; import java.io.*; import java.lang.*; @@ -51,6 +51,7 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { }; AltosMapInterface map_interface; + int scale; AltosMapCache cache; @@ -328,7 +329,9 @@ 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(this, 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); } } @@ -345,11 +348,6 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener { centre(lat, lon); tiles.clear(); make_tiles(); - for (AltosMapTile tile : tiles.values()) { - tile.add_store_listener(this); - if (tile.store_status() != AltosMapTile.loading) - listener.notify_tile(tile, tile.store_status()); - } repaint(); } @@ -479,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); + } }