From 3b4e6da65158a434905dc652e46c69d2c38cea7f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 May 2015 23:12:34 -0700 Subject: altoslib: Add map loading helper class This adds the AltosMapLoader class, which iterates over a sequence of zoom levels and formats to get local copies of a desired launch site. Signed-off-by: Keith Packard --- altoslib/AltosMapLoaderListener.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 altoslib/AltosMapLoaderListener.java (limited to 'altoslib/AltosMapLoaderListener.java') diff --git a/altoslib/AltosMapLoaderListener.java b/altoslib/AltosMapLoaderListener.java new file mode 100644 index 00000000..79f8b9df --- /dev/null +++ b/altoslib/AltosMapLoaderListener.java @@ -0,0 +1,26 @@ +/* + * Copyright © 2015 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package org.altusmetrum.altoslib_7; + +public interface AltosMapLoaderListener { + public abstract void loader_start(int max); + + public abstract void loader_notify(int cur, int max, String name); + + public abstract void loader_done(int max); +} -- cgit v1.2.3 From d015cfc1499a263549f52d46e9e5b934fcb94f53 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 11 Jul 2015 19:15:08 -0700 Subject: altoslib: Preload maps based on distance rather than number of tiles This lets you get the specific area requested at all zoom levels, rather than having further detail only at lower resolution zooms. Signed-off-by: Keith Packard --- altosdroid/res/layout/map_preload.xml | 8 +- altosdroid/res/values/strings.xml | 2 +- .../altusmetrum/AltosDroid/PreloadMapActivity.java | 66 +++++++++++++-- altoslib/AltosMapLoader.java | 99 ++++++++++++++++++---- altoslib/AltosMapLoaderListener.java | 2 + altosuilib/AltosUIMapPreloadNew.java | 35 ++++++-- 6 files changed, 179 insertions(+), 33 deletions(-) (limited to 'altoslib/AltosMapLoaderListener.java') diff --git a/altosdroid/res/layout/map_preload.xml b/altosdroid/res/layout/map_preload.xml index 1d1fca32..dc613bf2 100644 --- a/altosdroid/res/layout/map_preload.xml +++ b/altosdroid/res/layout/map_preload.xml @@ -103,15 +103,15 @@ android:prompt="@string/preload_max_zoom" android:spinnerMode="dropdown" /> - -