aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-08 21:13:31 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-08 21:13:31 +0000
commit6da7d86db934fcaf5877b725481c164b5321c2ca (patch)
tree6ba404f097c74bc97884f6f4b1a1593723999216 /src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
parent574ea86a77bf4911ae6956c9127ea3bf862352a3 (diff)
downloadsouthamptonuniversitymap-6da7d86db934fcaf5877b725481c164b5321c2ca.tar
southamptonuniversitymap-6da7d86db934fcaf5877b725481c164b5321c2ca.tar.gz
Some more progress on adding non Uni-Link data.
Diffstat (limited to 'src/net/cbaines/suma/SouthamptonUniversityMapActivity.java')
-rw-r--r--src/net/cbaines/suma/SouthamptonUniversityMapActivity.java30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
index f624a43..323c7db 100644
--- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
+++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
@@ -114,7 +114,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity<Databa
// Uni-Link Bus Stop Overlay
private BusStopOverlay nonUniLinkBusStopOverlay;
- private static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true;
+ private static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = false;
// Site Overlays
private HashMap<Site, PathOverlay> siteOverlays = new HashMap<Site, PathOverlay>(21);
@@ -696,6 +696,34 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity<Databa
}
}
+ if (nonUniLinkBusStopOverlay == null && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) {
+ if (pastOverlays != null && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get("NonUniLinkBusStops")) != null) {
+ Log.i(TAG, "Restored bus stop overlays");
+ } else {
+ try {
+ List<BusStop> busStops;
+ Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime));
+
+ busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false);
+
+ Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime));
+
+ nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ overlays.put("BusStops", nonUniLinkBusStopOverlay);
+
+ Log.v(TAG, "Applyed the site overlay, now sorting them");
+
+ synchronized (mapView.getOverlays()) {
+ mapView.getOverlays().add(nonUniLinkBusStopOverlay);
+ Collections.sort(mapView.getOverlays(), comparator);
+ }
+ }
+
uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("Bus Stops:U1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT));
uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("Bus Stops:U1N", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT));
uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("Bus Stops:U2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT));